Posts

Identify traffic sources in bulk

 Say you have a list of IP addresses from a log file of hackers/losers/DDoSers. Step 1, install geoiplookup sudo apt-get install geoip-bin Step 2, for i in `cat list` ; do ( echo -n $i" " ; geoiplookup $i ) ; done | grep -v "South Africa" This basically will let you look up who they are and ignore IPs from home country, in this case South Africa. Once you decide which countries are likely to be hackers (Hello, former soviet bloc!) - then you block their IPs.

throttle traffic on apache

sudo apt install apache2-utils sudo apt install libapache2-mod-evasive vi /etc/apache2/mods-enabled/evasive.conf service apache restart edit it and set values as per below or whatever else you like, the time quantities are seconds     DOSSiteInterval     1     DOSBlockingPeriod   10     #DOSLogDir           "/var/lock/mod_evasive"

botnet ip addresses

 As I block botnets IP addresses I will put them here for yall to block as well. Botnet file list

blocking lame botnets

  #!/bin/sh if [ -z "$1" ] ; then echo please provide the ip to ban exit fi if [ -z "$2" ] ; then echo please provide the reason as a string with underscores echo eg tried_to_hack_dns echo if you provide the reason as http-hacker it will echo prevent this ip from accessing http ports exit fi  if [ -z "`grep $1 /etc/hosts.deny`" ] ; then echo "# "$2 >> /etc/hosts.deny if [ "$2" != "http-hacker" ] ; then echo "sshd,pop,pop3,smb,imap,afp,ftp: "$1 >> /etc/hosts.deny fi if [ "$2" = "http-hacker" ] ; then         echo "sshd,pop,pop3,smb,imap,afp,ftp,http,https: "$1 >> /etc/hosts.deny         fi echo "Added the following to hosts.deny:" tail -n2 /etc/hosts.deny ourIp="[insert here]" echo "iptables -t filter -I INPUT -s $1 -p tcp --dport 22 -d $ourIp -j REJECT etc, etc" iptables -t fil

Pause a program which is using too much CPU

Sometimes your battery is running low and you need to pause a program without quitting it or force-quitting it, so that you can preserve battery but not lose the job that the program is doing. To do this,  Step 1. open a terminal Step 2. type:  ps ax | grep -i  "<program name>" so for example, if it's photoshop you need to pause, replace "<program name>" with "photoshop" Step 3. Next to the results on the far left you'll see a number, usually with 5 digits. E.g. 12345. Step 4. Type:  kill -STOP 12345 where 12345 are the numbers obtained in Step 2-3. Step 5. When you want to resume the program, type kill -CONT 12345 It should then continue to operate or run as usual without problems.

Want to test Linux before committing?

Introduction for Windows users If you are a Windows user and want to test drive Linux before committing to installing it, start with Cygwin, as it's the least invasive/destructive way to get used to Linux. After that, maybe try install Linux Subsystem for Windows (LSW) from the Windows 10 app store. A lot of users will think that installing LSW is the way to go. I disagree. When you have a Linux system, you always end up having to use the command line, and hence, it is best to become proficient at that before you install. Installing LSW will by default put you on a graphical installation of Linux and hence you might get the impression (incorrectly so), that it is a graphical system. It is not. Introduction for people with Macs and how to use Brew If you are a Mac user, you have more or less no need to try Linux, as it will give you a less useful experience than your current experience. Rather learn to use the command line on your machine and its capabilities. On Mac, you have a ter