Musings of a *IX guy

All things Unixy and not Unixy
  • rss
  • About
  • Tuqix front page
  • Blog

Stop Spam in Wordpress Comments – Install CAPTCHA

Dave | May 2, 2010

This Wordpress blog has been targeted by Spam bots since it started but recently it has got a lot worse and it is getting tedious to go through all the pending comments and delete the Spam ones.

I’ve seen CAPTCHA used on other sites as a means to distinguish between humans and Spam bots so a quick Google for Wordpress CAPTCHA plugins found a few. I wanted one that is updated regularly so it will still work when a new Wordpress update is available. The plugin I chose was SI CAPTCHA . This seems to be regularly updated , looks very good, has audio and it works fine – I have had no Spam bot comments since installing. The plugin is free but if you find it useful and want to fund further development then there is a Paypal link – if you think how much time this plugin will save you a donation is highly recommended.

The link on the Wordpress plugins site has all the information needed to install. ( Note for Centos check you have php-gd installed – see below ).  Basically you unzip it into wp-contents/plugins directory then go to your Admin page , select plugins ,  then activate the SI Captcha plugin.

There is a nice Captcha support test link to check all is well – my setup failed first time – I got :-

ERROR: GD image support not detected in PHP

ERROR: imagepng function not detected in PHP

This was resolved by installing php-gd RPM. For Centos you would do

yum install php-gd

service httpd restart

Now if anyone wants to add a comment they have to pass the CAPTCHA test which Spam bots are no good at.

Note by default it won’t add the CAPTCHA box to users who are logged in so ensure you have logged out if you want to test it for yourself.

You should see the CAPTCHA at the bottom of this entry.

Comments
2 Comments »
Categories
Uncategorized
Comments rss Comments rss
Trackback Trackback

pptp problem on Ubuntu after upgrading

Dave | June 4, 2009

I have a customer who uses pptp as a VPN for support logins.

After upgrading my Ubuntu server to 9.10 I found my PPTP tunnel would not start. Looking in /var/log/messages I got :-
Jun  4 18:10:20 master2 pppd[5009]: pppd 2.4.5 started by root, uid 0
Jun  4 18:10:20 master2 pppd[5009]: Using interface ppp0
Jun  4 18:10:20 master2 pppd[5009]: Connect: ppp0 <–> /dev/pts/2
Jun  4 18:10:22 master2 pppd[5009]: CHAP authentication succeeded
Jun  4 18:10:22 master2 pppd[5009]: LCP terminated by peer (MPPE required but peer refused)
Jun  4 18:10:25 master2 pppd[5009]: Connection terminated.
Jun  4 18:10:26 master2 pppd[5009]: Modem hangup
Jun  4 18:10:26 master2 pppd[5009]: Exit.

Now I know MPPE has been included in theUbuntu kernel for ages so I checked man pppd and it suggested I need to put something about mppe in /etc/ppp/options.pptp

I unhashed   require-mppe-128    in  /etc/ppp/options.pptp and it now works fine :-

Jun  4 18:23:09 master2 pppd[5703]: pppd 2.4.5 started by root, uid 0
Jun  4 18:23:09 master2 pppd[5703]: Using interface ppp0
Jun  4 18:23:09 master2 pppd[5703]: Connect: ppp0 <–> /dev/pts/2
Jun  4 18:23:11 master2 pppd[5703]: CHAP authentication succeeded
Jun  4 18:23:12 master2 kernel: [  897.391871] padlock: VIA PadLock Hash Engine not detected.
Jun  4 18:23:12 master2 kernel: [  897.393782] PPP MPPE Compression module registered
Jun  4 18:23:12 master2 pppd[5703]: MPPE 128-bit stateless compression enabled
Jun  4 18:23:12 master2 pppd[5703]: local  IP address 192.168.XXX.XXX
Jun  4 18:23:12 master2 pppd[5703]: remote IP address 192.168.XXX.XXX

Comments
No Comments »
Categories
Uncategorized
Comments rss Comments rss
Trackback Trackback

To Do list / Task List manager ; Taskfreak

Dave | May 5, 2009


When ( not if ! ) you decide you need a To Do list / Task List then I suggest you head over to the Lifehacker we site. This is an excellent site for productivity ideas ( also some fun non productive ones ! ). It covers both computer based and non computer based ( e.g. paper notebooks etc. ) tools. If you decide on a paper based approach then head over to Cultpens to select you required pen or pencil from their very interesting collection. They also have a pen finder tool to help you select the perfect writing instrument for your task.

If you decide that  a computer based To Do list / Task List manager  is the way to go then check out a comparison of software .

