my random thoughts

Warning: These posts come from my experiences and opinions. They may not be in agreement with your own opinions or beliefs.

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Login
    Login Login form
Recent blog posts
18
Apr
0

Ubuntu 12.04, Multiple PHP Versions, and Virtualmin using PHPBrew

Posted by on in Geek Talk

So, I wanted to upgrade to PHP 5.4 from 5.3 but I didn't want to do it server wide since I host multiple websites.  Therefore, I wanted to do it site by site so that I can test to ensure all is working well.  Unforuntately, Ubuntu doesn't have the cool feature CentOS does where I can install multiple versions of a software without having to compile it myself (at least I couldn't find anything).  So, I'm forced to compile things myself.  

Continue reading
Hits: 39362
13
Sep
2

Website malware scanner script

Posted by on in Geek Talk

Do you want a way to scan your websites for malware?  Sucuri.net has a free website malware scanner.  You can subscribe to their service which will monitor your sites for you and they will even clean up the site if it becomes infected.  But I can do the cleanup myself and thus just wanted something to monitor a group of websites for me and notify me of any compromises.

So, I threw together this little bash script that uses their website to tell me if any of my sites have been compromised.  I'm not a bash expert so it is pretty rudimentary but does the job.  I set up a cron job to run every 4 hours and it emails me if Sucuri has detected any malware on my sites.  

#!/bin/bash
EMAIL="fill_in@youremail.com"

#add your websites here sites[0]="google.com" sites[1]="bing.com" sites[2]="yahoo.com" #sites[3]="" #sites[4]="" #... SENDEMAIL=0 for s in "${sites[@]}" do WARNING=0 > /tmp/malwarecheck.txt lynx --dump http://sitecheck.sucuri.net/results/$s | sed -n "/Security report/,/Spam/p" >> /tmp/malwarecheck.txt while read line; do if [[ "$line" == *error* ]] then WARNING=1 fi done < /tmp/malwarecheck.txt if [ $WARNING -eq 1 ] then SENDEMAIL=1 echo "http://sitecheck.sucuri.net/results/$s:" >> /tmp/malwarecheckemail.txt cat /tmp/malwarecheck.txt >> /tmp/malwarecheckemail.txt echo "" >> /tmp/malwarecheckemail.txt echo "" >> /tmp/malwarecheckemail.txt fi done if [ $SENDEMAIL -eq 1 ] then mail -s "URGENT: Malware detected!" $EMAIL < /tmp/malwarecheckemail.txt fi rm /tmp/malwarecheck.txt 2> /dev/null rm /tmp/malwarecheckemail.txt 2> /dev/null
Continue reading
Hits: 18446
25
Jul
0

Getting Google Drive on Ubuntu

Posted by on in Geek Talk

So, when Google released Drive, I was so excited.  It was half the cost of Dropbox with double the space.  Awesome.  But, no full support for Linux.  Well crap.  Because of that, I'm still holding on to Dropbox for now for the items I sync most frequently.  However, there are files that I do not update as frequent and thus am using Google Drive to store them.  So, whats a Linux user to do?

 

Grive comes to the rescue.  Grive is an open source Linux client for Google Drive.  It work perfectly for me.  The only problem is that it does not keep files synced automatically (ie it doesn't run in the background) so you have to run the  application manually in order for the files to sync.  That's where I've created a little script that runs every 2 minutes via a cron job to do it for me.

 

Of course, you'll need to make sure you have Grive installed and configured.  Use this tutorial on how to do that: http://www.webupd8.org/2012/05/grive-open-source-google-drive-client.html

 

Now, we'll create the script to handle an automatic sync for us.

sudo pico /usr/local/bin/syncgrive.sh

 

Add the following contents then ctrl O then enter to save

#!/bin/sh

if [ "$(pidof grive)" ]
then
echo "Grive is already running."
else
cd /home/myuser/Drive
grive
fi
exit

 

Change /home/myuser/Drive to the Drive folder you configured.

 

Now edit your cronjobs:

crontab -e

 

Then add the job (ctrl O then enter to save):

*/2 * * * * /usr/local/bin/syncgrive > /dev/null 2>&1

 

That will run every 2 minutes.  Adjust to your preferences.

 

There ya go! An automatic sync for Google Drive.

Continue reading
Hits: 18189
10
Jan
0

Virtualmin, Apache, and Nginx Reverse Proxy

Posted by on in Geek Talk

I wanted to be able to setup a reverse proxy with nginx and apache but continue using Virtualmin GPL to manage my domains. The only reason I wanted a reverse proxy is that several of the domains I host utilize a very large amount of images. I wanted a efficient way to handle these images since apache uses the same process to handle everything for the domain user and thus its memory footprint continued to grow till the process was killed. Thus I had processes using 150+ MB of memory just to serve a picture.
Continue reading

Hits: 43242
22
Jul
0

"I Hope I'm Ready"

Posted by on in God's Faithfulness

My grandmother, Nettie Shrader, went to be with the Lord last night.  She passed with her loving husband of 53+ years, her three sons, several of her grandchildren and friends around her. Unfortunately I was not which pains me greatly. But as my sister texted me the scene, I was with them in my mind and heart.  Despite not being with her in the end, we did get to enjoy a good time of fellowship with her and my grandfather a couple weeks ago.  More on that in a few.
Continue reading

Hits: 18883