dd unix CLI command taking a while? Just ask how it is doing …

linux misc

It turns that you can ask a running dd command how it is doing.

In the terminal that runs it simply enter a CTRL^T command.

The dd will react to the SIGINFO that this sinds with statistics of the running process.

Quiet handy since dd can take a while if you start it with a lower block size.

assemble images randomly

linux misc

Want to assemble images randomly into one? That’s easy in the command line if you have imagemagick installed:

Assuming you have all pictures in the current directory:

for i in *jpg ; do mv "$i" $RANDOM.jpg ; done

this renames all files ending in jpg into files that have a random number. Files might get overwritten should the random number come up again.

Assembling is as well:

montage *jpg -mode concatenate outputfilename.jpg

If you would run this again outputfilename.jpg would be a used as source image as well.

linux

When installing opendkim on a Centos 5.7 or 5.9 system following the wonderful howto by Steven Jenkins mail stops going out and the maillog shows:

May 23 12:55:53 her9 postfix/cleanup[4836]: warning: cannot receive milters via service cleanup socket socket
May 23 12:55:53 her9 postfix/smtpd[4832]: warning: premature end-of-input on public/cleanup socket while reading input attribute name
May 23 12:55:53 her9 postfix/smtpd[4832]: warning: cannot send milters to service public/cleanup socket
May 23 12:55:53 her9 postfix/smtpd[4832]: 8DBDB4D48004: client=localhost.localdomain[127.0.0.1]
May 23 12:55:53 her9 postfix/master[4824]: warning: process /usr/libexec/postfix/cleanup pid 4836 killed by signal 11
May 23 12:55:53 her9 postfix/master[4824]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling

The syslog is even scarier:

May 23 12:55:53 her9 kernel: cleanup[4836]: segfault at 0000000000000008 rip 00002b152350db10 rsp 00007fff855746e8 error 6

Yes, a segfault. Things work better when SELinux gets disabled.
Without going deeply into the reason of this incompatibility the following commands make opendkim work while SELinux is still active.

This command will show you what did cause trouble today, and convert it already in to the syntax for an ‘allow’:

ausearch -m avc -ts today | audit2allow


If what you see is indeed only about opendkim you then can go ahead and install this:
ausearch -m avc -ts today | audit2allow -M yourdesiredmodulename
semodule -i yourdesiredmodulename.pp

Things work much better then.

The Centos SELinux How To is a helpful resource for this kind of thing.

infinite sar display – neat option

history linux technology

wanting watch sar run in a terminal in linux indefinitely one can start it with


sar 1 0

The first number indicates the sampling time in seconds. The second number is usually the number of samples you like ot see.

If this number is 0 then sar will not stop. And as another bonus will look at how large the terminal is and will display a new header
accordingly.

Command line can be user friendly. I really like those little gems that show up in all software: People spending their time to make something better. It is like a little gift to the world. With software the value of even a little detail can potentially be significant. Which is an awesome thing.

For all we know it might very well be that the feature described here will please people in a hundred years from now.

I don’t think that mankind will manage to drop unix at this point. Neither can it give up on the use of steel. Yes there might be new systems, much like there have been new materials.

The new gets all the attention. But in many cases the new will not replace the old entirely. Only journalists tend to think that way. In reality the findings of Mr Newton help Boeing and Airbus today to build tubes with wings that shuttle people around the globe close to the sound of speed.

hfs dmg files in Centos

Apple linux

In Centos 5.7 mounting dmg files created under OS X 10.6 with hdiutil no longer worked:

mount  -t hfsplus -o loop dmgFileFromOSX10.6.dmg  /mountpoint

results in

mount: wrong fs type, bad option, bad superblock on /dev/loop0,
 

Without having researched it I doubt that it is the actual Centos Version that matters here.

The dmg has been created under OS X 10.6 in the terminal via:

hdiutil create -size 1024k dmgFileFromOSX10.6.dmg -fs HFS+ -volname 'test dmg'

DMG creation in the command line is a work around for the (arbritrary?) minimum size requirements of the Disk Utility program of 5.2MB and 10.1MB.

It turns out that a dmg file created with the same command line in OS X 10.4 ( on a G4 machine ) works fine. On which side 10.5 falls we did not test.

centos source install wget 1.13 and GNUTLS

linux

installing wget 1.13 from source on Centos 5.7 the configure command was not happy:

checking for main in -lgnutls... no
configure: error: --with-ssl was given, but GNUTLS is not available.

It turns out the solution is simple:

./configure --with-ssl=openssl

did the trick.

At first I thought that a “yum install gnutls-devel” might help. The ./configure part indeed finished after the install of the developer package, but the actual make still failed:

gnutls.o: In function `ssl_connect_wget':
gnutls.c:(.text+0x3f1): undefined reference to `gnutls_priority_set_direct'
gnutls.c:(.text+0x481): undefined reference to `gnutls_priority_set_direct'
collect2: ld returned 1 exit status

Configuring with the openssl option made everything work very smoothly …

mail me later

internet linux

I really like email. It works well for me. One thing that I grew accustomed to was the abillity to postpone email. To set up quick reminders easily. I used ‘replylater.com’ for this. Unfortunately last month they stopped working for me.

I decided to just implement the same features myself: Mail Me Later works pretty much like replyater.com.

The ‘problem’ is, that once a tool works for me I completely start to rely on it. Having a topic delegated to a service like ‘mail me later’ means that I will entirely forget about it. Good since it saves hassle, really bad if that service fails.

Having this part of me workflow now in an environment where I can quickly verify its operation makes me very happy.

libavcodec.so: undefined reference to `x264_encoder_open_104′

linux

A recent svn checkout on a Centos 5.5 x86_64 of ffmpeg refused to link. It complained:


libavcodec.so: undefined reference to `x264_encoder_open_104'

The fix was as simple as


LD_LIBRARY_PATH=/usr/lib
export LD_LIBRARY_PATH

before ./configure. In a weird way it makes even sense.

ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)

linux

On a centos machine ldapsearch was not giving me much love when accessing a Microsoft Global directory server via ldaps and a given port. The error message I got was:


ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

When turning up debug level via -d 1 as in


ldapsearch -d 1 -v -H ldaps://servername:portnumber

I got the bit more revealing error message:


TLS certificate verification: Error, unable to get local issuer certificate
TLS trace: SSL3 alert write:fatal:unknown CA
TLS trace: SSL_connect:error in SSLv3 read server certificate B
TLS trace: SSL_connect:error in SSLv3 read server certificate B
TLS: can't connect: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (unable to get local issuer certificate).

It turns out that a simple line like


TLS_REQCERT never

in ldap.conf makes things better. In my particular install a simple ‘locate ldap.conf’ was a bit misleading. The true location of your config file can be revealed via:


strace ldapsearch -v -H ldaps://servername:portnumber 2>&1 | grep ldap.conf

looking up memory chips

linux technology

If a machine sports edac then


find /sys/devices/system/edac/ \( -name mem_type -o -name size_mb -o -name mc_name \) -exec cat {} \;

will display quickly what kind of memory modules are visible to the kernel, and in which state they are in.