Add to Google! Add to My Yahoo! Subscribe with Bloglines Pluck Add to NewsGator

Archived Posts from “Tutorials”

Google Music

20

March

Found this one by accident this afternoon, thought I’d share.
Running Linux? Is there a song you like?

Google the song in Google Video; who cares what the homebrew video is, just go looking for good audio.
Pull the movie up in Firefox; when the movie finishes buffering, do :

ls -lh /tmp/Flash*

.. and copy the newest file somewhere else, say yer desktop. Now you have a copy of the video.

We just want the audio, so using ffmpeg (sudo apt-get install ffmpeg if you don’t have it), do:

ffmpeg -i [Flash File] [song name] .mp3

And that’s it; one MP3. Use your favourite id3 tool to add tags, and enjoy!


Burn an ISO in 3 clicks

16

March

I was working on a project the other day with a friend and he was having some trouble burning an .iso image of one of the Ubuntu 7.04 Herd releases. He asked me about installing gnomebaker or K3B for burning the image. While I have used both of those programs I found that a disk image can be burned very easily directly from the the file location. Here are a few steps to burning a disk image in three clicks.

  1. First, you’ll need to have a .iso image available for burning. This could be located on your desktop, home folder or I’ve even burned an image using this method over on NFS connection. You’ll also need a blank CD or DVD in the drive.
  2. Once you’ve selected your disk image you can right-click the .iso file and select “Write to disk…” (two clicks)
  3. This will open a dialog box letting you verify the disk type, size and burn speed. If all is correct (which it normally is) you can click Burn. Sit back and relax. Your disk will be finished in just a few minutes. (one click)

Done. When finished it’ll ask if you’d like to Eject, Burn Another Copy or if you’re just Done. So very easy.

I find this method much faster and a little more intuitive than the other cd / dvd burning applications. Not to say they aren’t great apps, but if you’re just burning a simple disk image this should be a bit faster. I’ve also had far fewer coasters using this method than I have with the others.


Command line basics for beginners

16

March

For many of you the command line may be intimidating, especially if you’re more accustomed to the Windows standard GUI. I want to tell you the command line can be a VERY powerful tool if you just learn a few basic things. Please don’t consider the command line a crutch or “Linux is hard because you have to type commands”. You can do everything via a GUI that you can do via the command line, it is simply easier or quicker to do it the latter way.

Below are a few basic command for those of you new to the command line:

ls - list contents of a directory
sudo - "super-user do" (grants administrator rights)
cd - change directory
aptitude - APT package management system (update, install, remove, search)
clear - clear screen
chmod - change file access permissions
chown - change file and group ownership
cp - copy
mv - move
rm - remove
cat - concatenate files (dump to screen)
nano - basic text editor
vi - advanced text editor
fdisk - partition table manipulator
df - disk free (remaining / used disk space)
users - users currently logged in
useradd - add a user
usermod - modify existing user
uname - show system data (try uname -a)
mount - mount a file system, cd or removable drive
umount - un-mount a file system, cd or removable drive
top - show current running processes
touch - create new, empty, file
reboot - reboot your system
shutdown - shutdown your system
passwd - change user password
ping - ping a network device or location (ping google.com)
more - show output one screen at a time
exit - logout of the terminal
eject - eject a cdrom or removable device


PGP Email Encryption and Signing

21

December

PadlockWith as much is going on these days to screw with our privacy it isn’t a bad idea to learn a little bit about encryption. Now, I know you may think that you aren’t doing anything private so what is the point? I’m not doing anything “private” either, it’s simply a matter of it not being any of anyone else’s business.

I have for some time now been interested in digitally signing my emails. And if you’ve seen me pop-up on a mailing list or got any emails from me in the last few days you’ve probably seen a digital signature in-line or as an attachment. Via this digital signature you can verify that the exact contents of the email into your box is the same contents that came out of mine, therefore maintaining integrity. If even *one* character changed the signature would not validate and you could tell the email or signature had been tampered with.

I have also started signing and encrypting emails to others that also have a PGP key pair that I have personally trust-signed. I’ll talk about the trust signing later but I wanted to share a few steps and some other references to how you can generate your own key and also be able to sign and / or encrypt emails or files.

The GUI Front-End

There are a number of tools to help you generate and manage your PGP keys. I suggest seahorse on gnome or kgpg on KDE. You can also use the command line equivalent on either system, which will be standard between the two. (note: there are also solutions for OS X and Windows, but I won’t get into those.)

