Define

Just a quick script for looking up the definition of a word via the commandline…

touch define
vim define

add the following code then :wq to save


#! /bin/bash
# display definition of a word
#
curl --stderr /dev/null dict://dict.org/d:$1 | sed '/^[.,0-9].*$/d'

then,

chmod +x define
mv define /usr/bin/define

Usage

# define linux
Linux
n : an open-source version of the UNIX operating system

Mikogo

Looking to host an online meeting without paying through the teeth? Look no further. Mikogo is a free desktop sharing tool full of features to assist you in conducting the perfect online meeting or web conference.

Take advantage of the opportunity to share any screen content or application over the Internet in true color quality with up to 10 participants simultaneously, while still sitting at your desk.

Mikogo can be employed for a range of professional, academic, or personal uses, including:

online meetings
web conferences
product demonstrations
web presentations
remote support
webinars
and more!

Provide online technical support for your customers. Conduct product demonstrations for business customers. Use Mikogo to discuss and edit a current team project. The ideal tool for free online group collaboration.

Download it today and broadcast your screen between your guests with just 2 mouse-clicks
From mikogo.com

Install YUI Compressor

Install YUI Compressor – A code minification tool

wget http://yuilibrary.com/downloads/yuicompressor/yuicompressor-2.4.2.zip
unzip yuicompressor-2.4.2.zip
mv yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar /opt/fileconveyor/code/processors/yuicompressor.jar

or

Install YUI Compressor via apt:

sudo apt-get install yui-compressor

Compress the script:

java -jar /usr/share/yui-compressor/yui-compressor.jar --type js -v
myscript.js -o myscript.min.js

RPM available here from http://rpm.pbone.net

Secure-Delete

From ubuntugeek.com

The Secure-Delete tools are a particularly useful set of programs that use advanced techniques to permanently delete files. To install the Secure-Delete tools in Ubuntu, run the following command

sudo aptitude install secure-delete

The Secure-Delete package comes with the following commands

srm(Secure remove) – used for deleting files or directories currently on your hard disk.
smem(Secure memory wiper) – used to wipe traces of data from your computer’s memory (RAM).
sfill(Secure free space wiper) – used to wipe all traces of data from the free space on your disk.
sswap(Secure swap wiper) – used to wipe all traces of data from your swap partition.
srm – Secure remove

srm removes each specified file by overwriting, renaming, and truncat-ing it before unlinking. This prevents other people from undeleting or recovering any information about the file from the command line.

srm, like every program that uses the getopt function to parse its arguments, lets you use the — option to indicate that all arguments are non-options. To remove a file called ‘-f’ in the current directory, you could type either “srm — -f” or “srm ./-f”.

srm Syntax

srm [OPTION]… FILE…

Available Options

-d, –directory – ignored (for compatibility with rm)
-f, –force – ignore nonexistent files, never prompt
-i, –interactive – prompt before any removal
-r, -R, –recursive – remove the contents of directories recursively
-s, –simple – only overwrite with a single pass of random data
-m, –medium – overwrite the file with 7 US DoD compliant passes (0xF6,0×00,0xFF,random,0×00,0xFF,random)
-z, –zero – after overwriting, zero blocks used by file
-n, –nounlink – overwrite file, but do not rename or unlink it
-v, –verbose – explain what is being done
–help display this help and exit
–version – output version information and exit

srm Examples

Delete a file using srm

srm myfile.txt

Delete a directory using srm

srm -r myfiles

smem – Secure memory wiper

smem is designed to delete data which may lie still in your memory (RAM) in a secure manner which can not be recovered by thiefs, law enforcement or other threats. Note that with the new SDRAMs, data will not wither away but will be kept static – it is easy to extract the necessary information! The wipe algorythm is based on the paper “Secure Deletion of Data from Magnetic and Solid-State Memory” presented at the 6th Usenix Security Symposium by Peter Gutmann, one of the leading civilian cryptographers.

smem Syntax

smem [-f] [-l] [-l] [-v]

Available Options

-f – fast (and insecure mode): no /dev/urandom.
-l – lessens the security. Only two passes are written: the first with 0×00 and a final random one.
-l -l for a second time lessons the security even more: only one pass with 0×00 is written.
-v – verbose mode

sfill – secure free space wipe

sfill is designed to delete data which lies on available diskspace on mediums in a secure manner which can not be recovered by thiefs, law enforcement or other threats. The wipe algorythm is based on the paper “Secure Deletion of Data from Magnetic and Solid-State Memory” presented at the 6th Usenix Security Symposium by Peter Gutmann, one of the leading civilian cryptographers.

sfill Syntax

sfill [-f] [-i] [-I] [-l] [-l] [-v] [-z] directory/mountpoint

Available Option

-f – fast (and insecure mode): no /dev/urandom, no synchronize mode.
-i – wipe only free inode space, not free disk space
-I -wipe only free disk space, not free inode space
-l -lessens the security. Only two passes are written: one mode with 0xff and a final mode with random values.
-l -l for a second time lessons the security even more: only one random pass is written.
-v – verbose mode
-z – wipes the last write with zeros instead of random data

