Musings of a *IX guy

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

Weather Station Display

Dave | June 21, 2009

Display weather on a web page

I wanted to have my own weather station and output the weather on a web page on my VPS server. There are plenty of weather stations available that will output data to a PC and several applications that will display that data on a web page. Most weather stations come with software but it is Windoze based and not Linux. Looking around for weather display software that will run on Linux I found Weather Display this supports a large range of stations , has lots of nice features , runs on Linux ( as well as Mac OSX and Windoze ) but costs around $70.

Looking for free software I found open2300 , this will get data from a La crosse WS2300/WS2305/WS2310/WS2315 Weather Station as well as sending data to Weather Underground and Citizen Weather. There are some very nice web sites using this software as a base for some extra coding. It will also run on a Linksys NSLU2.

Next I found wview , this supports a number of weather stations :-

  • Davis Vantage Pro/Pro2
  • Vaisala WXT510
  • La Crosse WS-2300/2308/2310/2315
  • Oregon Scientific WMR918/968
  • This produces a nice web page as on my server. The software will also run on a Linksys NSLU2 which has been modified to run a full version of Linux which means I don’t have to leave my main PC on all the time to collect the data. I happen to have a NSLU2 which I modifed to run a full version of Linux which I was using as a media streamer ( Firefly ) to stream audio to a Roku Soundbridge and as a backup server  – I have now bought a SqueezeBox Duet and the NSLU2 is a bit too weedy for the SqueezeCenter software so I decided to run wview on this and send the generated HTML over to my VPS server on the net.

    Weather Station choice

    Having decided on wview the supported weather stations currently available in the UK are  the La Crosse WS2300 series and the Davis Vantage Pro, as the Davis Vantage Pro with a PC cable is around four times the price of the La Crosse I decided to buy a La Crosse WS2308. This weather station will also work with the open2300 and WeatherDisplay software mentioned above. It measures indoor/outdoor temperature and humidity ,dew point, wind chill, wind speed and direction, atmospheric pressure and has a rain gauge to measure rain fall. It has a large LCD display unit that can either receive the data from the instruments via cable or wireless – I chose the wireless option as It is the most convenient although it can be less reliable and if you do lose contact with the sensors the PC output will show the outside temperature as 80 degrees C which buggers up your graphs !

    The outside instruments are housed in three units connected together by cable. I mounted the wind anemometer on a TV aerial mast and the rain gauge on a simple L bracket. See the picture below. The TV mast and the bracket to mount it on the wall came from Maplin Electronics.

    WS2308 weather station instruments

    WS2308 weather station instruments

    Prepare the NSLU2 for the Wview software

    As noted above I wanted to install wview on my Linksys NSLU2, the version of Linux I had on there was too old to install wview and so I had to install a new version. To do this the instructions are on the NSLU2 Wiki site. Initially I installed the latest SlugOS ( 5.3 Beta ) but the wview packages ( I decided against compiling the latest version from source as I wanted to get something up and running quickly )  had dependency problems so I installed SlugOS 4.8 Beta as suggested in the manual. As I already had a version of Linux on the NSLU2 ( Unslung ) it was easy to do and it even kept all my data on the USB disk attached. I used sudo upslug2 –image=”slugosbe-4.8-beta-nslu2.bin” from by Ubuntu desktop to flash the new image onto the NSLU2 and once rebooted df showed :-

    root@nslug:~$ df
    Filesystem           1k-blocks      Used Available Use% Mounted on
    /dev/mtdblock4            6528      4948      1580  76% /
    /dev/mtdblock4            6528      4948      1580  76% /dev/.static/dev
    tmpfs                     2048        28      2020   1% /dev
    tmpfs                    15188        20     15168   0% /var/volatile
    tmpfs                    15188         0     15188   0% /dev/shm
    /dev/sda2               116661     18664     91973  17% /media/sda2
    /dev/sda1            240190052  33692576 204057284  14% /media/sda1

    and fdisk /dev/sda :-

    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks  Id System
    /dev/sda1               1       30379   244019286  83 Linux
    /dev/sda2           30380       30394      120487+ 83 Linux
    /dev/sda3           30395       30401       56227+ 82 Linux swap

    /media/sda2 was the Unslung root partition so I made it the SlugOS one :-
    root@nslug:~$  umount /media/sda2
    root@nslug:~$ mkfs.ext3 /dev/sda2
    root@nslug:~$ turnup disk -i /dev/sda2 -t ext3

    Rebooted the NSLU2

    I already had swap on sda3 but it was the wrong version so I remade it :-

    root@nslug:~# mkswap /dev/sda3
    Setting up swapspace version 1, size = 57572864 bytes
    vi /etc/fstab
    /dev/sda3       swap    swap    defaults        0       0
    root@nslug:~# swapon -a

    The NSLU2 does not have an accessible serial port to connect to the weather station. To use a serial connection to the NSLU2 see the Linux NSLU2 Wiki page here.

    I choose the easy option to use a serial to USB converter cable ( from Maplin Electronics code ZP43 ).

    root@nslug:~$ ipkg update
    Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.g
    z
    Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.gz
    Updated list of available packages in /var/lib/ipkg/cross
    Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz
    Updated list of available packages in /var/lib/ipkg/native
    root@nslug:~$

    root@nslug:~$ ipkg install kernel-module-pl2303
    Installing kernel-module-pl2303 (2.6.21.7+svnr927-r0) to root…
    Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/kernel-module-pl2303_2.6.21.7+svnr927-r0_nslu2be.ipk
    Configuring kernel-module-pl2303
    root@nslug:~$ depmod -a
    root@nslug:~$ echo usbserial >> /etc/modutils/modules
    root@nslug:~$ echo pl2303 >> /etc/modutils/modules

    shutdown and plug in the Serial to USB cable

    root@nslug:~$ dmesg
    <6>usbcore: registered new interface driver usbserial
    <6>drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
    <6>usbcore: registered new interface driver usbserial_generic
    <6>drivers/usb/serial/usb-serial.c: USB Serial Driver core
    <6>drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
    <6>pl2303 2-1:1.0: pl2303 converter detected
    <6>usb 2-1: pl2303 converter now attached to ttyUSB0
    <6>usbcore: registered new interface driver pl2303

    Set the timezone and date :-

    root@nslug:~$ ipkg install tzdata
    Installing tzdata (2007e-r1) to root…
    Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/tzdata_2007e-r1_armv5teb.ipk
    Configuring tzdata
    root@nslug:~$ ln -s /usr/share/zoneinfo/Europe/London   /etc/localtime
    logout and back in again
    Set the date MMDDHHMM

    Installing Wview on the NSLU2

    root@nslug:~$ cd /etc/ipkg
    root@nslug:/etc/ipkg$ wget http://www.wviewweather.com/ipkg/wview.conf
    Connecting to www.wviewweather.com[209.55.119.70]:80
    wview.conf           100% |*****************************|    59    –:–:– ETA
    root@nslug:/etc/ipkg$
    root@nslug:/etc/ipkg$ ipkg update
    Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/cross/4.8-beta/Packages.gz
    Updated list of available packages in /var/lib/ipkg/cross
    Downloading http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz
    Inflating http://ipkg.nslu2-linux.org/feeds/slugosbe/native/4.8-beta/Packages.gz
    Updated list of available packages in /var/lib/ipkg/native
    Downloading http://www.scorpiocomputing.com/weather/ipk/Packages.gz
    Inflating http://www.scorpiocomputing.com/weather/ipk/Packages.gz
    Updated list of available packages in /var/lib/ipkg/_wview
    root@nslug:/etc/ipkg$ ipkg list | grep wview

    Look for your weather station model – in my case ws2300 :-

    wview-ws2300-mysql – 4.0.1-r0 – wview is a weather site generator and more for a variety of weather stations

    root@nslug:/etc/ipkg$ ipkg install wview-ws2300-mysql
    Installing wview-ws2300-mysql (4.0.1-r0) to root…
    downloads lots of dependent libraries etc.

    Make the archive directory go to disk rather than in /var ( which is memory on the NSLU2 )

    root@nslug:~$ mkdir /media/sda1/wview
    root@nslug:~$ mkdir /media/sda1/wview/archive
    root@nslug:~$ rmdir /var/wview/archive
    root@nslug:~$ ln -s /media/sda1/wview/archive /var/wview/archive
    root@nslug:~$

    Next run the setup script wviewconfig. In most cases I accepted the defaults except as below

    wviewconfig

    Serial port device – check with dmesg what in is – in my case it is /dev/ttyUSB0

    Use metric measures
    Weather station elevation (feet above sea level ) you can get this information from various sites on the Internet – I used http://www.earthtools.org/

    This site will also give you latitude and longitude

    Local Radar use Google to find a site that you can link to for a radar display or look at other weather sites to see what other people have used.

    Ditto for local forcast

    Run the rsync/ssh daemon wviewsshd?
    1
    As I wanted to use my VPS server on the Internet I use the wviewsshd daemon which does rsync over ssh to get the data to the external server – more about this below.

    After wviewconfig has finished run the script wviewhtmlconfig – I accepted defaults.

    You can always change settings getnerated by the above two scripts at a later date by editing /etc/wview/wview.conf or /etc/wview/htmlgen.conf and restarting wview.

    Setting up rsync to send the data to an external web server

    On the NSLU2

    root@nslug:/etc/ipkg$ ipkg install rsync

    ssh-keygen -t rsa           don’t set a passphrase and accept the defaults

    cat /root/id_rsa.pub

    On your external server

    -bash-3.2# useradd -m -d /home/wview -c “Wview weather” wview
    -bash-3.2# cd ~wview
    -bash-3.2# mkdir .ssh
    -bash-3.2# vi .ssh/authorized_keys

    paste in the output of the cat /root/id_rsa.pub command you ran on the NSLU2 above

    -bash-3.2# chown -R wview:wview /home/wview/.ssh
    -bash-3.2# chmod 700 /home/wview/.ssh
    -bash-3.2# mkdir /var/www/html/weather         (replace /var/www/html with your web server’s document root )

    -bash-3.2# chown wview:wview /var/www/html/weather

    -bash-3.2# ln -s /var/www/html/weather data

    If rsync is not installed then install it :-

    yum install rsync

    On the NSLU2

    Test the ssh connection :-

    root@nslug:-$ ssh -l wview yourextserver.org ls -l /home

    Answer yes to the question about if you want to connect and you should get a listing of the external server’s /home without being prompted for a password.

    root@nslug:-$ vi /root/.ssh/config

    Host yourextserver.org

    User wview

    This means that root will always ssh as user wview when going to your external server.

    Test rsync

    root@nslug:-$ rsync -aqz –rsh=ssh /var/wview/img/ tuqix.org:data
    root@nslug:-$  ssh yourextserver.org ls -l data

    root@nslug:-$  vi /etc/wview/wviewssh.conf
    #Interval Source                        Remote Host               Remote Destination
    #——– —————————–  ————————-         ————–
    1         /var/wview/img                yourextserver.org                                 data

    Plug in the weather station LCD control panel to the serial to USB cable using the serial cable that comes with the weather station.

    Start up wview and monitor the mesages file:-

    root@nslug:-$ /etc/init.d/wview start

    root@nslug:-$ tail -f /var/log/messages

    You should see messages like :-

    Jun 20 16:36:59 (none) user.info wviewd[949]: <1245512219362> : station pollinginterval set to 15 seconds
    Jun 20 16:36:59 (none) user.info wviewd[949]: <1245512219409> : — Station Init
    Start –
    Jun 20 16:36:59 (none) user.info wviewd[949]: <1245512219479> : WS-2300 on /dev/ttyUSB0 opened …
    Jun 20 16:36:59 (none) user.info wviewd[949]: <1245512219555> : station archiveinterval: 5 minutes
    Jun 20 16:37:00 (none) user.info wviewsqld[953]: <1245512220422> : radlib: wview sqld started as a daemon …
    Jun 20 16:37:00 (none) user.warn wviewsqld[953]: <1245512220438> : SQL archiving disabled in wview.conf – exiting…
    Jun 20 16:37:00 (none) user.info htmlgend[956]: <1245512220520> : radlib: htmlgend started as a daemon …
    Jun 20 16:37:00 (none) user.info htmlgend[956]: <1245512220552> : !! configured for metric units/conversion !!
    Jun 20 16:37:00 (none) user.info htmlgend[956]: <1245512220554> : !! Rain units will be mm !!
    Jun 20 16:37:00 (none) user.info htmlgend[956]: <1245512220556> : generating to /var/wview/img
    Jun 20 16:37:00 (none) user.alert wvalarmd[958]: <1245512220579> : /etc/wview/wv alarm.conf does not exist – exiting…
    Jun 20 16:37:00 (none) user.info wviewsshd[963]: <1245512220979> : rsync: updating /var/wview/img ==> yourextserver.org:data every 1 minutes
    Jun 20 16:37:00 (none) user.crit wviewsshd[963]: <1245512220981> : rsync: starting updates in 4 mins 15 secs
    Jun 20 16:40:11 (none) user.info htmlgend[956]: <1245512411515> : Generated: 124
    5Jun 20 16:41:11 (none) user.info htmlgend[956]: <1245512471160> : Generated: 890 ms: 17 images, 14 template files
    Jun 20 16:41:15 (none) user.info wviewsshd[963]: <1245512475271> : Updating: /var/wview/img ==> yourextserver.org:data
    ms: 25 images, 14 template files

    Once you see messages about Generated images and template files followed by wviewsshd updating /var/view/img ==> yourextserver.org then you should get a nice web page at yourextserver.org/weather

    Comments
    No Comments »
    Categories
    Applications to install on a personal web site, VPS server
    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

    Installing Clipperz password manager

    Dave | April 12, 2009

    Clipperz password manager

    There are various password managers around. I wanted one that was web based so I could access it from anywhere , I also wanted to install it on my own web server. I would never use it for anything financial , just for the numerous web sites that require a user name and password.

    After searching around I found Clipperz .  This seemed to do everything I wanted and the community edition is  licensed with  an open source  AGPL license . If you don’t want to install it on your own web server then Clipperz offers a hosted service for users. The Clipperz site explains how the data is encrypted and why it is secure.

    Clipperz has some very nice features :

    • You can copy the password into the clipboard without it showing in clear text.
    • You can create a read only copy on your local desktop in a single HTML file than can be read with a browser , keeping the same encryption method – very cool!
    • You can import passwords from CSV, Excel , KeePass, Password Plus.
    • You can export the passwords and import them into another Clipperz account.
    • It can be run it a Firefox Sidebar or Opera panel

    Installation on Centos 5

    This assumes you already have Apache, PHP and Mysql already installed and working.

    For my Centos server I needed to install json and the bcmath PHP extensions.

    Installing PHP json on Centos 5

    I had to do the following :-

    yum install php-devel

    yum install php-pear        ( this will also install pecl )

    pear install pecl/json            ( if you try to just use pecl to install json you will get an error about a 8MB limit the solution is to use pear – I found this thanks to this page )

    vi /etc/php.d/json.ini and add a line :-

    extension=json.so

    Install bcmath

    yum install php-bcmath

    If you don’t install bcmath you will get the following in the Apache error log when you try to register a user :-

    PHP Fatal error:  Call to undefined function bcscale() in /var/www/html/mytools/clipperz/php/index.php on line 72

    Restart Apache

    service httpd restart

    Creating the database for Clipperz

    mysql -u root -p

    You will be prompted for the Mysql root password you first set when you setup Mysql

    create database clipperz ;

    create all privileges on clipperz.* to “clipperzadmin”@”localhost” identified by “passwd” ;

    flush privileges ;

    exit ;

    passwd is the password you want for the clipperzadmin DB user

    Installing the PHP files

    Download the community edition of Clipperz from sourceforge

    Goto the HTML directory of your Apache installation – /var/www/html on Centos and if ncessary create a subdirectory where you want to install Clipperz. You probably want this directory protected by Apache authorisation. Unzip the Clipperz zip file you downloaded and rename the directory extracted to something like clipperz. Goto the directory and look at the INSTALL.txt file.

    vi php/configuration.php

    Set the database name , database user and database password you set when creating the database.

    Point you browser to the location of Clipperz /php/setup/index.php

    e.g. If you installed Clipperz in /var/www/html/mytools/clipperz you would go to yourdomain/mytools/cliperz/php/setup/index.php

    You will now be in a page with POG  ( PHP Object Generator ). Hit the POG ME UP button and if all goes well you will have a proceed button. Hit that and you will go onto another page where you can examine the database. On the plugins tab make sure you do not install base64 if you do Clipperz will not work on Centos – if the tab says it is installed then click on uninstall.

    You are now ready to use Clipperz. Point your browser at the Clipperz location yourdomain/mytools/cliperz if you used the setting above. Click on the Create One button to create an account.

    There are links on the pages for help and the main Clipperz site is very helpful.

    You may want to donate some money to the project – there are links on the Clipperz site.

    Once installed it is recommended you remove the php/setup directory to prevent someone deleting database records .

    You can backup your settings by exporting the data to json format  ( Data – Export – Export to json format ), this will keep all your settings and can be restored into another Clipperz account.

    Another useful thing is to create an offline copy – this will create a single HTML file that can be loaded in a browser , keeping the same encryption protection.

    Comments
    No Comments »
    Categories
    Applications to install on a personal web site, Centos, 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

    Web based bookmark manager SiteBar

    Dave | February 21, 2009

    Web based bookmark mangers

    There are plenty of web based bookmark manager services out there but I wanted to install my own one on my Linux VPS server.

    After looking at numerous bookmark managers I settled on SiteBar

    See my post here for a walk through using SiteBar

    It is open source , works with any browser, can import and export bookmarks.

    SiteBar provides a service you sign up for if you don’t want to install your own server.

    Installation is very easy. You need to have PHP and Mysql on your server.

    Make a directory somewhere  under your web document root

    mkdir /var/www/html/sitebar

    You probably want to restrict access to the directory using Apache authentication controls

    Download the tar ball from the SiteBar site download page.

    Uncompress and untar :-

    tar xvfj SiteBar-3.3.9.tar.bz2

    Copy the contents to the web directory

    cp -R SiteBar-3.3.9/* /var/www/html/sitebar

    Fire up your browser and go to hostname/sitebar/index.php

    Fill in the DB Password ( this is the root password you set when you setup MySql )

    The rest  left as default

    Click on Create Database

    Click on Check Settings

    Click on Download Config and save the config.inc.php file to your desktop

    Copy the config.inc.php file to /var/www/html/sitebar/inc directory

    Click Check Settings and you hould now go to a new page with an Install Button

    Click Install

    Click setup

    Select language , fill in username , admin passwd, email , real name

    Select the other options as required

    Click on submit

    Everything is now setup and you can start using things.

    There is a link to the help documents but in general you right click on things to bring up an action menu. ( If right click does not work do Control-Right- click , you need to do this with some browsers like Galeon.)

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

    Preventing ssh brute force attacks with DenyHosts

    Dave | February 21, 2009

    Looking in /var/log/secure

    Well my VPS server has been up for just over a week and a check of /var/log/secure shows there have been a number of ssh brute force attacks.

    An example from /var/log/secure :-

    Feb 18 19:30:17 vm sshd[29470]: pam_succeed_if(sshd:auth): error retrieving information about user jodie
    Feb 18 19:30:19 vm sshd[29470]: Failed password for invalid user jodie from 222.122.227.26 port 35485 ssh2
    Feb 18 19:30:19 vm sshd[29471]: Received disconnect from 222.122.227.26: 11: Bye Bye
    Feb 18 19:30:21 vm sshd[29478]: Invalid user jody from 222.122.227.26
    Feb 18 19:30:21 vm sshd[29479]: input_userauth_request: invalid user jody
    Feb 18 19:30:21 vm sshd[29478]: pam_unix(sshd:auth): check pass; user unknown
    Feb 18 19:30:21 vm sshd[29478]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.122.227.26
    Feb 18 19:30:21 vm sshd[29478]: pam_succeed_if(sshd:auth): error retrieving information about user jody
    Feb 18 19:30:23 vm sshd[29478]: Failed password for invalid user jody from 222.122.227.26 port 35986 ssh2
    Feb 18 19:30:23 vm sshd[29479]: Received disconnect from 222.122.227.26: 11: Bye Bye
    Feb 18 19:30:25 vm sshd[29486]: Invalid user joe from 222.122.227.26
    Feb 18 19:30:25 vm sshd[29487]: input_userauth_request: invalid user joe
    Feb 18 19:30:25 vm sshd[29486]: pam_unix(sshd:auth): check pass; user unknown

    I started adding the IP addresses to /etc/hosts.deny but I thought there must be a way of automating things.

    A Google search found DenyHosts which parses the secure log and automatically updates hosts.deny

    DenyHosts has plenty of useful options ( including listing IP addresses that will never be added to hosts.deny – very handy so you don’t lock yourself out ! ). It can run from cron or in daemon mode.

    Installation on Centos

    Get the RPM from the DAG repository ( there are a great number of useful RPMS in the DAG repository and it is well worth adding to yum . There is a PayPal donation button on DAG if you wish to show your appreciation for all the hard work they have saved you).

    yum install denyhosts

    Edit the configuration file

    vi /etc/denyhosts/denyhosts.cfg

    The default setting will work fine but you may want to change things such as :-

    ADMIN_EMAIL   if you want to be emailed about blocked hosts

    The date format and log format.

    The configuration file is very well documented.

    Run the script on your /var/log/secure file :-

    denyhosts.py –file=/var/log/secure

    cat /etc/hosts.deny to see all the hosts it has found causing problems.

    When the script  runs the first time it creates /usr/share/denyhosts/data directory

    vi /usr/share/denyhosts/data/allowed-hosts  and add IP addresses you never want to be blocked each one on their own line.

    Check if denyhosts will be started automatically at boot :-

    -bash-3.2# chkconfig –list denyhosts
    denyhosts          0:off    1:off    2:on    3:on    4:on    5:on    6:off

    Then start it up :-

    -bash-3.2# service denyhosts start
    starting DenyHosts:    /usr/bin/env python /usr/bin/denyhosts.py –daemon –config=/etc/denyhosts/denyhosts.cfg

    Comments
    No Comments »
    Categories
    Centos, VPS server
    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

    Wordpress backups

    Dave | February 11, 2009

    My Wordpress is only a few days old but logging in on the admin dashboard showed a new version of Wordpress is out. I was going to sort out backups a little later but now seems a very good time to do it and then I can do the upgrade.

    The Worpress site has a section on backing up Worpress , basically you backup the database and backup the flat files in your Wordpress HTML directory.

    First create a directory to store the backups :-

    mkdir -p /backups

    chmod 700 /backups

    To backup the Wordpress database I created a little script in /usr/local/bin :-

    #!/bin/bash

    TODAY=`date  ‘+%Y%m%d’`

    DBNAME=wordpress

    DBPASS=wpdbpasswd

    DBUSER=wpdbuser

    mysqldump –opt -u ${DBUSER} ${DBNAME} | gzip > /backups/wordpress.dump.${TODAY}.gz

    ————————————————————————————————————-

    The values for DBNAME , DBPASS and DBUSER  are those setup in the wp-config.php file for your install.

    To backup the flat files I just did a tar :-

    cd /var/www/html ; tar cvf /backups/my-wordpress.20090211.tar  wordpress

    Of course no one cares about backups – only restores count, so you should test your restore on another server. You should also backup the Mysql database which holds the usernames and passwords

    mysqldump mysql -p > /backups/mysql.db.dump.20090211

    You will be prompted for the root user password for the Mysql database which you would have set when you first started up mysqld at install time.

    Don’t forget to copy the dumps and tars to another server in case of a total server loss !

    I will automate all the above with cron and rsync in the future


    Comments
    No Comments »
    Categories
    VPS server, Wordpress
    Comments rss Comments rss
    Trackback Trackback

    Setting up email on a Linux VPS server

    Dave | February 10, 2009

    Email

    In my previous blogs I have documented getting my Linux VPS server and installing Wordpress blogging software. Next comes email.

    There are really two parts – the sending and receiving of emails at the server level and the reading and sending emails from the desktop client. I will alos setup Webmail sometime in the future.

    For the server the two most popular *IX  MTAs are Sendmail and Postfix , with Sendmail being the standard on Unix servers and Postfix the standard on Linux servers. I choose Postfix as I’ve exclusively used Sendmail in the past and I wanted to see what it was like.

    As for the client reading and sending emails I decided to use Dovecot which has become very popular at providing POP3 and IMAP services.

    I wanted to avoid connecting to the server with plain text passwords and so TLS was to be used for encryption and  SASL for authentication.

    There are two excellent Wiki entries for setting up Postfix , Dovecot and SASL/TLS on Centos.

    Setup basic Postfix and Dovecot first ( the only thing extra I had to do was a chown -R user /home/user/Maildir in section 3.3 )

    Once the above works then do the  SASL/TLS setup

    If you have a firewall setup or are using the Centos system-config-securitylevel like me then you need to allow ports 993 and 995 for the encrypted versions of imap and pop3.

    I ran the system-config-securitylevel command – customize and added the above ports.

    Future things to do are to install a Spam control system and a Webmail application.

    Comments
    No Comments »
    Categories
    Email, VPS server
    Comments rss Comments rss
    Trackback Trackback

    Installing Wordpress on a Linux VPS

    Dave | February 10, 2009

    Wordpress blogging software

    Having setup my Linux VPS server ( see previous blog ) it’s time to install some web applications.

    I wanted to install a blog so I could recount my experiances with a Linux VPS server. Wordpress was chosen as it is open source and had very good reviews.

    Wordpress needs PHP and mysql – both of which were installed already.

    First setup Apache so it will use PHP files

    vi /etc/httpd/conf/httpd.conf and search for DirectoryIndex

    Add index.php index.php3 index.pl index.htm index.cgi

    ( they are not all needed for Wordpress but as I’m going to add other software I put them in )

    Restart apache :-

    service httpd restart

    Create the database

    As this is the first application I’m installing that uses mysql there a few steps needed to get msql up and running.

    chkconfig –levels 235 mysqld on

    /etc/init.d/mysqld start

    mysqladmin -u root password ‘apassword’

    ‘apassword’ is the password you want to set for the mysql root user

    mysqladmin -u root -p -h localhost password ‘apassword’

    Now create a database and a user for teh database

    mysql  -u root -p

    create database wordpress ;

    grant all privileges on wordpress.* to “wordpressadmin”@”localhost” identified by “passwd” ;

    flush privileges ;

    exit

    “passwd” is the password you want the wordpressadmin user to have. You don’t have to call the database wordpress or the user wordpressadmin.

    Get the latest Wordpress version :-

    cd /root

    wget http://wordpress.org/latest.tar.gz

    cd /var/www/html

    tar xvfz /root/latest.tar.gz

    Now for the setup and install

    cd wordpress

    cp wp-config-sample.php wp-config.php

    vi wp-config.php

    change DB_NAME , DB_USER, DB_PASSWORD    to the values you used above in mysql.

    Point your browser to https://yourhostname/wordpress/wp-config.php

    Fill in the blog name  and an email address ( you can change these later ) then click install.

    If successful you will get a password for the admin user displayed – make a note of this and login as user admin with that password.

    Click on the Settings link at the left hand side and fill in the Blog Title , Tag Line , Worpress Address URL ( http://yourdomain/wordpress ) , Blog Address ( http://yourdomain/wordpress ).

    Check and change any of the other settings such as date format as you want then save the changes.

    Next setup your profile – click Users and Edit the admin user, fill in your first and last names ( these are not made public ) , a nick name  , select from the drop-down box the name you want to appear as and  an email address.

    Finally change your password , then click on Update Profile

    Now you are ready to blog. Click on Posts at the left hand side – you will see the is already one post which you can either edit or delete. Once you have created your post hit the Publish or Update Post button at the right hand side.

    There are loads of different themes and plugins available for Wordpress – give them a go.

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

    « Previous Entries

    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