SSH connection with no password input

An SSH key pair is needed to connect to an SSH server. It is possible to create a passwordless key pair so as to bypass the password prompt when you connect to your SSH server. This is handy for when you need to automate some processes through scripting. Follow the instructions below to create a new passwordless key pair:

1. Install OpenSSH. On Ubuntu, you can install OpenSSH by opening your terminal and typing:

sudo apt-get install openssh-client

2. Once OpenSSH is installed, stay in the terminal and type:

ssh-keygen -t dsa -f ~/.ssh/id_dsa

Linux screenshot with scrot

scrot is a commandline screen capture util like "import", but using imlib2.

It has lots of options for autogenerating filenames, and can do fun stuff like taking screenshots of multiple displays and glueing them together.

Install Scrot in Ubuntu

sudo aptitude install scrot

This will complete the installation.

Using Scrot

Example scrot commands
1. Capture screen and save file to working directory:

scrot

2. Capture screen in 5 seconds time:

scrot -d 5

3. Capture screen in 5 seconds time, name file with time stamp and screen dimensions:

Record Internet radio with VLC

If you're using VLC to listen to internet radio, you can just have VLC stream it to a file with the codek and all of your choice.

Open VLC, and go

File -> Open network stream

In the bottom where it says Customize, paste in the url of the stream. Then mark off 'Stream/save' and press Settings.

Mark off 'File', and write a filename and location of where you would like it to be recorded. Now, you CAN dump the raw input, but that's just a waste of space, so don't do that. Mark off 'Play locally' if you want to listen to the stream at the same time.

How to use OS-X-fonts in ubuntu


find the fonts in Os-X to be very pretty. =) And all props to Apple, since they give out their fonts for free!!

Step 1: Get the fonts.

Apple is so nice when it comes to fonts.
http://www.osx-e.com/downloads/misc/macfonts.html

Freeware Mac-fonts!

Step 2: Extract and add to /fonts/.

Extract the file onto your desktop or some other place.
Navigate into the fonts-folder you extracted with terminal.

cd Desktop/Fonts

Make 2 dir's in the /usr/share/fonts-folders

How to Modify the drupal Recent blog posts itmes

The drupal default "Recent blog posts" only have 10 items.But I want show more.

Modify this file modules/blog/blog.module

function blog_block($op = 'list', $delta = 0) {
...
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10);
.... }
}
}
}

Change that

ORDER BY n.created DESC"), 0, 10);

to

ORDER BY n.created DESC"), 0, 20);

Invoke Envy when X fails to boot

This How To I stumbled upon trying to fix an x crash after an kernel upgrade. The log file showed that the nvidia kernel was the problem.

I exited the blue x log report and logged in at the command line.

I guessed that Envy might run so I gave it a go. No immediate luck but it did look possible. It prompted for one of two switches -t or -g. The -t switch was to start Envy in text mode whilst the -g was to start it in GUI mode.

I entered

sudo envy -t

Rip Music CDs to MP3 - Sound Juicer

Install the following packages:

sudo apt-get install gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse

Set up Sound Juicer:

Open up Sound Juicer-->Edit-->Preferences-->Output Format-->CD Quality, MP3 (MP3 audio)

Ubuntu Cheat Sheet

Linux Shortcuts

Ctrl+C – halts the current command
Ctrl+Z – stops the current command, resume with fg in the foreground or bg in the background
Ctrl+D – log out of current session, similar to exit

Ctrl+W – erases one word in the current line
Ctrl+U – erases the whole line

Ctrl+R – type to bring up a recent command
!! - repeats the last command
exit – log out of current session

Linux Searching

grep pattern files
Search for pattern in files

grep -r pattern dir
Search recursively for pattern in dir

command | grep pattern
Search for pattern in the output of command

locate file
Find all instances of file

find . -name "*.mp3"
Find mp3 files at current folder.

Syndicate content