I wanted a tool that was web based , that could be installed on my own web server and is easy to add and “cross off” tasks.

I tried a few different ones and found Taskfreak to be just want I needed.  It features amongst other things :-

  • Display tasks by project
  • Display tasks by deadline
  • Display completed tasks
  • Add comments to tasks
  • Simple progress bar for tasks
  • Pop up calender when adding deadlines

See the screen shots below for an idea of how it looks

It was also by far the easiest software I tested to create a new task. It is also multi user with several levels of users ( don’t worry if you just want to use it for one person – it is fine to do so ). There is a single user version on the site but it does not have as many features so I suggest you install the multi user version even if it is going to be used by only one person.

The license is GPL and it requires PHP 4.3.1+ or PHP 5 plus MySql  .

Installing Taskfreak

This assumes you already have MySql and PHP setup. These instructions are for Centos but will be similar for various Linux distributions.

Download the tar ball from the Taskfreak site

Create the database

mysql -u root -p
mysql> create database taskfreak;
mysql> grant all privileges on taskfreak.* to taskfreak@localhost identified by ‘Password’ ;

mysql>flush privileges;

I suggest restricting access to the Taskfreak directory for security in Apache. There is a good guide to do this here.

cd /var/www/html

Untar the taskfreak tar ball and rename the directory to taskfreak

chmod -R 755 taskfreak

cd taskfreak/include

vi config.php

Change the value of TZN_DB_USER to be taskfreak

Change the value of TZN_DB_PASS to the password you set above

Point your browser at the taskfreak/install/index.php  script and click on Check install

If everything is OK it will ask you if you want to create the missing tables – click on yes install missing tables for me.

If all is OK then click on Launch Taskfreak

Login as admin ( no password ) and you will be in the application.

You will see a warning about removing the install directory – this should be done so no one can overwrite you install.

cd to the directory you installed Taskfreak in and rm -r install

Set the Admin password and profile

Go to Manage – My Profile

Set your details including a password

Click on return to list

To create another user click on the taskfreaknu1new user icon :-

Fill in the details and click on Account is enabled – this will then let you setup the user as an Administaror , Manager, Intern or Guest.

From the README file explains the privileges :-General permissions:
- guests, interns and managers can view only tasks that belong to the
projects they are associated with
- interns, managers and administrator can create tasks (guests can not)
- interns, managers and administrator can see internal tasks (guests can not)
- managers and administrator can create projects
- managers and administrator can create users
- administrator can edit everything (tasks, projects, users)

Then we can give a specific position to a user when linking him to a project:
- extern: can only see tasks, can not do anything
- official: can add comments (later)
- member: can create tasks
- moderator: can add, edit, delete tasks and comments, manage users and change
project’s status
- leader: can do everything

Associating a task to a user is only for you to organize yourself.
Someone who has access to the system and is associated to a project can see
all (public) tasks of the project.

Using Taskfreak

Taskfreak is easy to use, one of the reason why I chose it was becuase it is so easy to add a task.

To add a new task – Task – New To Do

Fill in the form as desired. The Context selection is for using TaskFreak as part of Getting Things Done (GTD)

If you need to create a new project at the same time just click on the link. To bring up a calendar for the deadline click on the icon.

Add a task

Add a task

Displaying tasks

You can display only tasks belonging to a particular project, display completed tasks only , display both completed and future tasks.

You can order the display by priority, project, deadline, status just by clicking on the headings

Display tasks

Display tasks

Adding comments

You can add time stamped comments by clicking on the “bubble” icon in the Com. field.

TaskFreak adding comments

TaskFreak adding comments

You also have a history and descrption tag

To change the status of a task ( e.g. 40% done ) just click on the Status grids next to the task

To complete a task you can click on the final grid in the status column for the task

You can edit a task just by clicking on it in the Title column.

Customizations and add-ons

As TaskFreak is open source you can customize colours , contexts etc. Head over to the TaskFreak forums where there are lots of hints and also details of plugins .

If you find TaskFreak useful then there is a donation button on the TaskFreak website.

Comments
No Comments »
Categories
Applications to install on a personal web site, Centos, Uncategorized, VPS server
Comments rss Comments rss
Trackback Trackback

Using SiteBar – online bookmark manager

Dave | March 29, 2009

SiteBar online web based bookmark manager

In a previous post I explained how to install SiteBar on your own server. This post is my experiences of using SiteBar , if you don’t have a server to install SiteBar on, you can use the service provided by the authors of SiteBar. SiteBar is GPL open source.

Once you have signed up and logged in you are ready to go.

