I finally got my own cats! Checkout Bagheera and Leon!
On this sunny day of February 28, 2016, the year of our Lord, I woke up with a bunch of emails telling me MySQL db on this fine server has been going down a whole number of times.
SSH didn't work, until it did. At which point I could not execute any command because OS could not fork anything due to the lack of free memory.
Once the top command managed to work I saw that everything was dominated by a big array of apache2 processes, which indicated some sort of DOS attack.
After a nice reboot (and a backup in between, of course!) I took a look at the logs and discovered a whole bunch of accesses like such:
18.104.22.168 - - [28/Feb/2016:21:40:49 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 22.214.171.124 - - [28/Feb/2016:21:41:10 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 126.96.36.199 - - [28/Feb/2016:21:41:35 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 188.8.131.52 - - [28/Feb/2016:21:42:22 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 184.108.40.206 - - [28/Feb/2016:21:42:30 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 220.127.116.11 - - [28/Feb/2016:21:42:36 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 18.104.22.168 - - [28/Feb/2016:21:42:52 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 22.214.171.124 - - [28/Feb/2016:21:42:55 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-" 126.96.36.199 - - [28/Feb/2016:21:44:01 +0000] "POST /xmlrpc.php HTTP/1.1" 500 607 "-" "-"
As first order of business, I moved xmlrpc.php somewhere out of sight (who needs it anyway? I can post shit just fine!) then minimized the number of processes apache can spawn and added some golden rules to iptables:
# block ukranians iptables -I INPUT -m iprange --src-range 188.8.131.52-184.108.40.206 -j DROP
And now you can read this!
Recently I have had the pleasure of migrating a WordPress website which resulted in a peculiar problem - sending email functionality on the new server no longer worked. After some digging around I found out that PHP has this mail function which uses the sendmail program to actually send your email.
Well after messing around with real sendmail for a good while and still not really understanding how to configure it properly, I decided to write my own sendmail.py script that uses my gmail and its app password to send out an email to whoever PHP/Wordpress wants to send an email to on my behalf.
After script was done I had to tell php to use it via sendmail_path = path to sendmail.py line inside php.ini which was located /etc/php5/apache2/php.ini on my Debian server. Then I just restarted apache server and voila, sending email worked!
Here is sendmail.py in all of its hacky glory:
#!/usr/bin/python #this is replacement for sendmail that php can use to send its goddamn emails import smtplib import sys def findToAddress(lines): for i, val in enumerate(lines): j = val.index("To: ") if j != -1: return val[j+4:] return "" fromaddr = 'firstname.lastname@example.org' lines = sys.stdin.readlines() toaddrs = findToAddress(lines) msg = ''.join(lines) username = 'email@example.com' password = 'your app password' # The actual mail send server = smtplib.SMTP('smtp.gmail.com:25') server.starttls() server.login(username,password) server.sendmail(fromaddr,toaddrs, msg) server.quit()
I have gotten fed up with my past provider - JTLNet, and have switched over to DigitalOcean.com
Not only is JTLNet slow as shit, but they kept restarting my instance for mysterious reasons, and always bullshitted me on the support tickets while never fixing the problem.
On the other hand, Digital Ocean is excellent so far, and for over 2x less the price of JTLNet. Highly recommended for anyone looking for a simple VPS.
Finally got someone with professional camera to take pictures of Rijik & Stesha on NYE. Enjoy.
Bringing life back into the "Rijik" series are more photos of my pussies. To recap: Rijik is the white male cat, and Stesha is the fatty colored female cat.
For the longest time in my life I have only used a single password for all the online services until I realized how much of a bad idea that is.
However I still didn't want to start memorizing a huge set of different passwords for each service so I came up with a following scheme which allows me to remember a single master password while still providing different password for each service. The key is in using a scheme that combines a master password plus the username and name of an online service then running resulting combination through a hash function output of which is what actually ends up being used as a password.
Back when Google was doing it's beta test program for Chrome Netbook, I applied and luckily received my own free CR48 laptop.
I have used Chrome OS for a while and while it's pretty good if you just always want to use chrome browser I was feeling a bit lonely without root access and gnome desktop. So I manned (nerded) up and flashed CR48 BIOS to allow running unsigned code and installed Backtrack 5 on it. Now CR48 is infinitely more usable and entertaining. All hardware (except 3g modem, I haven't gotten around to using that yet) works fine, and I didn't have to install any drivers manually. Only thing I had to do is create a non root user for use for desktop type tasks because by default Backtrack only has root user.
Recently I have gotten around to purchasing my own VPS - Virtual Private Server. I did it because I wanted to have a server with root access on a pretty fast and reliable connection that I could use remotely from everywhere. One of the more useful things I have found to do on it is to run a chat client that I can use remotely from either web interface or SSH. What follows below is a high level description and instructions on how to setup your own IM "cloud"!