iwel's e-notes about his World
Archive for April, 2009
Permanent Aliases in bash shell
Apr 30th
| Aliases are a convenient feature of shells in Unix-like operating systems that make it possible to launch any command or group of commands (inclusive of any options, arguments and redirection) by merely entering a brief, pre-set string (i.e., sequence of characters).
Although aliases can easily be set up using the alias command, this command has the disadvantage that any alias created with it remains in effect only during the current login session (i.e., until the user logs out or the computer is shut down). This might not be much of a problem for systems that are rebooted (i.e., restarted) only infrequently (such as corporate database servers), but it can be a nuisance for systems that are frequently rebooted (e.g., home computers). Fortunately, however, any alias can be made more enduring (i.e., until it is explicitly removed) by writing it to the appropriate configuration file with a text editor. The name and location of such file can vary according to the system and the shell. In the case of the bash shell (which is the default shell on Linux) on Red Hat Linux, an alias for any user can be added to the .bashrc file in that user’s home directory. Each alias is written in this file exactly the same as it would be written on the command line using the alias command (see The alias Command for examples). Because this configuration file is read at login, any changes to it will not take effect until the user has logged in again or opened a new terminal window (i.e., an all-text window in a GUI). .bashrc is a hidden file, that is, a file whose name begins with a period and thus is not normally visible in a GUI (graphical user interface). However, it is easy to locate and open from the command line. Because .bashrc is a plain_text file, it can easily be edited using any text editor, such as vi or gedit. For example, assuming that the user is currently in its home directory, the following could be used to open .bashrc with vi:
Likewise, the following could be used to open the same file with gedit:
The alias should be typed in below the line that says # User specific aliases and functions. The pound sign at the start of this line indicates that the line is a comment, i.e., documentation for the convenience of humans rather than something on which the system acts. Aliases for the root user (i.e., administrative account) can be made permanent by entering them in the .bashrc file in the root user’s home directory (which is /root), i.e., in /root/.bashrc. System-wide aliases can be put in the /etc/bashrc file. (Note that, at least on some systems, /etc/bashrc is not a hidden file.) The system needs to be restarted before system-wide aliases can take effect. If the unalias command, which is used to remove or suppress aliases, is used on an alias which has been recorded in a .bashrc file, that alias is turned off for the duration of the current login session. However, the alias is not removed from the .bashrc file, and when the user logs in again, that alias is again in effect. Created August 6, 2005. Copyright © 2005 The Linux Information Project. All Rights Reserved. |
||
| http://www.linfo.org/make_alias_permanent.html |
WinSCP alternatives in Linux
Apr 29th
Since migrating to linux (Ubuntu to be precise), im trying to find equivalent tools i’v used in doing my work. Now, i’m currently need to do some file transfers from my server. In Windows i usually use WinSCP, a very nice (so people said it also) tool for managing files through SSH connection, but im quite in confuse when i try to find the similar one like WinSCP.
After googling a bit, i found some alternatives to do it :
- Wine – it !! Simply saying, if u can’t find the equivalent software in linux, then juz Wine it
. Run WinSCP using Wine. - use gFtp
install gFTP: sudo apt-get install gftp,
Load gFtp ( Applications – Internet – gFTP), insert ur server address / domain, port, username and password,set the protocol to SSH2,connect. - use Nautillus, the default file manager for Ubuntu, how to do it ?
open Nautillus, change the address to text instead button look (the button below the “Back” button) then insert like this : sftp://username@server.com:portnumber
Alternatively, go to menu : File – Connect to Server, then fill the fields with your own details.
That’s it.. alternative way to get the work done beside using WinSCP
Amarok with mp3 support
Apr 28th
After reinstalling my ubuntu to jaunty (yes, one day earlier i install ubuntu 8.10 then after googling i find out that ubuntu just released 9.04,arrghhh..) i want to burn in my newly bought LG earphone. Then when try to play mp3, amarok doesnt support mp3 for default!
After searching information for amarok mp3 support (install-mp3) etc etc.. i found out that the easiest way to make amarok support mp3 is install the codec, simply after install amarok
sudo apt-get install amarok
(or u can go to Add / Remove – Sound and Video, tick on the Amarok)
then install the codec :
sudo apt-get install libxine1-ffmpeg
Thats it.. re-run ur amarok, then it should support mp3 now
If only amarok have the equalizer feature, i think it would be more cool ![]()
Yahoo! finally decided to close GeoCities!
Apr 25th
Yap..First I read about this on an Indonesian php programmer mailing list, then i try to check the validity of that news. When i tried to open my account on geocities (every user on yahoo can register easily for geocities hosting account), it has notifications like this :
Important Announcement
After careful consideration, Yahoo! has decided to close GeoCities later this year.
You can continue enjoying your GeoCities service until then — we just wanted you to let you know about the closure as soon as possible. We’ll share more details this summer. For now, please visit the help center for more information.
I am amazed to read that geocities was acquired for $3.6 billion in 1999, but finally the nature of internet business (i think not only internet but the nature of business) when something can’t produce more or less profitable than it cost then any company will close it down. That happens too to geocities.
I still remember the early age’s I’m introduced with internet on the year 1999, Geocities is the only free hosting I know and I made it as my first online site for HTML lessons. Until late 2005 I can still find some pages contain files to download, especially people who are too lazy to put files on files sharing service (since file sharing service has not been around until few years ago).
Well..I’m going to miss the geocities the old days it was famous
Migrating to ubuntu (again)
Apr 24th
After long time not using linux for desktop (i usually manage linux for servers) , even though i need to moved some of my data to DVD, finally i install (again) ubuntu on my desktop.
Im trying to migrate (again) to linux since i rarely use my desktop pc anymore for work, probably i’ll try to setup my own server own this box and have an experimental things done in this box.
I often says (again) since after i install linux several times on my office desktop, my home desktop, somehow linux has some problems with my hardwares (especially with my office desktop), my guess is my mainboard (ECS NForce 4M-A) or my video card (gigabyte x3100) causes all the problems.
Even yesterday i needed to do several times effort to install, since the installer had some errors several times before it succeeded.
Well, lets see how long this install will last