March 2009

The Archives

  • 03.31.09
    RPM: listing the contents of an rpm file cmd | rafacas | (0)
    $ rpm -qpl kernel-2.6.27.19-170.2.35.fc10.i686.rpm /boot/System.map-2.6.27.19-170.2.35.fc10.i686 /boot/config-2.6.27.19-170.2.35.fc10.i686 /boot/initrd-2.6.27.19-170.2.35.fc10.i686.img /boot/vmlinuz-2.6.27.19-170.2.35.fc10.i686 [...] Lists all the files in an RPM file. Also note that rpm can query remote RPM files through FTP and HTTP.
  • 03.29.09
    Opening files in Vim shell | n0str0m0 | (0)
    $ vim file1 file2 Opens file1 and file2 in two different buffers and shows file1 in the current viewport $ vim -o file1 file2 Opens file1 and file2 in two different buffers and shows every one of them in a viewport with the screen splitted horizontally $ vim -O file1 file2 Same as above but with the screen splitted vertically
  • 03.26.09
    Mounting ISO images cmd | rafacas | (0)
    # mount -o loop file.iso /mnt/iso Mounts an iso image on the /mnt/iso directory. The loopback module needs to be enabled.
  • 03.24.09
    Linux Kernel 2.6.29 released news | rafacas | (0)
    Via Slashdot I have found out that Linus Torvalds has just released the Linux 2.6.29 kernel. There is a temporary change of logo to Tuz, a Tasmanian Devil, wich is an endangered species. Besides the logo, some of the new important features are: Support for kernel mode-setting on Intel hardware. "Mode setting" is for setting up things like screen resolution and depth mode, in other words, configuring whatever is necessary on the graphics card for displaying things on the screen. Btrfs: is the next-generation Linux filesystem, developed from scratch following the design principles of filesystems like ZFS, WAFL, etc. Squashfs: is a highly compressed ...
  • 03.24.09
    gnuplot just for coordinates shell | pfortuny | (2)
    I needed a list of coordinates urgently, and I needed it in a text file (I am using LaTeX a lot lately). Gnuplot does the job properly, if told to do so: $ gnuplot gnuplot> set terminal table gnuplot> set output "hyperbola" gnuplot> set parametric gnuplot> plot [t=-1.5:1.5] cosh(t),sinh(t) gnuplot> quit $ cat hiberbola |awk '/[0-9]/{print "(",$1,",",$2,")"}' > hyperbola.txt The above saves in "hyperbola" a list of coordinates: each line contains a pair x y i (x coordinate, y coordinate, type of coordinate). The awk line turns it into a list of parenthesized coordinate pairs. The lines above saved me a lot of troubles yesterday.
  • 03.22.09
    RPM: listing files in installed packages cmd, network | rafacas | (0)
    # rpm -ql postgresql-libs /usr/lib/libecpg.so.6 /usr/lib/libecpg.so.6.0 /usr/lib/libecpg_compat.so.3 /usr/lib/libecpg_compat.so.3.0 /usr/lib/libpgtypes.so.3 /usr/lib/libpgtypes.so.3.0 /usr/lib/libpq.so.5 /usr/lib/libpq.so.5.1 [...] Lists all files of an installed package. It works only if the package is already installed on your system
  • 03.20.09
    Dynamic objects information shell | n0str0m0 | (0)
    From time to time, it is useful to inspect some binary files in order to get some interesting information as the objects and libraries, the binary is expecting to find when it gets loaded. We can do this with ldd $ ldd /bin/ls /bin/ls: libutil.so.7 => /lib/libutil.so.7 (0x800638000) libncurses.so.7 => /lib/libncurses.so.7 (0x800747000) libc.so.7 => /lib/libc.so.7 (0x800893000)
  • 03.18.09
    Play Tetris at the command line fun | rafacas | (0)
    I have been suscribed to sed-users group for quite a while. At sed's home page there is a section named gamez, where one can see some games written in sed such as tic tac toe, pong, sokoban, arkanoid. Some members have contributed more games, like a Julia who wrote tetris, sedtris. Are they not real commandliners? ;-) The following image is a screenshot. Do you feel like gaming?
  • 03.16.09
    Ten largest files/dirs cmd | rafacas | (0)
    $ du -sm * | sort -rn | head -10 Shows the ten largest files/dirs in the working directory. I find it very useful when I need more free space.
  • 03.14.09
    Removing software in FreeBSD shell | n0str0m0 | (0)
    Sometimes you need to uninstall some software. May be you need more room in your hard drive (not quite often nowadays, though) or maybe you just don't like the software and want to get rid of it. Here, pkg_delete and pkg_deinstall come to rescue. pkg_delete deletes a software package previously installed. It is a quite simple program, so we will jump to the other option. % pkg_delete kismet-200805.r1_1 % pkg_deinstall is a wrapper for pkg_delete that handles wildcards and traverses dependencies. So it is specially useful when you need to remove a software package that installed a lot of other packages (Gnome? KDE?). The drawback, ...