Skip to main content

Posts

Ssh command can send back the data on the remote standard output stream to the local standard input like: ssh hoge@remote 'dd if=/dev/zero count=512' | dd of=/dev/null Of course, this does not make sense, but works  :-)  I often use this data transmission method for the backup purpose. Recently, I was asked by the network administrator to limit the band width of ssh data transmission. I didn't know how to archive his demand at first, but I found a good command-line tool, and worked it out. It was "cpipe". I could install very easily with: apt-get install cpipe and here is an example how to use cpipe: ssh hoge@remote 'dd if=/dev/zero count=512 | cpipe -s 1000' | dd of=/dev/null Have fun!

Multiple generations of backup and hardlink

I suppose it a common way to preserve multiple generations of backup copy of your important data. To preserve them as much as possible, archiving and compressing the backup copy is one way. But there is another way to save the storage: hard-linking. The basic idea is to share the identical files between different generations of backup copy with hard links. If the target data consist of normal files, rsnapshot does most of the hard-linking management automatically. But I recently encountered the problem with the database files managed by daemon processes. Because they are supposed to be changed asynchronously,  the consistency of th オプション eir copy taken with the cp command is not guaranteed. Because this kind of problems is often aware in the design of the daemon processes, special backup methods are provided to export the consistent backup copy. For example, Subversion provides "svnadmin hotcopy" subcommand, and Trac provides  "trac-admin hotcopy...

Chroot login environment for each login users

Recently, I have written an article about how to make a chroot login environment for each user in the diskspace-saving way. It is for Kansai Debian meeting , and I'm going to give a presentation  based on the article there on Feburary 26th. The article is written in Japanese. Its title is "Building a multi-user environment with autofs and pam_chroot". Another effort is needed to translated it into English. If anyone wants it, please give me a comment. :-)

Compress log files efficiently with 7zip

 7-zip is a popular compression tool and  famous for high compression ratio. But unfortunately, there is no description in the man pages about switching the compression algorithm to PPMd . Actually, PPMd provides very high compression ratio with lower CPU power consumption with a text data, and I would like to show its efficiency. Here is an example. Below is a comparison of size and CPU time between variety of  compression methods .    command       size      time    7z a -tzip -mx=9    3699 bytes   0m0.410s 7z a -tgzip -mx=9    3610 bytes   0m0.411s 7z a -tbzip2 -mx=9    3363 bytes    0m0.608s 7z a -m0=lzma -mx=9    3406  bytes   0m0.109s 7z a -m0=PPMd -mx=9    2699 bytes   0m0.058s The original file is a 6795 byte text file. As you can see, efficiency of PPMd is outstanding! PPMd helps me a lot to...

Nested xdm session under the gdm session

I usually use the gdm for X session manager. Under this circumstance, I wanted to test a xdm, a very traditional X session manager. Rather than replacing gdm with xdm, I tried to start a xdm within a gdm session. Here is how I did: In a gnome-terminal type as follows: # su # xdm -server ":1 nest local /usr/bin/Xnest :1 -geometry 800x600" Cheers!

Nested gdm session

I am preparing for a presentation using X desktop, and want to start another gdm session inside my GNOME desktop environment. It seemed to require long descriptions in the configuration file at first, but  a simple command solved the problem. $ gdmflexiserver -n This starts another gdm greeter inside a  Xephyr (if unavailable, Xnest instead) window. Excellent!