First we’ll install the GUI front-end to go with the pre-installed GnuPG back-end.

(for gnome)

sudo aptitude install seahorse

or

sudo aptitude install gpa

or (for kde)

sudo aptitude install kgpg

Creating The Key

Now that we have one of these installed we’ll launch the front-end and start creating a key. In this example I’ll refer to seahorse but the steps should fairly easily transfer to the other two applications.

Applications > Accessories > Passwords and Encryption Keys

Select “Key” from the File Menu and “Create New Key (ctrl-N)

This will prompt you with a selection between PGP and SSH. In this case we’ll want PGP.

The next window will prompt you for your full name, email address and comment. It is generally recommended to use your full legal name (not nicknames or aliases) and your primary valid email address. I suggest leaving the comment section empty.

You may want to select the “Advanced key options” button and set a higher key strength. The default type DSA Elgamal of 2048 is a very powerful key strength but it does support up to 4096 as well. Personally I left it at the default of 2048 as this is plenty powerful in itself.

You can also optionally select a date that this key will expire. Unless you know a reason why you’d want to do that (sometimes for temporary project-based keys, etc) you can safely set it to not-expire.

When you hit “Create” it will ask you for a passphrase to bind to this key pair. Choose a good, solid, more-than-a-dozen character passphrase to make this even more solid. Your digital signature and key are only as strong as its weakest link which is the passphrase. If someone gets a hold of your passphrase they can make use of your private key, un-encrypt emails sent to you or appear to be you! Once you have entered the passphrase it will generate your key pair. Remember this passphrase because, without it, the key pair is useless!

Depending on the key strength and the speed of your machine this may take a while. You should see a progress bar on the screen while it processes a new key. Just be patient.

You now have a basic key that is capable of digitally signing and optionally encrypting emails or files. One great use of this is to digitally sign the Ubuntu Code of Conduct as outlined here.

Using the Key

For those of you that want to get started right away signing emails you may be interested in some of the extensions available for commonly used mail applications. Thunderbird has a great one with Enigmail. You can find it on the mozilla addons site or via the ubuntu repositories.

Evolution has PGP support built in which is also very good. You can find this in the Edit>Preferences. Where you should select the email account then go to Edit>Security. Here you should enter the PGP key ID and check all boxes under the PGP header, except “Do not sign meeting requests”.

Now this tutorial is getting a bit long so I’ll have to expand this next time and explain expanding your key with your alternate email addresses, keysigning parties, etc.

Until then I hope this helped a little bit.

Two major things to remember before you run off and start playing around. Remember your passphrase and back up your private key!!

Your public and private keys are found in ~/.gnupg/ . I suggest backing up this entire folder to an external USB. If you lose your private key the whole pair is useless. Even if you still have the public key and the passphrase the private key section is the most critical part of the process.


Seven Common CSS Mistakes and How to Avoid Them

24

August

Seven common CSS Mistakes and How to Avoid Them. They are:

  1. Do not use HTML tags to achieve formatting or styling. HTML tags should be used for semantic markup, and CSS attributes should be used to format the content.
  2. Do not include CSS formatting directives inside HTML tags (or at least use them sparingly). Use CSS classes.
  3. Define common formatting characteristics only once.
  4. You can define more than one CSS class for each HTML element.
  5. Use hierarchical selectors instead of extra CSS classes.
  6. Store all CSS rules in external style sheets. Use the intra-document style sheets only to define exceptions that are local to a single document.
  7. If needed, break the CSS rules into multiple files and import the common files into section-specific files with the @import CSS rule.


Next Page »

Recent Comments
  • Josef Nankivell: Hi Diptesh, You will need to use Dijkstra's Algorithm to find the shortest path/value when...
  • Diptesh: The above code is good. But i'm tryin to find several alternative paths using stored procedure, with data...
  • kiv: Hi ac adapter! Sounds like a good idea initially, I will look in to this further. Thanks for your comment!
  • kiv: Hi osman, The methods of scrolling on the Viewty change depending one what you are doing. > In the main...
  • ac adapter: What about simply wiping the key (i.e., unmounting the encrypted volume) when the machine is about to get...

Blog Stats

So far I've written 48,853 words in 110 posts. 27 comments have been posted, with a total of 891 words.