2015 in review
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.
[manjaro] xbox 360 controller
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
- Gamepad @ ArchWiki
[manjaro] spideroak icon missing on system tray
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.
LaTeX: horizontal line
\newcommand\sep{\noindent\rule[0.5ex]{\linewidth}{1pt}}
Usage:
text \sep go on
resize an .mkv file
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.
open PDF at a given page
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”.
Update (20180413)
Okular also has this feature and the option is the same:
okular -p 200 ehh.pdf
battle test your server with siege
“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.