directory/mountpoint this is the location of the file created in your filesystem. It should lie on the partition you want to write.

sswap – Secure swap wiper

sswap is designed to delete data which may lie still on your swapspace in a secure manner which can not be recovered by thiefs, law enforce?ment or other threats.The wipe algorythm is based on the paper “Secure Deletion of Data from Magnetic and Solid-State Memory” pre?sented at the 6th Usenix Security Symposium by Peter Gutmann, one of the leading civilian cryptographers.

sswap Syntax

sswap [-f] [-l] [-l] [-v] [-z] swapdevice

Available Option

-f – fast (and insecure mode): no /dev/urandom, no synchronize mode.
-l – lessens the security. Only two passes are written: one mode with 0xff and a final mode with random values.
-l -l for a second time lessons the security even more: only one pass with random values is written.
-v – verbose mode
-z – wipes the last write with zeros instead of random data

sswap Examples

Before you start using sswap you must disable your swap partition.You can determine your mounted swap devices using the following command

cat /proc/swaps

Disable swap using the following command

sudo swapoff /dev/sda3

/dev/sda3 – This is my swap device

Once your swap device is disabled, you can wipe it with sswipe using the following command

sudo sswap /dev/sda3

After completing the above command you need to re-enable swap using the following command

sudo swapon /dev/sda3

From ubuntugeek.com

Ubuntu 11.10 add applets to top panel

Just a quick note; I upgraded to ubunutu 11.10 and really missed my applet links in the top panel (yup, using Gnome classic)

I could not find out how to add them back in. After a little tinkering, I found the using
“ALT + Right Click” on the top panel will open the old ‘add to panel’ and ‘properties’ to customize it.

FSniper

fsniper is a tool that monitors a given set of directories for new or modified files. Then, based on the file’s type or name, it invokes a script to be run on that file. Directories are monitored using inotify, instead of simply continuously polling them for changes. Common uses include making a single download directory for all things from a Web browser and having semi-intelligent scripts figure out what to do with those files. You write the scripts yourself.

fsniper uses inotify to watch for when a file is closed after being written to. This means utilities such as touch will cause the event to trigger.

fsniper can watch any number of directories for any number of pattern matches on the files.

Download the sniper.tar.gz here (may be old)
Latest version of fsniper-1.3.1.tar.gz

Continue reading “FSniper”

Export WordPress Blog As Readable Text

From scrawlbug.com

I must be in a bit of a retrospective mood at the moment. Despite spending about six hours on a single piece of work yesterday, I found myself wandering back through some of my blog posts. Surprisingly, I rediscovered quite a few I had forgotten and several that were really quite good.

I then spent about an hour trying to figure out how to export all the posts from my blog into some kind of readable format, so that I could go through them without resorting to the unacceptably crap 3-items-per-page WordPress search.

Unfortunately, most of the applications that used to be able to read an entire blog and store it offline for ease of editing no longer have that ability: they’ve all been adjusted to edit a single existing entry at a time. Totally frickin’ useless.

And most of the responses I found through Google ran along the lines of “You can’t”.

But they’re wrong: there is a way!

Of course, WordPress has its own export facility (in the Tools on the Dashboard) but that’s as useful as the search: it vomits out some kind of bizarre, WP-specific XML file that’s about as readable as James Joyce’s Ulysses. Actually, it’s probably easier to understand the XML: at least that has some kind of structure.

Given that I’m unwilling to accept that such things are impossible (otherwise known as being a stubborn old bugger who won’t give up), I kept looking. It took quite a while to find a single response on a forum that explained how to do it.

The solution is a nice, geeky workaround that uses a free online tool and a converter. It only takes three steps to complete, so here’s the skinny:

1. Use the WordPress export tool to create a copy of Ulysses. Umm, no… I mean to create an XML file with everything in it. Your browser will dump this on your computer and give it a title like “wordpress.2011-06-05.xml”.

2. Now pop over to the absolutely funky-as-hell Blogbooker website. This truly awesome (and free) tool will convert the entire contents of your blog – including pictures, links and cat spit – into a PDF book in a couple of minutes. It’ll even handle multiple authors, different page sizes and all the other stuff that “professional” tools throw a total wobbler over!

3. You’ll need some kind of file converter to get the text out of the PDF file: Adobe’s ridiculously huge, unwieldy, use-a-particle-accelerator-to-crack-a-peanut application, Acrobat, will do it (File/Export). There are plenty of online apps that’ll do the same job, though they might struggle if it’s a really big file – just Google “convert PDF to xxx” where ‘xxx’ is the output format of your choice. You could even copy/paste each page individually if there aren’t too many.

And that’s it. Incredibly simple!

Admittedly, my PC spent about an hour trying to convert the 2.5Mb PDF file into the largest Word document ever seen on the face of the planet before I gave up, killed the process and went to bed… but hey, it should work quicker if your computer doesn’t suck as badly as mine.

From scrawlbug.com