The site is currently being redesigned, sorry for any inconvenience.
Linux UDP Download / Upload Limiter
I recently ran into a bandwidth problem using Skype, and I found no easy way to limit it, trickled doesn't work for UDP, and after some research I came across QoS / tc shaping.
Continue reading
Pasting in VIM from KDE’s clipboard
For some reason I couldn't find it anywhere, but the register for the KDE clipboard (ctrl-c / ctrl-v) is + not * .
To paste from the KDE clipboard in insert mode : CTRL-R +, in normal mode : "+p.
To map it to ctrl-v : :imap , this way you can just press ctrl-v in insert mode to paste the system clipboard.
To paste from the system selection (mouse middle button) in insert mode : CTRL-R * or in normal mode "*p .
To paste from the VIM buffer in insert mode : CTRL-R ".
To set the system clipboard as the default clipboard for vim (for yy,dd,cc,p) : :set clipboard=unnamedplus .
Also make sure to check :registers .
Change CPUFreq governor on all CPUs
While I love KDE, I still prefer to use command line for almost everything.
A simple bash function to set/list all governors (add it to ~/.bash_profile)
set-cpufreq() {
if [ -z "$1" ]; then
echo "Available : $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)"
find /sys/devices/system/cpu -name scaling_governor | while read f; do echo $f : $(cat $f); done
else
find /sys/devices/system/cpu -name scaling_governor | while read f; do echo $1 > $f; done
fi
}
Workaround for Wine/World Of Warcraft Crashing on Linux 64bit systems with > 4gb of RAM.
I recently got a new computer with 8gb of RAM, and since then World Of Warcraft crashed very often with out of memory errors.
After banging my head for hours every time I crashed in dalaran or coming out of the arenas, I finally discovered setarch(8).
Usage: setarch [options] [program [program arguments]]
Options:
-h, --help displays this help text
-v, --verbose says what options are being switched on
-R, --addr-no-randomize disables randomization of the virtual address space
-F, --fdpic-funcptrs makes function pointers point to descriptors
-Z, --mmap-page-zero turns on MMAP_PAGE_ZERO
-L, --addr-compat-layout changes the way virtual memory is allocated
-X, --read-implies-exec turns on READ_IMPLIES_EXEC
-B, --32bit turns on ADDR_LIMIT_32BIT
-I, --short-inode turns on SHORT_INODE
-S, --whole-seconds turns on WHOLE_SECONDS
-T, --sticky-timeouts turns on STICKY_TIMEOUTS
-3, --3gb limits the used address space to a maximum of 3 GB
--4gb ignored (for backward compatibility only)
Start the game :
setarch i386 -3 -L -B -R wine wow.exe -opengl
While it isn’t a perfect solution, it work’s for the most part.
Speeding Chrome / Chromium start up on Linux
If you have been using Chromium like me, you know it can get pretty slow on the first start up after a couple of months of usage.
It's mainly because of all the SQLite 3.x databases it uses for history and other settings.
So here's a simple script to defrag and reindex all the databases chromium uses.
Continue reading
Using CMake + Mingw to Cross-Compile Windows Apps (Part 2)
this is deprecated and have been long replaced by the mingw-w64 packages.
As promised, here's the second part of the tutorial on how to use cmake to build Qt4/OpenSSL Apps for Windows using mingw on Linux.
Assumptions :
1. You already followed the tutorial on how to setup Qt4/OpenSSL using mingw.
2. You have cmake installed.
3. You have a working wine setup or a way to test the executables.
Continue reading
Crosscompile Mingw + OpenSSL + Qt4 for Windows on Linux
this is deprecated and have been long replaced by the mingw-w64 packages.
For the longest time I used Mingw + cmake on top of wine to cross compile my Qt4 apps for windows, then I was bored one day, tired of how slow it is to recompile qt4 on wine and decided to try to get it to work with a native gcc instead of the overhead with wine.
So here goes.
This was done on Gentoo Linux, please don't ask me how to do it on other distros.
Assumptions :
1. You know your way around the linux shell and have portage privileges.
2. You're not scared from compiling things by hand.
3. You already have Qt4 installed and it is the same version as the windows source we gonna build.
4. Your working path will be ~/win32.
5. You have a working wine setup.
Continue reading