Although SiteBar works with any browser it looks and works best with a browser that can have a site displayed in a sidebar such as Firefox , Opera and  later versions of IE.

Setting up Firefox to display SiteBar in a sidebar

Go to the start link of your SiteBar web site , highlight the web address including the http:// part and then Edit – Copy.

Next select Bookmarks from the Firefox tool bar , then Organise Bookmarks. A new window appears, expand Bookmarks Menu and select the folder you want the SiteBar bookmark to go to.

Firefox Organise your bookmarks window

Firefox Organise your bookmarks window

Select Organise – Add Bookmark from the toolbar. A new window appears as below. Fill in the Name , right click-  paste in the Location field so the web address of your Sitebar site you copied to the clipboard above inserts. Fill in the Keyword and Description fields. Click the box Load this bookmark in the sidebar , then click Add.

Firefox adding a bookmark in a sidebar

Firefox adding a bookmark in a sidebar

Close the organise bookmarks window. Now when you go to bookmarks and select the bookmark you created above a sidebar will be opened with the SiteBar in it.

Having Sitebar in a sidebar really makes SiteBar brilliant to use.

Firefox showing SiteBar bookmark manager in a sidebar

Firefox showing SiteBar bookmark manager in a sidebar

Sign into SiteBar. If you want to import your current bookmarks into SiteBar this is easy to do and it can handle various formats. First you have to export you browser bookmarks into a file. For Firefox go to Bookmark – Organise Bookmarks – Import and Backup – Export HTML , save the file and remember the filename and location.

For Internet Explorer follow the instructions here.

On your SiteBar menu right click on your user name just below public bookmarks and select Import Bookmarks

Import Bookmarks into SiteBar

Import Bookmarks into SiteBar

The Import Bookmarks screen will display, use the Browse button to select the export file you saved above with your browsers bookmarks in it. The rest of the options can normally be left as default. Then click on Submit.

SiteBar Import Bookmarks screen

SiteBar Import Bookmarks screen

Once done , if you click on you username all of your imported bookmarks will display. You can delete bookmarks and folders by right clicking on the entry.

To go to a web site using a SiteBar bookmark just click on the bookmark and the website will appear in a new tab, the SiteBar sidebar will still be available.

SiteBar displaying a web page

SiteBar displaying a web page

Adding Bookmarks in SiteBar

To add a new folder just right click where you want the new folder to be and fill in the form to give it a name.

To add a link go to the web site in a browser tab . In SiteBar right click on the folder you want the bookmark to appear in and Add Link. Highlight the web address of the web site you want to bookmark in the browser tab and holding down the left mouse button drag the URL into the URL field in the SiteBar menu.

Next click on the Retrieve Link Information button – and here is the really nifty bit – SiteBar will go and get the link information from the web site you want to bookmark including the Favicon if available. What information it brings back is dependent on the target web site – some sites seem very good and SiteBar will even fill in the description field. Edit the fields as you wish and click Submit.

SiteBar adding a link

SiteBar adding a link

Searching your bookmarks

Type a keyword in the SiteBar dialogue box and then click on the backend bookmark icon

SiteBar search bookmarks icon

icon

This will display in a tab your SiteBar bookmarks matching the keyword in the top half of the screen ordered by how often you have clicked on them together with links from the SiteBar community and a Google search ( you can change your default search engine ) in the bottom half . See below as example of a search for the keyword news. It has picked up two bookmarks in my SiteBar – Freshmeat and BBC news.

Displayed bookmark seach results

There are lots of other features in SiteBar that I need to explore. I highly recommend SiteBar as a web based bookmark manager.

Comments
1 Comment »
Categories
Applications to install on a personal web site, Uncategorized, VPS server
Comments rss Comments rss
Trackback Trackback

Replacing a Maplin MOSFET poweramp module

Dave | February 28, 2009

Over the years I have built various DIY Hi-Fi equipment, one such item is a power amplifier which I have been using since I built it over 20 years ago ! One channel started playing up and eventually stop producing sound all together.

The power amplifier consists of two Maplin Electronics 150 watt Mosfet amp modules , a hi-grade power supply with a toroidal transformer and a soft start / speaker protection module , all built from kits.

One of the Mosfet amp modules had blown and rather than try to fix it I thought it would be a good opportunity to update the amp modules to something more modern. The power supply and the soft start / speaker protection unit were all good quality so I wanted to keep them.

I started looking for DIY Hi-Fi kits , the ones at Maplin looked too low end so I searched the web.

There seems a great deal of interest in Class-D amplifiers which brought back memories for me as I built one for my college project years ago when they were not generally used for audio amplifiers. I found a very interesting range of Class-D amplifier kits at 41HZ however I did not fancy soldering surface mount devices and the kits that did not have surface mount devices did not  suit my power supply.

