Conky with Scripts, Weather, Email and images

Conky by Proto from LxH

Well, I decided that finally I had enough freetime to start playing with Conky. I am ok editing conkyrc, adding different fonts and so forth but i’ve never used scripts or images.

Bruce and the Conky boys who run Conky Hardcore! regularly post their Conky configs on LxH so I decided to have a look for something challenging (for me) and found a Conky config by Proto.

Conky first run
First off I just copied his conkyrc and ran it. Not surprisingly I was faced with a terminal full of errors. Directories not found, image files not found, missing scripts etc. I also had to change references to my Wireless network connection and also add my email details.

Conky and extra directories
I realised that the entire Conky setup was split into 3 main directories inside the .Conky directory. Conky1, Conky2 and Conky3. Each of these directories had image, script and sh directories. I moved everything to its correct location and started to make a bit of progress.

Email config [Solved]
Even though Proto had provided me with an TotalEmails script, I kept getting a “No conkyEmail” error, and a quick Google search led me to Kaivalagi’s python script at Ubuntu Forums. I followed his instructions and added the Karmic Koala repo and installed his conkyEmail script.

http://ubuntuforums.org/showthread.php?t=869771

However, now I had one email script in my home directory, and another in /usr/share/conkyemail/conkyEmail.py. I looked through the example that he provided, and looked through both scripts, but I thought, ok, this is beyond me. I’m off to LxH Conky Forum to see if the boys can help me on this one.

http://linux-hardcore.com/index.php?topic=2418.0

EDIT: I solved the email problem by also adding the same email details to my conkyrc as are in the totalemails script.

Harddrive Temperature
The next error I was getting was “sh: hddtemp: not found”, I knew about this from before and installed hddtemp with aptitude directly from then terminal.

Conky Sensors:
I solved this by installing lm-sensors.

Vertical and Horizontal Alignment
Finally, after removing the extra HDD and changing afew things, I only had to try to align everything. Basically, I have a laptop with a 1200X800 widescreen and also that removing some sections made things move up and down, leaving it looking a bit skewiff!

Off to LxH Conky Forum again to ask about how vertical alignment works in Conky:

http://linux-hardcore.com/index.php?topic=2419.0

Screenshot:

Well I decided to keep it minimal while showing the things I want, but blend in well with my wallpaper. I also decided to leave the weather script for another day,

This is the link to the full size image

Block Obsessive Spam Bots by Redirecting their IP address

//

I had a major problem on two forums with obsessive spam attacks. These are the aggressive spambots which repeatedly attack every two minutes, clogging the forum logs with error messages.

Kaptcha was in place for sign ups, but sometimes human spammers sign up then add the details (login + password)  to a spambot script.

1. You add a ban trigger which stops them from posting – They continually try to post spam

2. You add a ban trigger which stops them from logging in – They continually try to login

3. You delete the account and ban the IP, Email address, User name – They come back with different details

I was at my wit’s end so I decided to try and use an htaccess file with a rewrite permanent redirect.

I Googled and found these two sites: HERE and HERE.

This is the result:

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} ^94\.23\.216\.104$ [OR]
RewriteCond %{REMOTE_ADDR} ^94\.23\.216\.103$ [OR]
RewriteCond %{REMOTE_ADDR} ^62\.60\.136\.28$ [OR]
RewriteCond %{REMOTE_ADDR} ^94\.23\.207\.161$ [OR]
RewriteCond %{REMOTE_ADDR} ^61\.145\.121\.124$ [OR]
RewriteCond %{REMOTE_ADDR} ^94\.23\.216\.105$ [OR]
RewriteCond %{REMOTE_ADDR} ^94\.23\.216\.106$ [OR]
RewriteCond %{REMOTE_ADDR} ^212\.117\.162\.244$ [OR]
RewriteCond %{REMOTE_ADDR} ^216\.224\.124\.124$ [OR]
RewriteCond %{REMOTE_ADDR} ^212\.117\.164\.65$ [OR]
RewriteCond %{REMOTE_ADDR} ^91\.121\.109\.65$
RewriteRule .* http://www.usdoj.gov/criminal/cybercrime/cyberstalking.htm [R,L]

My domains are hosted at ICDsoft on Linux servers and have the mod rewrite engine turned off by default. So that had to be enabled. Below that are the Rewrite Conditions which basically tell the server to redirect the incoming IP addresses to the Cyberstalking page of usdoj.gov, which is very apt site for the bastards (spambots) to end up.

I basically have a clean error log directory now, and if a new spambot gets through, I just add its IP to htaccess, and redirect it well away from my forums.

Many people who use Linux have Linux forums, mine are Smf hosted at ICDsoft, and I thought that this info may help some of you fight back the ever increasing spam attacks.

Incidentally, the support at ICDsoft is awesome, I have 4 servers and many sites hosted with them and can do nothing but recommend the quality:

Web Hosting By ICDSoft.com

Ubuntu Slowdown – Dual Boot Loses Swap UUID [Fix]

//

ubuntu-logo-100x90This was reported as an issue before when dual-booting Ubuntu with another distro. Basically the Swap UUID Doesn’t get updated in /etc/fstab when another distro is installed on another partition.

I installed Fedora for a test run on a spare partition, with Grub being installed to MBR.

Later after an Ubuntu update, which included a new kernel and also a newer Grub, Ubuntu took back control of Grub.

I booted into Ubuntu, only to find that everything was a bit sluggish, and having experienced this before, I checked my Swap partition in  readiness to solve this problem which I had a feeling was repeating itself.

Check Swap:

free -m

With the result:

Swap:            0          0          0

Fix with “blkid” to find the real UUID of the Swap Partition:

blkid


/dev/sda1: LABEL="ACER" UUID="320D-180E" TYPE="vfat"
/dev/sda2: LABEL="Fedora-12-i686-L" UUID="3b915b51-c7ce-4077-975d-df2a177b94cb" TYPE="ext4"
/dev/sda3: UUID="78a42ee0-4d8a-474c-9cd6-b3f3a6dd6449" TYPE="ext4"
/dev/sda4: UUID="4bfbb29b-78da-4172-ae54-b1bb934de7f5" TYPE="swap"

Then use Nano to Fstab and change the old Swap UUID to the new UUID:

sudo nano /etc/fstab

Now just turn Swap on and check used memory again:

sudo swapon -a

with the result:

free -m

   Swap:         1153          0       1153

So there you have it, if you install another Linux distro on a spare partition to dual-boot and use the same Swap partition, you may find that when you boot into Ubuntu that it is a little sluggish than usual.

This is a known problem for dual and triple booters, but easily remedied, as you see above.

//