Sunday, March 22, 2009

ASCII videos in mplayer

Mplayer comes with different video drivers each providing fine tuned adjustments from choosing graphics accelerators to viewing images. "$ mplayer -vo help" will give you a list.

My favorite of course is the ascii art driver AAlib. Here's how to view videos in ascii and replace aa with caca to see color.

$ mplayer -vo aa video.avi

If a picture is worth 1000 words or not, see for yourself. Try to guess what movie this is...

Thursday, March 19, 2009

Copy paste '?' characters on Cisco IOS CLI

The Cisco IOS command line interface (CLI) has the special character '?' which you cannot insert into a literal string. One method of doing that is to do a and then type '?' (without the quotes) and then the special character gets inserted in the string.

However, when you are copy-pasting IOS CLI commands, it might be tough. The simplest way is to open the file in vim and just do this:
:%s/?/Control-V Control-V?/g
which will add the special escape character "Control V" in front of every question mark.

The other method (for all you Windows Notepad folks) is to copy paste the character in the next line:

without the trailing newline and do a search and replace of every ? with ? in the text file. Then you can copy paste the file.

Tuesday, March 3, 2009

Changing or hiding HTML label texts

If you are doing a simple javascript program and want to change the text inside a label (or hide it, maybe?) you can do it by this simple code:
= "Text you want"

So now you can hide/show labels, change texts etc on the fly.