With my VPS I sometimes encounter a situation when I try to open a file with Vim, but it tells me the file has already been opened by someone else. This “someone else” is another myself, logged in via SSH from my laptop, which has been suspended (SSH sessions are not being disconnected when you suspend). An easy way to disconnect myself, logged in from the laptop, is using pkill.
That’s it. SSH session has been disconnected and I can now open the desired file.
As you may have noticed, Qt apps no longer use GTK+ theme in Xubuntu 11.10. For me this became particularly noticeable in Psi+. The problem is caused by QGtkStyle, which cannot find GTK+ theme since Xfce stores it in an unusual location (not sure why 11.04 could find it though).
To fix the problem add the following to
~/.config/xfce4/gtkrc (create the file if it does not exist):
~/.config/xfce4/xinitrc and add the following to it:
1 2 3 4
After relogin all Qt apps will use your current Xfce GTK+ theme.
To make the Xfce Window Buttons applet (or simply the Taskbar, as all of us are used to call it) multi-row, add the following to
~/.config/xfce4/gtkrc (create the file if it doesn’t exist):
1 2 3 4 5 6 7 8 9 10 11
After you relogin, your panel should look like this:
I was searching for a way to make some kind of a live memory usage monitoring in Linux when I found watch. I wonder why didn’t I ever knew about it! It’s damn useful! You can monitor literally everything with watch.
Here are some scenarios you may use if for:
Watch for changes in a directory:
$ watch ls -la
Watch for any Java program being started/stopped:
$ watch -n 1 "ps ax | grep java"
I used watch for memory usage monitoring:
$ watch -n 1 free -m
$ watch -n 1 cat /proc/meminfo
Doing some testing recently, I needed a way to eat up as much RAM as possible on a Linux machine. As it turned out, there are not as many ways to do that quickly and easily as one could have desired. I’ve found only two actually. The first one, using Bash arrays, is quite slow. The second one, using C malloc and memset functions, is quite insecure because you can end up in a completely unresponsive machine (its especially important if the machine is remote). It could be extended though, to support sleeps and the amount of memory to be allocated (also I had some problems with int type overflow if specifying huge amount of RAM), but not being familiar with C, I did not want to dive deep into the problem.
Trying to google a little harder I found another way to do that, similar to the malloc+memset one — C realloc function. Actually I was lucky to find a ready-to-use code on C on unix.com (thank you pludi). The only thing the code lacked was a sleep function to sleep for some time with memory allocated. I added it and here’s what I’ve ended up with.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
There is quite a lot of noise regarding this error in the Internet. It is being triggered by Eclipse’s (and Eclipse-based products’) SWT, whenever it tries to generate a ‘browser’ window (like the one used when you do git commit in Aptana).
The root cause of this error is that Eclipse’s SWT cannot find Mozilla’s Xulrunner, which it uses to draw ‘browser’ windows. It seems that the problem appeared with Firefox 3.0 (at least I’ve found a post of a guy who wrote he started to see this after his Firefox upgraded from 2.x to 3.0). For some reason SWT does not support Xulrunner of versions greater than 1.9.2.
Well, all the solutions found on StackOverflow, forums, bug trackers seem invalid. They all suggest to define the
MOZILLA_FIVE_HOME environment variable and point it to the Xulrunner installation (wherever it’s installed, with the requirement that the directory should contain libxpcom.so). In my case the result was that even the downloaded and extracted old Xulrunner 1.9.2 refused to work.
Then, on the Eclipse SWT FAQ page I found out that you can define custom path to Xulrunner Eclipse should be using. This is done with org.eclipse.swt.browser.XULRunnerPath option. But my downloaded and extracted Xulrunner distribution refused to work this way.
Then I started searching for an Ubuntu package of that old Xulrunner 1.9.2 (thought it could be that the lib should actually reside in the lib path). Since Xulrunner seems no longer being distributed apart from Firefox (at least in Ubuntu), there is not separate Xulrunner package for Ubuntu in the repositories. But I was lucky to find one for Oneiric on Launchpad here
So, basically, the steps to fix the error are the following:
- Download and install Xulrunner deb package from the Launchpad page above
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-188.8.131.52option to your
That should fix the problem.
Thanks to Bruno Carlin for the insight