Archive

Archive for December, 2015

2015 in review

December 31, 2015 Leave a comment

The WordPress.com stats helper monkeys prepared a 2015 annual report for this blog.

Here's an excerpt:

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 140,000 times in 2015. If it were an exhibit at the Louvre Museum, it would take about 6 days for that many people to see it.

Click here to see the complete report.

Advertisements
Categories: Uncategorized Tags: ,

[manjaro] xbox 360 controller

December 31, 2015 Leave a comment

Question
For Xmas I bought an Xbox 360 (wired) controller for me. It’s really good :) It works well under Windows but how to use it under Manjaro?

Answer
When I started Manjaro, the led on the central button (“ring of light”) was blinking and the controller didn’t work. I tried it with some games on Steam but nothing happened. Then I noticed that if I unplug and reconnect the controller, then it starts working :) Actually, the cord has an inline release and it’s simpler to disconnect and reconnect this inline release. After this the led stopped blinking and its second quadrant started to glow.

Now the controller worked with the games but I could also move the mouse pointer with the controller. It was disturbing in the games so I had to create the following file:

/etc/X11/xorg.conf.d/50-joystick.conf :

Section "InputClass"
        Identifier "joystick catchall"
        MatchIsJoystick "on"
        MatchDevicePath "/dev/input/event*"
        Driver "joystick"
        Option "StartKeysEnabled" "False"       #Disable mouse
        Option "StartMouseEnabled" "False"      #support
EndSection

Restart the machine and you are done. Some tutorials suggest the “xboxdrv” package but I didn’t need that. The kernel in Manjaro includes the “xpad” kernel module and it worked well for me.

There was another problem: while I was playing, after some time the screensaver kicked in. The “caffeine-ng” package solved this issue (see also this post).

Links

Categories: games, manjaro Tags: , , ,

[manjaro] spideroak icon missing on system tray

December 19, 2015 Leave a comment

Problem
I also use SpiderOak (similar to Dropbox) and it starts automatically but it doesn’t appear on the system tray.

Solution
Launch it with some delay. I put the following script in the list of “Application Autostart”:

#!/usr/bin/env bash

sleep 30
/usr/bin/SpiderOakONE &

It did the trick.

Categories: manjaro Tags: , ,

LaTeX: horizontal line

December 15, 2015 Leave a comment
\newcommand\sep{\noindent\rule[0.5ex]{\linewidth}{1pt}}

Usage:

text

\sep

go on

resize an .mkv file

December 5, 2015 Leave a comment

Problem
I wanted to play a 720p .mkv file on an old laptop but it was painfully slow. How to reduce the quality of an .mkv file?

Solution
I found the solution here. The following worked for me:

$ ffmpeg -i Movie.mkv -vf scale=-1:360 -c:v libx264 -crf 18 -preset veryslow -c:a copy MyMovie_360p.mkv

Visit the link above for an explanation of the parameters.

Categories: bash Tags: , , , ,

open PDF at a given page

December 3, 2015 Leave a comment

Problem
From the command line you want to open a PDF file at a given page.

Solution
My favourite PDF viewer was okular but I didn’t find this option. But evince supports it:

evince -p 200 ehh.pdf

Where “-p” means “page”.

Categories: bash Tags: , , ,

battle test your server with siege

December 1, 2015 Leave a comment

Siege is a multi-threaded http load testing and benchmarking utility. It was designed to let web developers measure the performance of their code under duress. It allows one to hit a web server with a configurable number of concurrent simulated users. … Performance measures include elapsed time, total data transferred, server response time, its transaction rate, its throughput, its concurrency and the number of times it returned OK.” (source)

Here is a gist that shows how to use it.

Warning! Use siege only on your sites since it can be interpreted as a DDOS attack.

Categories: bash, Uncategorized Tags: , ,