Penguin, small TECH.BARWICK.DE

Recent posts





Powered By


Monday, May 30, 2016  11:54 AM

Forcing GPG passphrase input in the terminal

One annoyance when entering GPG passphrases in terminal applications on many systems is that a seperate GUI window pops up. To enable passphrase entry in the comfort of your own terminal, set the following line in .gnupg/gpg-agent.conf

pinentry-program /usr/bin/pinentry-tty

or in some older distributions (e.g. CentOS 7):

pinentry-program /usr/bin/pinentry-curses

The running agent's settings can be reconfigured with:

gpg-connect-agent reloadagent /bye

See also "Making GPG pinentry work over SSH".

Posted in Linux | add a comment

Sunday, October 18, 2015  10:17 PM

Improving top output in OS X / macOS

The OS X "top" command default output is somewhat hard to decipher (and modify interactively) compared to Linux. A simple workaround is to launch it with:

top -o cpu

(or another field) which sorts on cpu activity rather than the PID (default).

htop is also available via MacPorts.

Posted in Mac OS X | add a comment

Sunday, February 22, 2015   5:44 AM

openSUSE 13.2 - Notes

Posted in Linux | add a comment

Monday, November 17, 2014   5:08 AM

Error: "util.c: No such file or directory" - a gnuplot thing

I was setting up a cronjob and it kept failing with the very unhelpful util.c: No such file or directory. After much headscratching it turns out this is a gnuplot error message, meaning it is unable to read from or write to a file (in this case the latter). The file in question is not of course util.c.

Posted in Devel | add a comment

Saturday, September 27, 2014   1:42 AM

Ansible and "powershell: not found" error

I was bemused by the below error when attempting to run an Ansible playbook on a new (Linux) server for the first time:

PLAY [someserver] ***************************************************************** 

GATHERING FACTS *************************************************************** 
failed: [someserver] => {"failed": true, "parsed": false}

/bin/sh: 1: powershell: not found

This happened with gather_facts set to true. Setting it to false worked around the issue, however I'm pretty sure powershell hasn't been ported to Debian... Ansible version:

$ ansible-playbook --version
ansible-playbook 1.8 (devel ffee9a8fe0) last updated 2014/09/27 14:24:58 (GMT +900)

The actual cause was the absence of python on the target server; this will need to be manually installed before Ansible can be of much use.

Posted in Devel | add a comment

Sunday, February 16, 2014   8:39 AM

OpenSUSE / Samba: "Invalid key 0 given to dptr_close" error

After upgrading to openSUSE 13.1, the Samba configuration - which I use mainly to share a directory on my workstation-cum-fileserver to a media player on the local network - mysteriously failed to work as expected. The client could mount, but not see, any directories or files. The only vaguely relevant clue appeared to be this entry in /var/log/samba/log.smbd:

Invalid key 0 given to dptr_close

After much head-scratching, it turns out AppArmor is enabled by default on openSUSE 13.1 and was the source of the error. Resolving the issue with AppArmor brought Samba back to life.

Posted in Linux | add a comment

Tuesday, February 11, 2014   1:53 AM

VirtualBox on openSUSE 13.1

I made the mistake of installing VirtualBox from the openSUSE repository, and after much pain trying to troubleshoot the error "This usually means that the vboxdrv module is not loaded. Try again after loading the module" (which pops up every time a virtual machine is launched), I remember the least painful way to install VirtualBox on openSUSE is to follow these instructions, adjusting the version numbers (both for openSUSE and for VirtualBox) accordingly.

As of the time of writing, doesn't provide packages for openSUSE 13.1, however the packages for 12.3 installed just fine and seems to work so far using some pre-existing images, including different Windows versions.

Note: this issue appears to have gone away in OpenSUSE 13.2.

Posted in Linux | add a comment

Friday, April 12, 2013   5:34 PM

Wrapper script for find

I find (hah) myself using find a lot to locate file system objects in the current directory, however find recurses into subdirectories by default. Using the parameters -mindepth 1 -maxdepth 1 restrict find to the current directory, are however a pain to type each time.

To make my own personal life easier I created this wrapper script (named find1):


if [ ($# < 1) ]; then

find $FINDPATH -mindepth 1 -maxdepth 1 $@

which automatically prepends the -mindepth and -maxdepth to find (they need to be first in the argument list).

Posted in Shell | add a comment

As mentioned previously, it's possible to install the usual set of command-line tools without the full XCode installation. However this seems to confuse Apache (at least with version 2.2), which is expecting to find a C compiler in the XCode folder:

checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1

Configuring Apache Portable Runtime library ...

checking for APR... yes
  setting CC to "/Applications/"
  setting CPP to "/Applications/ -E"
  setting CFLAGS to " "
  setting LDFLAGS to " "

Configuring Apache Portable Runtime Utility library...

checking for APR-util... yes
checking for gcc... /Applications/
checking whether the C compiler works... no
configure: error: in `/Users/ian/src/httpd-2.2.24':
configure: error: C compiler cannot create executables

Posted in Mac OS X | add a comment

Thursday, March 21, 2013  12:24 AM

Using MacPorts without a full XCode installation

As mentioned previously, it's now possible to install XCode's command line tools without installing the entire XCode environment. This is particularly handy when setting up an environment on a remote Mac. However it looks like MacPorts is still expecting to find the full XCode installation and will complain like this:

Some-Mac-mini:~ root# port install somepackage
Error: No Xcode installation was found.
Error: Please install Xcode and/or run xcode-select to specify its location.

Posted in Mac OS X | add a comment

Wednesday, March 20, 2013  11:30 PM

Install XCode command line tools via the command line

Occasionally I've needed to set up some kind of script or even a server application in a remote office, where the only computer with a UNIX-style environment is a Mac. Although OS X comes with a fair amount of tools built-in, these are usually not sufficient for the specialised configuration required, which means I need to compile some applications from scratch and probably install a command-line driven package management system such as MacPorts. To get this up and running of course, I need a compiler and associated tools, which are not built in. These are available from Apple as part of the XCode package; recently the non-IDE parts of XCode have been made available as a separate dmg file.

Posted in Mac OS X | add a comment

Friday, February 1, 2013   2:12 AM

Remove all cookies in SeaMonkey

Occasionally I like to remove a bunch of cookies from a SeaMonkey profile, unfortunately at some point it appears the Great Dumbing Down is spreading even to obscure browsers such as this Netscape descendant, and the "Tools > Cookie Manager > Manage Stored Cookies" dialogue only allows you to delete cookies for individual sites (trying to mark multiple sites no longer works).

Luckily it appears there is a hidden chrome URL which still offers this functionality:


(paste into the address bar).

There's a list of similar useful chrome URLs here:

Posted in WWW | add a comment