command

Changing executable permissions under Subversion

I manage my projects using Subversion. One day, I checked out my old project and found out that C source files are flagged with executable permissions. Provably, when I first checked them into the repository, they were accidentally with executable permissions. In my attempt to fix it, I changed them back to non-executables by chmod command and committed the files with other changes to the repository. However, when I updated the files on other computer, the source files are still with executable permissions!

Creating ISO files of CD/DVD media or directories

I would like to summarize how to create ISO files of CD/DVD media or directories.

Creating an ISO image of a CD/DVD disc

First, make sure that your disc is currently *not* mounted.

$ sudo umount /dev/cdrom

Then, create an ISO image disc.iso of the disc by dd command:

$ dd if=/dev/cdrom of=disc.iso bs=1024

Creating an ISO image of a directory

Mounting / un-mounting ISO files from the command line

I would like to summarize how to probe an ISO file from the command line.

Mounting an ISO image file

Create a mount point directory isodir and mount hoge.iso file. The contents of hoge.iso is now accessible through the isodir.

$ mkdir isodir
$ sudo mount -t iso9660 -o loop hoge.iso isodir

Un-mounting an ISO image file

First, make sure that the isodir (and its internal files and irectories) is not being used. Then, issue the following command.

Probing installed packages/files efficiently using dlocate command

It is crucial to efficiently probe packages and files that are already installed on your Linux system, like

  • finding the package that a particular file on your system is belonging to,
  • checking filenames that are contained in an already installed package.

Recently, I have found that using dlocate command rather than dpkg possibly boosts productivity in doing so. Compared to dpkg, dlocate excels particularly in

  • search speed,
  • search space,

Configuring a dual-head system using xrandr command

I have been using my Eee PC 1000H at home since I don't own any desktop computer. I am quite happy with my Eee PC except for its relatively small display (a 10-inch LCD panel) for an indoor computing environment. But, finally, I have decided to buy a larger external display so that I can use it together with my Eee PC. What I got is MITSUBISHI Diamondcrysta RDT1765, a secondhand 17-inch LCD display. What I can do with my two displays? A dual-head system :-) The following is what have tested.

Sending Japanese emails by a Perl script

WARNING: Thanks to a generous feedback from J, I have realized that the following method using ISO-2022-JP for Japanese emails is obsolete. Accordingly, I would like to mark the main part of this article as NOT-RECOMMENDED. Instead, in the comment column below, I have posted a fixed script that uses UTF-8. This UTF-8 based emailing script should work not only for Japanese but also for any other non-English languages as well.

Batch sending a large number of emails by Perl

I occasionally help my friends who are running a company regularly dealing with hundreds of customers. Sending multiple emails based on a single sending list requires a kind of batch email construction and sending. In this article, I introduce a Perl script approach to accomplish that kind of tasks.

For an introduction to sending an email from the command line by Perl, see this previous article.

Here is an index to this article:

Sending an email from command line by a Perl script

With the ability to send emails in the command line, we can imagine that some more practical tasks become feasible:

  • Hooking it up to CGI applications or cron to send status reports, alerts, etc.
  • Composing dynamically formatted emails and sending them to a large number of people in a sending list.

Creating a zip file of a directory in command line

What is the ideal compressed file format when distributing multiple files (e.g. via email) with reasonable compression to your friends? I think creating a zip file is one of the most reasonable choice over other possible formats such as .tgz, or .rar etc. This is because zip is, I believe, the most widely supported compressed file format including in Windows.

To create a zip file for a directory mydir in command line, you may do

$ zip -r mydir.zip mydir

Connecting Ubuntu to wireless networks from the command line

I usually use Linux with IceWM window manager without Gnome nor KDE desktop environments, where I have to manually connect to wireless networks using console commands. Here, I show how I do it. This tip should be also useful if you are working under non-graphical session and needing a wireless network connection, such as in case of headless servers or embedded systems.

Method

First, check our wireless interface name and access points:

$ sudo iwlist scan
ra0       Scan completed :
Syndicate content