How to save flash videos on GNU/Linux

September 16, 2009

I have never tried it on Windows, but it should work in a similar way, I guess.

You probably already heard about those tools which promise to save your youtube (or any other flash video oriented website) videos. Actually you don’t need any third party tool in order to save any flash video.

This is how it works:

—————

#cd /tmp/

#ls -lah

—————

So now you have got your usual temporary files list.

Now go to your favorite web browser and search for an youtube video (or any other flash videp oriented website) and start to load it and wait until it gets fully loaded.

Now back to the tmp directory:

—————

#ls -lah

Flash0GCg9U

—————

You will find out there’s a file in there called “Flash+randomcharacters”, now just copy it to any another directory and feel free to rename the file of course.

Done, now you got the video forever! ;)


Hexadecimal Information – HEX table.

August 27, 2009

http://www.legacyj.com/cobol/hex.html

Quite useful, especially in the next few years (ipv6 is coming).  :)


Crontab syntax

July 13, 2009

Personal note about crontab syntax, from left to right:

Field     Function
1o.     Minute
2o.     Hour
3o.     Month Day
4o.     Month
5o.     Week day
6o.     Command to execute

Values:

Minute     0-59
Hour     0-23
Month day     1-31
Month     1-12
Week day     0-6 (where “0″ means Sunday), 1 means Monday, etc

Sometimes I forget it, so I’m documenting it to myself. Hopefully somebody else will find it useful too. :)


How to Convert from Binary to Decimal

July 11, 2009

Very good “how to” on how to convert Binary numbers to Decimal.

http://www.wikihow.com/Convert-from-Binary-to-Decimal


How to mount a Windows “shared folder” (SMB) from a GNU/Linux box.

June 14, 2009

Some months ago I just sett up a GNU/Linux server running samba for a SOHO client.

In my specific situation, we needed to access a Windows box (a so called shared folder) from the Linux box, however, the Linux box couldn’t read the remote files properly because of it’s special characters (Portuguese-Brazilian).

This command would solve the problem:

# mount.cifs //192.168.0.30/remote_folder /mnt/local_folder -o iocharset=iso8859-1,codepage=cp850

Where “iocharset=iso8859-1,codepage=cp850″ specifies the right charset to get data from the windows box.

But remember to first assure that your local charset settings are correctly configured (can you read and write ç,õ.ó, etc in a local folder?).  If yes, then the procedure above will take care of remote SMB windows folders.

References:
http://en.wikipedia.org/wiki/ISO_8859-1

http://casa.colorado.edu/~ajsh/iso8859-1.html

http://en.wikipedia.org/wiki/Code_page_850




Optimizing Portage compiling on Gentoo with ccache + shm.

May 21, 2009

I knew about ccache long time ago, also knew about shm (shared memory) on Linux but I realized that I could:

1. Mount my tmp partition on shm, so all the temporary files would be written on RAM, instead of HDD.

2. Now I set the ccache directory to my tmp directory, this way the ccache files will be written directly to RAM, gaining a better performance than usual.

Now add the following lines to /etc/fstab:

/dev/shm                /tmp              tmpfs           defaults,size=80m,auto 0 0

/dev/shm                /var/tmp          tmpfs           defaults,size=80m,auto 0 0

It is defining 80MB for maximum RAM usage by temporary files, you can define more or less memory, as you wish, of course. The flag “auto” defines that these partitions should be loaded automatically at the boot time.

Now add the folowing line for the /etc/make.conf:

CCACHE_DIR=”/tmp/ccache”

This way, ccache will write to your RAM. Now you can try recompiling your whole system with emerge for a test, you’re gonna realize that your HDD won’t get much stress when compiling the sources, since all the temporary files generated during the compiling process are now written directly to RAM.

I will not get into deeper details about ccache and shm, so I suggest you to read the “references”, if you want to know some more.

References:

#man ccache

http://fscked.org/writings/SHM/shm-1.html#ss1.1

http://en.gentoo-wiki.com/wiki/Ccache

http://blog.flameeyes.eu/2008/06/21/debuking-ccache-myths

http://ccache.samba.org/ (official website)

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=3#doc_chap3

http://www.tuxfiles.org/linuxhelp/fstab.html (fstab tutorial)


How to keep running processes in background after disconnecting in a remote session

May 11, 2009

Maybe most of you know about it, but I think it would be nice to mention something about this tool anyway.

For example, when you are in a remote box through SSH (or telnet, etc) , you may want to download a big file from another remote location using wget, but for any reason you cannot stay connected until the download gets finished, so you can use the “nohup” command to keep track of this situation.

All the output will be written to a specified file (torrent.out in our example), if you don’t specify it, then it will gonna be named as “nohup.out”.

Usage example:

#nohup transmissioncli stuff.torrent > torrent.out  &

You can still watch the output in real time using the following command:

#tail -f torrent.out

When you think you got enough of it, just “ctrl c” and disconnected from the remote server. Then tomorrow you can connect again and check your process status output again using “tail -f torent.out” again.

Very useful, eh?! ;)

References:

#man nohup


wget shows “HTTP Error 403 – Forbidden”

April 8, 2009

So, today I was trying to download an entire C programming tutorial from a website, it was splitted in several different html files and I wanted to have it all so I could read it while offline.

My first thought was about using wget to automatically get it all with the following parameters:

#wget -r -np http://www.xxx.com/docs/stuff/yeah/

The output:

–2009-04-08 02:34:59–  http://www.xxx.com/docs/stuff/yeah/
Resolving www.xxx.com… 75.126.69.23
Connecting to www.xxx.com|75.126.69.23|:80… connected.
HTTP request sent, awaiting response… 403 Forbidden
2009-04-08 02:35:00 ERROR 403: Forbidden.

So, you might ask yourself  “but then how the hell my browser got the html files without any error?”.

The webserver use a kind of security configuration where they will refuse any “user agent” which is not related to a browser. For example, when you use wget to download the html, the webserver will answer you with “ERROR403: Forbidden”, because it is not a valid browser, it is Wget. I just don’t know yet how it works at the server side, hopefully I will be writing more about it in the next posts.

So now we can try the following parameters in order to break it:

#wget -U firefox -r -np http://www.xxx.com/docs/stuff/yeah/

Where “-U” means “user agent”

It works flawlessly! :D

Please share with us your experiences about it.

References:

http://www.checkupdown.com/status/E403.html

http://www.gnu.org/software/wget/manual/


Xorg 1.5 Upgrade Guide

April 7, 2009

Xorg 1.5 Upgrade Guide for Gentoo (though it might be useful for other distros as well)

http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-1.5-upgrade-guide.xml


EEE-PC 1000HA optimized kernel configuration.

March 24, 2009

So, after a lot of tweaking, I got a very optmized kernel configuration for my eee-pc 1000HA, which runs on Gentoo. However, considering that the linux kernel is just a part of a whole distro, it doesn’t matter if you are running another distro instead of Gentoo.

By the way, this kernel config may also works to the EEE-PC 901.

So, where’s the beef?  Here it is:

Download–>   eeepc1000ha_kernel

The config file above has been tested for the 2.6.28 kernel release.

Please, if you have found something to improve (features to add or to remove) into this kernel config,  please share your thoughts. Together, we can build it better! :)

Unfortunately the kernel driver ath5k (wireless) will not work with atheros chip 5007 (which is the one who comes into the 1000HA), so for this time you’ll need the madwifi driver:

http://madwifi-project.org/ticket/1192

At the moment I’m still testing this driver and will be posting here some instructions when I get it working properly.