I eventually found some pre-built Mosfet power amp modules at Class-d designs who are in the UK and despite the name of the company the modules are not Class-d which is fine for me as efficiency is not a problem as I have a pretty beefy PSU.

The layout of the components in the module enabled me to re-use the L-bracket heat sink from the Maplin modules ( there are finned heat sinks on the outside of the case to carry away the heat ).

The picture below shows one of the new modules in place with one of the original Maplin modules on the left , the soft start /speaker protection unit at the bottom and the power supply at the right. As you can see the new modules are quite a bit smaller. The sound is as good or better than the Maplin ones – although I’m not a “golden ear” person !

Power Amplifier with one new module

Power Amplifier with one new module

I tend to rebuild things over the years but keep various bits like PSUs and cases so things can look a bit untidy.

Below is my pre-amplifier which I use with the above poweramp – it has been re-built a few times and I’m thinking of rebuilding it again.

preamplifier

preamplifier

Comments
No Comments »
Categories
Hi-Fi, Uncategorized
Comments rss Comments rss
Trackback Trackback

Yum update

Dave | February 14, 2009

Checking for Centos updates and fixes

Centos yum command has an option of check-update  which has a return code of 100 if there are updates together with a list of the updates. If there are no updates but the command worked then it returns 0.

I wrote a quick script to be run from cron to check for updates and send an email if they are any.

#!/bin/bash
# Checks for updates from Centos

MAILADDR=user@yourdomain
YUMTMPF=/var/tmp/yumcheck.$$

yum check-update  > $YUMTMPF  2>&1
RETCODE=”$?”
if  [ "$RETCODE"  -eq 100 ]
then
cat $YUMTMPF | mail -s  “There are Centos updates available on `hostname`” $MAILADDR

else
if   [ "$RETCODE" -ne 0 ]
then
{
cat $YUMTMPF | mail -s   ” Problems with yum check-updates on `hostname`” $MAILADDR
rm  $YUMTMPF
exit 1
}
fi
fi
rm $YUMTMPF
When I actually ran the yum update command I got some errors :-

Transaction Check Error:
file /usr/share/emacs/site-lisp/psvn.el from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/man/man1/svn.1.gz from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/man/man1/svnadmin.1.gz from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/man/man1/svnlook.1.gz from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/man/man5/svnserve.conf.5.gz from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/man/man8/svnserve.8.gz from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5
file /usr/share/xemacs/site-packages/lisp/psvn.el from install of subversion-1.5.5-0.1.el5.rf conflicts with file from package subversion-1.4.2-2.el5

Doing a rpm -qa | grep subversion

-bash-3.2# rpm -qa | grep subversion
subversion-1.5.0-0.1.el5.rf
subversion-1.4.2-2.el5

Showed two versions of subversion installed so I removed the older one :-

-bash-3.2# yum remove subversion-1.4.2-2.el5
Loading “fastestmirror” plugin
Setting up Remove Process
Loading mirror speeds from cached hostfile
* dag: apt.sw.be
* base: centosb2.centos.org
* updates: centosh2.centos.org
* addons: centosj3.centos.org
* extras: centosb2.centos.org
Resolving Dependencies
–> Running transaction check
—> Package subversion.i386 0:1.4.2-2.el5 set to be erased
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package                 Arch       Version          Repository        Size
=============================================================================
Removing:
subversion              i386       1.4.2-2.el5      installed         7.6 M

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       0 Package(s)
Remove       1 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing   : subversion                   ######################### [1/1]

Removed: subversion.i386 0:1.4.2-2.el5
Complete!

Looking at the Dependencies Resolved section it showed the RPM to be i386 whereas my system is X86_64 so that looked like it was the problem. The update worked after that successfully.

Had a problem today with yum update :-

Resolving Dependencies
–> Running transaction check
—> Package file.x86_64 0:4.17-15.el5_3.1 set to be updated
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 229, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 145, in main
(result, resultmsgs) = base.buildTransaction()
File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 94, in _read_db_obj
setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object

A search on Google gave me the answer  :-

yum clean all

Afterwards I was able to do the yum update successfully

Comments
No Comments »
Categories
Centos, Uncategorized, VPS server
Comments rss Comments rss
Trackback Trackback

Navigation

  • AIX
  • Applications to install on a personal web site
  • Centos
  • Email
  • Hi-Fi
  • Linux
  • Linux desktop
  • TSM
  • Uncategorized
  • VPS server
  • Websphere
  • Wordpress

Search

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox