phuzz.org 
Home Archive Contact

Archive

Available categories:
Linux
misc
Quotes
Lyrics

Linux

How to rip an mms-stream
My vimrc file
How do I turn on NumLock on startup?
How do I configure a mouse with more than 3 buttons (e.g. browser back)?
Use the "print screen" keyboard button to automaticly take a screenshot of the entire desktop.
How do I set up public key authentication with SSH?
Public key authentication with SSH does not work.
How do I get my HP DeskJet printer to print pages i reverse order?
Settings for a remote CVS connection?
How to make a new SSL (test) certificate for Apache


How to rip an mms-stream (2004-07-10)
Save the mms:// stream:
mplayer -dumpstream  mms://foo.com/bar.wma
Another tip I read was to use an application you can download at http://mms-qt.sourceforge.net/, but I have not tested it yet.

A third alternative is an application called mimms. It seems similar to mms-qt.

Convert a WMA-file to WAV:
mplayer -srate 44100 -ao pcm -aofile output.wav input.wma



My vimrc file (2004-01-21)
My "HTML-ified" .vimrc file.


How do I turn on NumLock on startup? (2004-01-21)
To enable NumLock in the console, paste this code into rc.local or make an init script and put it into /etc/init.d/:
echo "Enabling NumLock..."
for tty in /dev/tty{1,2,3,4,5,6,7,8,9,10,11,12}; do
	setleds -D +num < $tty
done
X windows is nice enough to turn this off again... so paste the following code into a file named xsetnumlock.c:

#include <X11/extensions/XTest.h>
#include <X11/keysym.h>
					
int main(void)
{
	Display* disp = XOpenDisplay(NULL);
	if (disp == NULL) return 1;
	XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock), True, CurrentTime);
	XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock), False, CurrentTime);
	XCloseDisplay(disp);
	return 0;
}
Run this command to compile it:
$ gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o xsetnumlock xsetnumlock.c -lX11 -lXtst
Run xsetnumlock from ~/.Xclients (or any of its alternatives: .xsession, .xinitrc or whatever...).


How do I configure a mouse with more than 3 buttons (e.g. browser back)? (2004-01-20)
1. In /etc/X11/XF86Config under "InputDevice":
	Option      "Protocol"  "ExplorerPS/2"
	Option      "Buttons"   "6"
	Option      "ZAxisMapping"  "5 6"
2. In ~/.Xmodmap:
    pointer = 1 2 3 6 4 5
3. Install xbindkeys and XMacro

4. In ~/.xbindkeysrc: (Remove the line break in the "echo" line!)
    "echo -e 'KeyStrPress Alt_L\nKeyStrPress Left\n
	KeyStrRelease Left\nKeyStrRelease Alt_L' | xmacroplay :0.0 >/dev/null 2>&1 &"
	b:6



Use the "print screen" keyboard button to automaticly take a screenshot of the entire desktop. (2004-01-19)
  • Use xev to get the keycode of the "print screen"-key. On my (norwegian) keyboard this it is "111", this may be standard on all keyboards, I don't know.
  • Install xbindkeys
  • Install ImageMagick if you don't have it.
  • Put this in ~/.xbindkeysrc:
"import -window root $HOME/screenshot.png"
  c:111



How do I set up public key authentication with SSH? (2004-01-18)
  • Use ssh-keygen -t dsa to generate a public/private key pair.
  • Copy your public key (id_dsa.pub) to your remote host and rename it to ~./ssh/authorized_keys. (Or add the key to that file if it already exists.)



Public key authentication with SSH does not work. (2004-01-17)
Check permissions on your ~/.ssh/ directory (drwx------).


How do I get my HP DeskJet printer to print pages i reverse order? (2004-01-16)
Add the "outputorder=reverse" to the queue options. With redhat-config-printer or /etc/cups/lpoptions


Settings for a remote CVS connection? (2004-01-15)
~/.bash_profile
export CVS_RSH="/usr/bin/ssh"
export CVSROOT=:ext:username@yourcvsserver:/home/cvsroot
~/.cvsrc
cvs -z3
update -d -P
checkout -P
diff -u



How to make a new SSL (test) certificate for Apache (2004-01-13)
$ /usr/bin/openssl genrsa 1024 > /etc/httpd/conf/ssl.key/server.key
$ chmod go-rwx /etc/httpd/conf/ssl.key/server.key
$ make testcert






Copyright ©2008 phuzz.org.   All rights reserved.

Valid HTML 4.01!