7th May 2009
MC is a console file manager. It supports FTP connections, and in my experience is faster in FTP than both Krusader and Gnome Commander.
However, the default FTP connection format string [username[:password]@]hostname has a drawback of not allowing the use of usernames with ‘@’-symbol in them – which is very common for virtual hostings.
One of the solutions is (done in your home directory):
- if there is no .netrc file in your home directory — touch .netrc && chmod 600 .netrc
- mcedit .netrc (or use vi, nano, or any other editor you prefer)
- add the following line to the file (replace all-caps words with your actual credentials): machine HOSTNAME login USER@HOSTNAME password PASSWORD
Now, start MC, choose FTP connect, and enter only the hostname. You will be automatically logged in to the remote FTP.
This will also work for console ftp clients like lftp.
Posted in *nix, how-to | 1 Comment »
16th April 2009
Connecting remotely via ssh to my Debian box at work, I needed to mount a CIFS (samba) share, but didn’t remember server name (or IP) and share name.
At least two convenient utilities are available in Debian Lenny for non-X Samba browsing.
smbtree (part of smbclient package) will list all visible workgroups, their servers, and share names of those servers – including “hidden” shares like C$, IPC$, ADMIN$, print$. Very handy and greppable!
samba-commander (smbc package) is a ncurses samba browser with “find file” functionality.
Posted in *nix, Software | No Comments »
30th March 2009
Imagine you have some styles.css transferred from Win machine to Linux via FTP in binary mode instead of ASCII mode; then
cat styles.css | tr -d "\r" > styles-nocarriage.css
will create styles-nocarriage.css with ^M’s removed.
Alternative syntax:
tr -d "\r" < styles.css > styles-nocarriage.css
Most editors have global replace features which allow to get rid of control characters using regular expressions (exact instructions are editor-specific).
For multiple files, try this:
for f
do
mv $f ${f}~ && tr -d "\r" <${f}~ >$f
rm ${f}~
done
Save this shell script as a file (e.g. dos2unix.sh), then do ./dos2unix.sh . This script accepts wildcards (e.g. ./dos2unix.sh *.php), so be careful!
Posted in *nix, how-to, Notepad | 1 Comment »
26th February 2009
(…)
it is a very useful tool for performing installations if you’ve got something like a LiveCD which supports your hardware.
(…)
Installing new Debian systems with debootstrap, and also as a debootstrap PDF (with comments).
Posted in *nix, Links | No Comments »
5th January 2009
Unix SEX :{ look; gawk; find; sed; talk; grep; touch; finger; find; flex; unzip; head; tail; mount; workbone; fsck; yes; gasp; fsck; more; yes; yes; eject; umount; makeclean; zip; split; done; exit:xargs!!;)} (source: someone’s signature in the Debian mailing lists).
download Unix/Linux command reference by Jacob Peddicord/FOSSwire.com
Posted in *nix, Humour, Notepad | No Comments »
30th October 2008
There are several ways to do that, I’ll describe the one which worked for me. Please note, that printing from CLI has an advantage of being able to print out something at work from the comfort of your home and ssh
(provided that the printer is on and is loaded with paper).
To extract a single page (or a range of pages), I used pdftops:
Read the rest of this entry »
Posted in *nix, how-to, Software | 2 Comments »
29th October 2008
For some period of time, I had to switch to my Windows installation when writing articles with references, because I keep my references database there and there is an extremely convenient add-on for MS Office to insert citations and format bibliography on the fly.
However, it is quite inconvenient to make/run programs/scripts under Linux, and then switch to Windows to describe the obtained results in the article-like form. Thus, I briefly investigated available citation managers for Linux.
Read the rest of this entry »
Posted in *nix, Links, Science, Software | 1 Comment »