Character encoding is always a problem when communicating between Windows and Linux. And using the “tree” command is affected by this problem if you are connected to a Linux box using Putty on a Windows box. You will certainly get weird characters, probably squares.
For those who are not sure about what tree is. It is a command-line tool to list contents of directories in a tree-like format.
A solution to this problem is to force using plain ASCII characters:
You can also have an alias for this command, so that every time you type “tree“, it will force tree to use the ASCII charset automatically.
alias tree='tree --charset=ASCII'
And this is an example of what you will get as an output:
The Samsung Exclaim™ requires the 3g2 format for its ringtones or even videos. This is a format that is optimized for 3G phones. Fortunately on Linux, FFmpeg is a very complete tool to work with audio and video formats and convert between them, and it can, of course, generate 3g2 files.
If you have compiled and installed the right packages (Medibuntu repository with the libaac support, for example), you can easily do one of these commands with ffmpeg:
Possibly you will need to either do a diff between files where they don’t use the same new line character.
Because the new line character is OS-dependant, there are issues when doing a diff on these files when you are not using that same OS.
And there are also times where you just want diff to ignore all spaces and new lines…
The –ignore-all-space option for diff is really useful in these two cases. It will check for differences between the given files ignoring spaces or new lines whether there is none, one or more
I wanted to take screenshots of about 15 Websites, but didn’t want to install any plugins as I wouldn’t use them often. I saw a lot of how-to’s using import from Imagemagick but they capture the whole screen, not clearly what I was looking for.
Using chromium, xwininfo (from X) and import, I made this bash script which captures only the webpage. See below for the Source code.
I’m now using Byobu (earlier known as screen-profiles, but changed to Byobu) everytime I ssh into one of my servers:
[local]$ ssh myserver
Last login: Thu Aug 13 11:03:58 2009 from ...
[remote]$ byobu -R
Byobu can be seen as a replacement for the “screen” command, though it is not really a replacement; It should be seen much like an addon or a plugin. It can also be used locally without ssh (I just find it useful with ssh). It shows very useful information (about the computer where screen/byobu is running) and acts just like screen, same commands (though it adds some more keybindings). See screenshot above. Continue reading “[Ubuntu] Byobu: a very useful enhancement for GNU Screen”
Grep is a very useful tool in the Unix world. If you don’t know it already, it is very much like a search tool. It can search for a text or pattern in one or multiple input files or data coming from (unix) pipes.
If you are a developer or simply a command-line geek/fan, there are times where you type some documents using the command line, like for README’s or for documentation. It is also important to have a very good writing in English if you wish to distribute those files.