Recording on Linux with USB Microphone

I was having issues with recording stuff via microphone. I use Samson C01U USB microphone and I was not able to figure out how to record it via Jack Audio Connection Kit. Today I came across this page which explains steps to do to find out what is wrong. In the end I was able to set correct input device for Jack and now the recording works.

WordPress Plugin/Theme Updates on Gentoo

Default WordPress installation on Gentoo does not allow any updates. If you want to allow plugin and theme updates but otherwise want to update WordPress using Gentoo ebuilds then you have to change user access right on file wp-admin/includes/file.php in your installation to the same user as the one owning wp-content/plugins directory. The reason for this is that there is a check in the file that checks whether the owner of the file.php file same as the owner of the update directories. You have to do this each time you update your WordPress installation in your website using webapp-config.

I don’t know if it is the original intention of the www-apps/wordpress ebuild author or it changed along the way in the WordPress code, but this is how it is at the time of writing.

Of course you have to allow access for your PHP user running your website to WordPress servers in case you have restricted firewall.

You should also keep your WordPress installation updated to the latest version because of security issues of the application. You can check latest vulnerabilities at WPScan Vulnerability Database.

Tags: ,

Apache NetBeans on Gentoo

NetBeans users on Gentoo might have noticed that dev-util/netbeans was removed from the main tree recently. The reason was that it was pretty outdated and I do not have time to bump it to the newest version using the Gentoo standards. Anyway, there is still a solution. You can find the ebuild for the latest NetBeans in my overlay, named dev-util/netbeans-standalone to not conflict with the previous, now outdated ebuild. Also, up to the standard NetBeans releases, you can find there live ebuild for the latest greatest NetBeans. For those not used to use overlays, see Layman.

Tags: , ,

SSLProtocol in Apache 2.4 VirtualHost

After an hour trying to find out why SSLProtocol instruction in Apache 2.4 VirtualHost does not behave as I would expect, I came across this post that explains the reason. In a nutshell, there is a bug in OpenSSL. In the post there is also mentioned a patch though I did not give it a try, I just used the same protocol selection for the whole server.

Tags: , , ,

Configuring PulseAudio with Jack Audio Connection Kit (DBus)

Configuring PulseAudio with Jack Audio Connection Kit running via DBus is pretty easy nowadays. Following procedure was tested on Gentoo Linux but it should probably apply to other Linux distributions too. Used versions of packages were media-sound/pulseaudio-2.1-r1 and media-sound/jack-audio-connection-kit-2.9999 (from pro-audio overlay).

First you should check the name of the sound card you want Jack to play sound via. Use command aplay -l to get the name of the sound card. Then run following command to set the card for Jack:

jack_control dps device hw:DX

Replace DX with the name of your sound card.

Second, we’ll make sure Jack will use Alsa for output. Following command will set Jack output to Alsa:

jack_control ds alsa

If this command fails, make sure you have Python 2.7 selected as the active Python version. jack_control does not work with Python 3.2 because new Python changed print from statement to function and Jack Python scripts are not updated yet.

Last step is to start Jack and optionally configure PulseAudio. Issue the following command:

pulseaudio -k && jack_control start && pacmd set-default-sink jack_out && pacmd set-default-source jack_in

This command line first kills PulseAudio, then it starts Jack and tells PulseAudio to use Jack by default both for input and output.

If you do not get sound from sound applications that play sound via PulseAudio, use pavucontrol to check that the sound output for given application is directed to Jack sink.

ERROR: type “hstore” does not exist

I was getting this error though I issued CREATE EXTENSION hstore;. When I used \dx+ in psql to see installed extensions, I found out that extensions are installed into schemas instead of being installed globally in the database. So the reason I got this error was that the schema in which I installed hstore was not on my search path. If you have a database with more than one schema and you want to use hstore extension, you can either put on search path the schema in which you installed hstore or you can reference hstore using schema in your SQL statements.

SET search_path = primary_schema, schema_with_hstore;


CREATE TABLE test (col1 schema_with_hstore.hstore);


PostgreSQL Unix Socket vs TCP/IP Performance

I just finish a test that compares PostgreSQL speed using Unix socket and TCP/IP connection to localhost with SSL enabled. The test was performed on import on OpenStreetMap PBF file (around 17GB of binary data). The result is that loading the data via TCP/IP connection with SSL enabled was about 17% slower than loading data via Unix socket.

Unix socket:
Processing: Node(1542670k 261.2k/s) Way(146203k 26.07k/s) Relation(1518310 44.75/s)  parse time: 45446s

Processing: Node(1542670k 257.1k/s) Way(146203k 18.02k/s) Relation(1518310 38.92/s)  parse time: 53122s

Tags: ,

Configuring GNU Screen Status Bar

With default GNU Screen configuration in Gentoo (I have no experience with other Linux distributions) you get no visible user interface for the tool. To get a status bar that displays host name, list of screen windows with some usability information, system load and current date and time, you can put following line in file ~/.screenrc:

hardstatus alwayslastline '%{= G}[ %{G}%H %{g}][%= %{= w}%?%-Lw%?%{= R}%n*%f %t%?%{= R}(%u)%?%{= w}%+Lw%?%= %{= g}][ %{y}Load: %l %{g}][%{B}%Y-%m-%d %{W}%c:%s %{g}]'

You can find more information about status configuration in GNU Screen Manual.


Running your own OpenStreetMap maps (and more)

This post collects useful links when you want to use OpenStreetMap (OSM), being it using the maps, data services or running your OSM own server. There is a lot of OSM documentation on the net which is both good and bad. Some of the documentation is already obsolete so finding the right documentation might be challenging.

General Links:

Links for using OSM:

Contributing to OSM:

Interesting Android applications:


SSL in Apache with Intermediate Certificate

For configuration you need these files: domain.tld.key (your private key), domain.tld.crt (your public certificate) and intermediate.crt (intermediate certificate of your certificate authority).

The configuration is pretty easy. Just put these lines in your virtual server configuration:

SSLEngine On
SSLProtocol All
SSLCertificateFile /path/to/domain.tld.crt
SSLCertificateKeyFile /path/to/domain.tld.key
SSLCertificateChainFile /path/to/intermediate.crt
<Files ~ "\.(phtml|php?)$">
        SSLOptions +StdEnvVars
<IfModule mod_setenvif.c>
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0

Now just restart apache daemon and you’re done 🙂