Author

The Archives

  • 02.24.10
    Running e2fsck on a mounted filesystem shell | rafacas | (0)
    I know, running fsck on a mounted filesystem is utterly unrecommended. The command warns you (it actually frightens you) with the following message: # fsck /dev/VolGroup00/LogVol00 fsck 1.41.4 (27-Jan-2009) e2fsck 1.41.4 (27-Jan-2009) /dev/VolGroup00/LogVol00 is mounted. WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage. Do you really want to continue (y/n)? no check aborted. But sometimes I need to check a filesystem in a remote host, so I cannot boot from a liveCD to run fsck in the unmounted device. Looking for an option allowing me to overcome this nuisance I found the following in e2fsck's man page: Note that in ...
  • 02.23.10
    Force fsck at next boot cmd | rafacas | (0)
    # touch /forcefsck Creating an empty forcefsck file in the root directoy will force fsck to run at the next boot.
  • 01.17.10
    RPM: Listing dependencies of an rpm file shell | rafacas | (0)
    rpm is a powerful Package Manager, which can be used to build, install, query, verify, update and erase individual software packages. It is the default package manager for several popular distributions such as Red Hat, Fedora, Suse and many others. The list of dependencies an rpm package has, that is, the packages that must be installed in the system for it to work properly, can be shown with the following command if the argument is the rpm file: # rpm -qpR rsync-3.0.6-0.fc10.i386.rpm config(rsync) = 3.0.6-0.fc10 libacl.so.1 libacl.so.1(ACL_1.0) libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4) libc.so.6(GLIBC_2.8) ...
  • 12.21.09
    Mounting and unmounting a disk image (dmg) in OS X shell | rafacas | (0)
    A file with the extension .dmg uses a proprietary disk image format commonly found on Mac OS X (well, usually: you can use any extension anywhere, obviously) . The command used for manipulating disk images is hdiutil $ hdiutil attach nmap-5.00.dmg esperado CRC32 $C955C266 /dev/disk2 Apple_partition_scheme /dev/disk2s1 Apple_partition_map /dev/disk2s2 ...
  • 12.18.09
    Are your DNS Servers failing? shell | rafacas | (3)
    Some days ago Google launched its public DNS service. Another older, public DNS service is OpenDNS. Both let you use their DNS servers insted of your ISP's. I have been using OpenDNS for a year because I had problems with my ISP's DNS servers. They were down frequently, so I searched for a reliable alternative. There are some ways to know if your service provider's DNS servers are working properly. You can use nslookup, which is a program to query Internet domain name servers. $ nslookup google.com Server: 208.67.222.222 Address: ...
  • 12.05.09
    SysAdvent Calendar 2009 news | rafacas | (0)
    SysAdvent is a project started by Jordan Sissel last year. It consists of sysadmin related posts. A post a day from 1st to 25th Dec. Jordan takes that idea from the Perl Advent Calendar. This year there are some bloggers helping Jordan on this task. I recommend subscribing to it, their posts are quite useful.
  • 12.03.09
    screen: working with the scrollback buffer shell | rafacas | (0)
    screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. That is, multiple console applications can be run from the same terminal, each one with its own window. But we have already talked about the screen command before. In this post we are going to focus on the scrollback buffer feature. There is a scrollback history buffer for each virtual terminal, allowing to browse, or even to search, through the history of your windows. There is a copy-and-paste mechanism as well that allows moving text regions between windows. By default, the buffer has only ...
  • 11.30.09
    Changing file extension shell | rafacas | (0)
    I usually change the annoying JPG extension to jpg (I do not like uppercase file names or extensions). For this I use a function I found in shell-fu: rename_ext() { local filename for filename in *."$1"; do mv "$filename" "${filename%.*}"."$2" done } I copied it into my .bashrc file, so that I use it as follows: $ rename_ext JPG jpg
  • 11.27.09
    Ignoring an alias cmd, shell | rafacas | (3)
    Sometimes I want to ignore an alias. That might seem to make no sense because one of the reasons (the reason?) to use an alias (like ls='ls --color') is creating shortcuts. But, in some cases I need to use the real command, with its real output. In my case, it is because I share the same username with other people on some systems (yes, it is pretty awful, but that is another issue). To do this, precede the command with a backslash: '\'. For example: $ \ls Update: As loood has said in the comments, typing the command in quotes has the same ...
  • 11.25.09
    Comparing directories in local or remote hosts shell | rafacas | (0)
    I frequently need to compare two directories (with similar structures) to find different or new files. When I have to compare them locally, I use the diff command. $ ls test* test: file1 file2 file3 file4 file5 test.new: file1 file2 file3 file4 file5 file6 $ diff -qr test test.new Files test/file2 and test.new/file2 differ Files test/file4 and test.new/file4 differ Only in test.new: file6 The -q option tells diff to tell only whether the files differ and the -r option is for recursively comparing inside subdirectories. A more complicated problem arises when the comparation has to be done remotely, that is one of the directories is in another host (Samba, NFS, etc ...