This is a weird situation which I found myself in recently. One of the ubuntu servers were having issues and was unable to launch any process for unknown reason (kernel issue/disk or filesystem failure/etc). Puzzled, I tried to reboot the machine using
reboot, but the system did not allow me to. It also failed to run utilities such as
After some googling, here is the magic (“magic SysRq key”):
echo 1 >/proc/sys/kernel/sysrq
echo s > /proc/sysrq-trigger (optional, sync mounted filesystems)
echo u > /proc/sysrq-trigger (optional, remount filesystems as read-only)
echo b > /proc/sysrq-trigger
echo is a bash shell builtin command and does not have to be a new process. Reboot now!
Linux Magic System Request Key Hacks
Quassel is a cool IRC client and server. From its homepage:
Quassel IRC is a modern, cross-platform, distributed IRC client, meaning that one (or multiple) client(s) can attach to and detach from a central core — much like the popular combination of screen and a text-based IRC client such as WeeChat, but graphical.
One can choose to install quassel from the distro’s repo, or use the statically linked binary provided by the author. The advantages of the statically linked binary are: it does not require Qt or SSL to be installed, and is probably a newer version than what is in the repo.
The download provided is a 32-bit binary. To run it in 64-bit Ubuntu, we need to satisfy its dependencies:
apt-get install zlib1g:i386
Extract and run:
Blogs | Quassel IRC
Downloads | Quassel IRC
On adding chinese input (
ibus-pinyin etc) on ubuntu desktop, chinese text in the browser tabs became scrambled.
To get back legible tabs, remove the offending fonts:
fc-cache -f -r
In my case it was
65-droid-sans-fonts.conf, but I suppose it could be other fonts that was installed with the browser too.
(edit) Or, reinstall the droid fonts:
apt-get purge fonts-droid
apt-get install fonts-droid
Unicode characters cannot be displayed on Chrome tab title on Linux – Super User
Issue 316723 – chromium – Chinese <title> tags are not displayed correctly
Certain routers like the Asus RT-N66U have built-in network print server capability, which is an under-appreciated feature IMHO. But the settings > add printer dialog in Ubuntu 14.04 left much to be desired when it could not add the printer running behind the Asus router.
As a workaround, run the following command to get a better add-printer facility:
LPD/LPR Host or Printer.
Enter router IP (commonly
192.168.1.1) in “Host”, and
LPRServer in “Queue”, and select
Choose the driver that matches the printer to add it to the system. You can now print from other applications.
ASUSTeK Computer Inc.-Forum- How to setup network printer in Ubuntu 12.04
1. Add redundant repo
In /etc/apt/sources.list, add:
deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
2. Set timeout
Create /etc/apt/apt.conf.d/99timeout, add:
apt – How to lower wait time for repository updates – Ask Ubuntu
Disclaimer: I am a noob at gdb.
To use intel syntax and display the current instruction:
(gdb) set disassembly-flavor intel
(gdb) display/i $pc
Next, setting a breakpoint where
0xdeadbeef is the address of
call fork instruction. Get gdb to follow fork child instead of parent, which is the default behaviour. Step over the fork to land in the child process:
(gdb) break *0xdeadbeef
(gdb) set follow-fork-mode child
Bonus, setting a rwx data breakpoint:
(gdb) awatch *0xbabecafe
Now I am not sure which is the greater evil, gdb or windbg…
As I was trying out zfs (on Ubuntu) on our HP server, I realised the RAID card that came with the server, HP Smart Array P410i, does not have a JBOD (Initiator-Target) mode. Now this is a First-world-problem – the card can support RAID 0, 1, 10, 5, 6, 50, 60, but not JBOD (?!).
Moving on, the next best thing is to configure every disk (we have 8 SSD) to be a 1-disk RAID 0 array to “simulate” a JBOD setup. Inside Ubuntu, there is now a 1-to-1 mapping of device to drive (sda – sdh), which is what is recommended by zfs.
Creating the zfs pool and setting some options:
zpool create tank sda sdb sdc sdd sde sdf sdg sdh
zfs set atime=off tank
zfs set sharesmb=on tank
But this is not the crux of this article. The problem is that random write performance is not as good as we expected out of zfs. The ideal setup would be to expose individual disks to zfs, but we could only expose the disks through the RAID card. After some tinkering, we found that the drive write cache was disabled, probably due to the fact that there is no battery unit on the RAID card.
To enable drive write cache:
hpacucli controller slot=0 modify drivewritecache=enable
IIRC there was some warnings, but I ignored them as what I want is a JBOD setup to hold non-mission critical data. A raidz pool can be setup if need be for redundancy, but at this point I lost myself looking at the 2x increase in write bandwidth. Next up, trying to saturate the pipe 😀