Skip to content

Operating Systems

Centos problems

Error performing checksum

These errors when trying to install a package :

errors
http://example.com/repodata/filelists.sqlite.bz2: [Errno -3] Error performing checksum
http://example.com/repodata/primary.sqlite.bz2: [Errno -3] Error performing checksum

Are mostly because the installing yum cannot decode sha256 checksum. Install support with :

install
yum install python-hashlib

Osx problems

Losing focus on OSX xterms

I noticed this after a software update, xterm once selected shortly loses focus and turns back after a second or so. See klopt.org for detailed info, but it's my android phone attached as PTP camera. The program grabbing focus is com.apple.PTPCamera.

Set it to MTP !

node(js) not working under apache

In the cheat sheet mechanism all javascript/nodejs code stayed empty, while others like php and python worked fine. To find out what goes wrong it altered the code with some shell_exec() input that helps.

The code used for executing nodejs code is more or less :

not working
1
2
3
chdir("src/.javascript");
$syscommand = "./" . $problem . ".js";
$result = shell_exec($syscommand);

With this code gives an empty output on OSX, all other systems display "Hello, world!".

not working on osx
#!/usr/bin/env node
console.log("Hello, world!");

add error output to the result

Alter the syscommand as seen above to :

error
$syscommand = "./" . $problem . ".js 2>&1";

Now you get some answers, clue 1 :

error with hint
env: node: No such file or directory
env: node: No such file or directory

It can't find node at all using the environment of the user running apache. See next on how to print that.

add some commands to the file executed

Simply add commands before the shebang, so it will be interpreted by bash :

diagnose
1
2
3
4
env | grep PATH
whoami
#!/usr/bin/env node
console.log("Hello, world!");

This will show that the does indeed not contains /usr/local/bin where node is, and that user _www is the one who's environment must be changed.

output
PATH=/usr/bin:/bin:/usr/sbin:/sbin
_www

Next on how to fix that problem:

Configure Apache Path Environment Variable on Mac OSX

Edit the file /System/Library/LaunchDaemons/org.apache.httpd.plist :

And add this to the EnvironmentVariables section that's probably already there :

extend path
1
2
3
4
5
6
7
<key>EnvironmentVariables</key>
<dict>
    <key>..otherkey</key>
    <string>...otherstring</string>
    <key>PATH</key>
    <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
</dict>

No restart apache :

restart apache
apachectl stop
apachectl start