2010-05-26

Setting up Samsung ML-1740 in OpenVZ VE

This is a quick walkthrough for setting up Samsung ML-1740 (or other Samsung laser printers) through USB port in Debian Linux OpenVZ VE . This adds on my previous guide and present a shorter walkthrough than the one in http://wiki.openvz.org/USB_Printing_in_VE

On HN:


Make sure the printer is on and connected to the usb port.

# aptitude install usbutils
# lsusb

Make sure the printer is listed in lsusb's output.
If this is the first USB printer connected to HN, then there should be /dev/usb/lp0.
Make sure /dev/usb/lp0 uid is "root" and gid is "lp" and the permission is at least 660 (u=rw,g=rw).


# vzctl set 555 --devnodes usb/lp0:rw --save


Now enter the VE:

# vzctl enter 555

Make sure there is /dev/usb/lp0 in VE (exported by HN). Make sure the permission is the same as in HN, owner user "root" and group "lp", and permission is at least 660.

# aptitude install cups splix
If you already have CUPS installed, restart it because the printer has to be powered on and plugged in before CUPS is started for it to see the printer.



# ${webbrowser} http://localhost:631

Go to "Administration", "Add printer", Enter name and click "Continue".
Next there's a device selection. Your printer should be listed there. My printer was listed as "Samsung ML-1740 USB #1 (Samsung ML-1740)".
If your printer is not there, the more likely causes are incorrect permission and/or CUPS started before the printer is up.

Select your Samsung model on the next screen and keep pressing "Continue".
You're done.

I'll never use JFS for root FS anymore

I love JFS, but I'm not going to use it for root FS anymore.

One of the computers had JFS for its root FS. The computer crashed. The filesystem became dirty and refused to be mounted rw until it is fsck-ed. Unfortunately, the fsck program for JFS exists only as a userland tool (kernel cannot do it) and Debian's standard initramfs image does not have fsck.jfs. So the root fs was mounted ro and, as a result, several important services, including ssh, failed to start.

It was a good thing that the computer was downstair. I just went downstair and used a rescue CD to fsck.jfs the volume. I had 3 rescue CDs: trinity 3.3, knoppix 6.2 and system rescue disk 1.3.2. Only the last one has fsck.jfs.

From now on, I'll be using JFS only for data volumes.

2009-07-30

iftop, vmstat, iostat, dstat, iotop, lsof, fuser

Some utilities I find helpful:

iftop -- shows current open connections and their transfer rates
vmstat -- shows virtual memory status (found in procps package)
iostat -- shows current IO transfer rate by devices (found in sysstat package)
dstat -- combines vmstat, iostat and iostat-like info for network IO
iotop -- like top, but the focus is on IO transfer rate
lsof -- get info from currently open files
fuser -- does a subset of lsof: identify processes and users using certain files

2009-07-20

Adding an md device to a LVM VG containing the root filesystem

Debian:

When adding an md device to a LVM VG containing the root filesystem, like so:
vgextend vg_with_root /dev/md99

Don't forget to run the following:

/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
dpkg-reconfigure mdadm

The first one is to update the mdadm.conf, and the second one is to reconfigure the initrd image the new md device will also be assembled prior to activating the VG. Otherwise, activating the VG will fail because it cannot find a required PV (the new md device).

2009-04-22

my wife, tetris ds mania.

Need to record this for family posterity: my wife just got 569131 points, level 31st.

2009-03-17

Keeping track of manually installed packages in Debian

This is how I keep track of manually installed packages in Debian:

Everytime I need to install a package, I create a file with the same name as the package name.

Examples:

$ touch /usr/local/etc/packages/list/qmail
$ echo 2009-03-17 J requested ipsvd for his app > /usr/local/etc/packages/ipsvd

$ make -f /usr/local/etc/packages/Makefile
apt-get install "ipsvd"
touch /usr/local/etc/packages/list/.ipsvd
apt-get install "qmail"
touch /usr/local/etc/packages/list/.qmail

And if you do another make:

$ make -f /usr/local/etc/packages/Makefile
make: Nothing to be done for `install-packages'.


In practice, I use aliases so I don't have type long paths. Here's how to set it up. Just copy-and-paste the code below:


mkdir -p /usr/local/etc/packages/list
cd /usr/local/etc/packages
cat > Makefile <<EOF

packages=/usr/local/etc/packages/list/*

install-packages: \$(packages)

\$(packages): /usr/local/etc/packages/list/%: /usr/local/etc/packages/list/.%

/usr/local/etc/packages/list/.%:
`echo -e \\\t`apt-get install "\$*"
`echo -e \\\t`touch \$@
EOF

2009-02-24

Video feed for President's address to Congress

CNN, MSNB, and FOX are all showing the same feed. Are they not allowed to put their own crews there?

2009-02-06

Mini-Tripod

The mini-tripod I ordered just arrived. It has bend-able legs and its small size makes it a perfect travelling companion for my pocket camera. This should solve my problem with having to keep the camera steady for night shooting.


So, what night shooting is complete without a few pictures of the stars? Here I have ursa major, leo, puppis, and canis major. Oh, look, we're even graced by Saturn's appearance.

I love the tripod.
 





2009-01-26

Calvin & Hobbes, $15/glass lemonade




Oil's market is International

"The oil is drilled right here in Alaska, and yet we're paying $8 a gallon? Something is amiss here. The oil companies are making billions of dollars, and people here can't afford to eat," said Pat Samson, social services director for the Assn. of Village Council Presidents in Bethel, about 35 miles southwest of Tuluksak. [Source: In rural Alaska, villagers suffer in near silence]

The plight of Alaskan rural residents further evidenced the maxim that the market for oil is International. Having the oil being pumped nearby does not convey any special previlege to residents living in the area. It does not shield the residents from having to lock in prices in Summer, and they cannot prevent the oil from leaving their area.

In fact, why should the oil companies have to prioritise local residents? The residents are poor and their demands, compared to the international market, are immaterial. Setting up, no, even thinking about setting up to serve local residents would cost more than simply throwing the oil  to the international market.