Archive for CLI

how to deal with white spaces in file names in UNIX/Linux

More often nowadays, I found that I need to deal with something ‘foreign’ in unix/linux servers I manage professionally. One thing in particular is an increased number of files whose names have white spaces in them. Most unix/linux utilities use any white space (tab, new line, space) as their delimiter character of choice, hence the problem.

These files are either legal immigrants from the other operating systems (uploads to a CMS/wiki/blog, for example), or some native programs or utilities with “foreign” roots (vmware server).

The common way to deal with it, is to opt to use ASCII NUL as delimiter when invoking command line utilities. This capability is a built-in for  more unix/linux utilities than I knew when I started to research to resolve a problem I had.

  • grep -Z
  • find . -print0
  • xargs -0
  • cut –output-delimiter=”\0″

“find . -print0 | xargs -0 ls -ltr” does work well, while ’svn status | cut -b8 –output-delimiter=”\0″ | xargs -0 ls -ltr’ doesn’t. Read the rest of this entry »

Comments

how to generate a pair of GnuPG keys only to sign digitally

A pair of GnuPG keys are needed to sign files digitally. Below, I’ll highlight the choices you made when generating a pair of GnuPG keys only to sign and not to encrypt, using the cygwin port of GnuPG. The entire key-generation session will be appended at the end(Appendix A). A list of best practice recommendations for digital signature security are provided as well.

A GnuPG key pair has two keys, one private and the other public. They are mathematically related, just like asymmetric keys used in other PKI programs. The two keys in a GnuPG key pair are born equal, however. The only difference between a public key and a private key is the designation of purpose and the resultant protection scheme or lack of.  It’s like you have a newborn twin. For no good reason, you name one of the twin brothers Jerry and the other Tom, instead of the other way around. From that point on, you feed and treat them according to their names.  Late comers may come to believe that Tom was born a Tom and Jerry was born a Jerry. That is simply not true. Read the rest of this entry »

Comments (261)

rdesktop/Linux saved the day when its windows counterparts failed miserably

I was configuring two more Netgear MGR614v6 wireless routers earlier today. My laptop was plugged in one of its four LAN ports. The network connection to the Internet from the laptop went on and off as I changed the WAN and LAN settings on the wireless routers. Before I started the this wireless router configuration task, two RemoteDesktop connections were established to a remote Windows 2003 standard server, each using a different administrative account. The laptop was running up-to-date Windows XP sp2. Read the rest of this entry »

Comments

Sun’s JDK rpm is not RPM compliant due a hack to compress jar files

A developer alerted me that the jdk1.5.0_10 on a test server didn’t work.  A simple ‘java -version’ gave  the following error:

 Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

Poking around a little under /usr/java/jdk1.5.0_10,  I found that rt.jar was missing!  This version of JDK is an upgrade to accommodate the 2007 DST changes. Our current version 1.5.0_05 is just one revision older than the up-to-date release (1.5.0_06) .  I had problems installing it as a RPM on that particular server and ended up using rpm2cpio to get it in manually. The RPM was from SUN’s own download site.

Read the rest of this entry »

Comments

CLI : how to burn DVD/CD using mkisofs + cdrecord under CentOS Linux 4.4

I had trouble to continue using xcdroast to burn DVD to archive system backups yesterday. With the load I have at work, I can’t afford much time to coerce xcdroast to behave. Instead, I used mkisofs and cdrecord from command line to burn DVDs. The command line solves my urgent need for a working DVD burning programs, and dual as a verification on the claim that the cdrecrod from cdrtools package is now capable of burning DVD without the extra cdrecord.prodvd hack. Below are quick steps on how to burn DVD/CD using mkisofs and cdrecord under CentOS Linux 4. The steps and commands are done successfully on an up-to-date CentOS 4.4/i386 desktop. I can’t see why the same steps wouldn’t work on a up-to-date CentOS 4.1 or Fedora Core 6, or other linux/UNIX systems, given that mkisofs and cdrecord are available and proper kernel support is there for the DVD burners.

Read the rest of this entry »

Comments

« Previous entries