linux

iperf - tool for testing network transfer speeds

http://iperf.sourceforge.net/

iperf is a tool for testing network transfer speeds. From its sourceforge page:

'Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.'

Quick start:

iperf -s on server
iperf -c hostname (or ip of server) on client. Use -f to change the format.

CLI Tip: Quickly create backup of file

Quick tip to rename a file:
cp /etc/X11/xorg.conf{,.bak}
will create a copy of xorg.conf as xorg.conf.bak in /etc/X11

Archlinux x64 Flash directory permissions problem

I have just moved to Archlinux - mainly due to its rolling release policy and because (for me) the last 2 Ubuntu releases have been awful.
To be fair I had the same Xinerama + Qt + Xorg 1.9 = Crash problem on Archlinux as well but anyway...

Another issue I had was after installing flashplugin-prerelease using:

yaourt -S flashplugin-prerelease

I got this warning:

warning: directory permissions differ on usr/lib/mozilla/
filesystem: 700 package: 755

And firefox did not detect the plugin (about:plugins was empty)

High X server cpu usage on Ubuntu 10.10?

I was having very slow firefox scrolling and terminal text- I fixed it by updating to 260.19.21 from https://launchpad.net/~ubuntu-x-swat/+archive/x-updates

System: Ubuntu 10.10 x64 with 3 monitors on 2 Nvidia cards using Xinerama

Official Spotify for Linux Native Client with Offline track support

I have been having problems with Spotify under wine on Ubuntu 10.10. A bit of googling revealed that Spotify now have a preview of a native client for Linux!

http://www.spotify.com/uk/download/previews/

Just installed it and it seems to be working well.

Linux/Ubuntu: Changing your default shell

Use the command:
chsh -s /path/to/shell yourusername

So to switch to zsh use
chsh -s /bin/zsh yourusername

Linux Tip of the Day/Week/Month/Year - Searching your bash/zsh history

Searching your bash/zsh history:

To search your history press CTRL+R and then type part of the command you are looking for. Keep pressing CTRL+R to go through the results.

More VIM tips

More vim things I really should have known before today:

http://www.moolenaar.net/habits.html

The bits I really liked from those tips are:

Pressing the * command to find the next occurence of the word and then using cw to change that word. Then pressing n to find the next word and . to repeat the cw command!

Typing the beginning of a function/variable and then pressing CTRL+N to get an autocomplete menu.

Typing qa to record a macro to register "a" and then q to stop. Press @a to repeat the macro.

Some VIM tips

I've been writing quite abit of javascript recently. Unfortunately by formatting is abit hit and miss. Thankfully sites like http://jsbeautifier.org/ exist to tidy up.

There is also a vim plugin: http://www.vim.org/scripts/script.php?script_id=2727

Drop it into your .vim/plugins folder and then "use: leader ff or bind the g:Jsbeautify() function to any short key you like."

If those instructions look like gobbledegook to you (it did to me) then know that leader defaults to "\" (so you would type \ff) and you can bind it to F5 (for example) by putting this into your .vimrc file:

map <F5> :call g:Jsbeautify()<CR>

Updating Drupal quickly over ssh

Just finished updating my drupal install and its modules. Would have been a nightmare over ftp but using ssh it takes seconds:
http://drupal.org/node/297496

My bash history looked something like this (remember to backup db/site first and run update.php at the right places):

Syndicate content