INTRO
The aim of this blog. You know how something challenges you and you google away, find a fix with some 'trial and error' and then in the future someone asks about how you did it, or you need to alter/re-do it at a later date but you have forgotten what little trick you did to accomplish it ? Well my aim is to keep a track of what I am working on and methods I have used here. And now, I can access it easily, it can be google indexed for others and I will have a URL to send others for problems I cant recall off hand how I fixed them. I hope you find this site useful.
09-05-2010 17:19
Poor mans Specto
I loved the idea of Specto when I stumbled upon it. But using CentOS at work and Mandriva at home, I did not have access to it in the repositories. So I simply made my own cron job to monitor for a websites change.
My idea was simple. Grab the default home page, store it, then at the next time interval grab it again and do an ms5sum comparison before the new page and the previous. Then I found wget has a Timestamp switch [-N Turn on time-stamping.] So using that, I came up with the below cron job command to check if a page has changed using the timestamp of modification.
01 * * * * cd /home/david/website_diffs/wsp && wget -N http://wspirates.com/ 2>&1 |grep -q "o newer" || printf "Wspirates web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Pirates page updated." david@email.com
To break this down
We have a this run every hour. We have first created the folder /home/david/website_diffs/ and then create a folder in there for each web page. wsp in this example.
- We change to this folder.
- We grab the current page with wget with the -N switch on. This will check if a file of the same name in the working directory has the same or newer timestamp. If it does, it does not download it and prints a message saying "Server file no newer than local file `index.html' -- not retrieving." and a 0 exit status. The command here sends all of wget's output, both errors and standard output to the standard output stream so it can be piped over to grep.
- We grep silently for "o newer" which is a way to search for the message above. If we find this, meaning, the page it not newer, we end there.
- If we do not find this message and grep exits with a non-zero status, then the 'or' (||) control operator kicks in and we run the ensuing command.
- The final command simply emails someone about our discovery.
So quiet simple really. It doesn't work as well as Specto, as Specto allows for a percentage change option which is good for sites with advertising. This could possibly we done with using diff to compare the previously downloaded page and the new one [every hour or so] and work out a percentage of lines that have changed compared to the whole page. But this I did not need as all I want to know if it a page has been updated. I hope this is useful for someone.
08-03-2010 12:04
Football Videos from BYU
Here are a list of videos from 2007 filmed at the campus of BYU. It includes lifting, DB, offensive line etc.
Enjoy! BYU videos
06-01-2010 13:27
LDIF -> vCard
I wish I could have found an offline script to do this rather then uploading all of my contacts to some place I do not know.
22-11-2009 19:41
Recover the SheevaPlug
So you have a nice new shiny Marvell Sheeva Plug computer and you do something [no I wouldn't do experiemental things with mine] that breaks it enough you can no longer gain access over the network. So remedy this, run this command
modprobe ftdi_sio vendor=0x9e88 product=0x9e8fand plug in the Plug to you computer viz the supplied USB cable. That will create /dev/ttyUSB0 by default. No use a serial terminal smulator to gain access. Minicom is what Marvell suggests in the manual, but gtkterm seems to be better. The best though, I find is good old scree. Yep screen. Just run:
screen /dev/ttyUSB0 115200and you're in! You may find your device is on /dev/ttyUSB1 or up, just trial and error to get that sorted. http://www.openplug.org/plugwiki/index.php/Serial_terminal_program#Linux
02-11-2009 15:40
Roundcube and default identity
So when a user logs onto Roundcube for the first time, they are added to the roundcube database, with the default identity. This identity is <username>@localhost. They can, of course, change this and setup more identities in the Settings, but they shouldn't have to. So I found a patch online and modied it slightly to detect the domainname used to get to roundcube and use that as the default domain. Its simply this:
// replace $rcmail_config['mail_domain'] = ''; with:
$rcmail_config['mail_domain'] = preg_replace("/^[a-zA-Z]*\./i", "", $_SERVER['HTTP_HOST']);
Pretty neat huh?
28-09-2009 11:38
Rsync exclude
/dir/ means exclude the root folder /dir
/dir/* means get the root folder /dir but not the contents
dir/ means exclude any folder anywhere where the name contains dir/
Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
/dir means exclude any folder anywhere where the name contains /dir
Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
/var/spool/lpd//cf means skip files that start with cf within any folder
within /var/spool/lpd
03-09-2009 10:35
Rid that man-in-middle warning
I have looked for a solution for years, but nothing could do it totally. Well here it is:
http://linuxcommando.blogspot.com/2008/10/how-to-disable-ssh-host-key-checking.htmlSo basicly, the options you need are:
NoHostAuthenticationForLocalhost yes
StrictHostKeyChecking no
25-08-2009 09:07
Top 5 Video Editors on Linux. [link]
Nice summary for video editing apps on Linux. I use Cinelerra and Avidemux myself. Great pair.
http://www.cyberciti.biz/faq/top5-linux-video-editing-system-software/
12-08-2009 12:13
Tabs in VIM
Yes I am trying to make better use of my screen and also needed to edit two files concurrently.