selfjungle Just another WordPress weblog


create file with given size (filled with zeros)

dd if=/dev/zero of=FILENAME  bs=1024k count=MEGABYTES
Tagged as: No Comments

replace string in dir

grep -rl STRING1 .  | xargs ^Cd -i 's/STRING1/STRING2/g'

Note: This replaces STRING1 to STRING2 even in hidden dirs, which can mess up your .git/index

Tagged as: No Comments

non interactive gdb to run & backtrace

set confirm off can turn off the "Quit anyway? (y or n)" question.

gdb EXECUTABLE  -ex "set width 1000" -ex "thread apply all bt" -ex run -ex bt -ex "set confirm off" -ex quit
Tagged as: , No Comments

direct rendering without root

If as a non-root user even thou GLX module is loaded:

user $ cat /var/log/Xorg.0.log | grep -i glx
LoadModule: "glx"

you don't have direct rendering:

user $ glxinfo | grep direct
direct rendering: Yes

But you do have it as a root, you might want to add the user to the correct group:

root $ gpasswd -a [USERNAME] video

gentoo wiki

Tagged as: No Comments

Export/apply git diff as patch

git diff > save.patch
patch -p1 < save.patch

Link: Stackoverflow

Tagged as: No Comments

getting rid of consolekit and policykit

systemd makes them redundant, getting rid of them is pretty easy:

edit /etc/pam.d/system-auth and enable

session         optional

and re-emerge pambase

USE=-consolekit emerge  pambase

and sincle polkit is used by upower and udisks (automount) and these 2 is used by kdelibs, you may want ot rebuild kdelibs too:

USE="-upower -udisks" emerge  kdelibs

link: gentoo wiki

Tagged as: , No Comments

start DHCP at boot with systemd

migrating from openRC was smooth and automatic, except starting the DHCP.
To play with runlevels, issue this commands:

systemctl enable dhcpcd
systemctl disable dhcpcd

They seem to translate to creating/deleting symlinks:

ln -s '/usr/lib64/systemd/system/dhcpcd.service' '/etc/systemd/system/'
rm '/etc/systemd/system/'
Tagged as: No Comments

update all packages under same category (for example KDE) with emerge

from eix --help:

 -#, --only-names       --pure-packages with format /
 -I, --installed       Next expression only matches installed packages.
 -C, --category          category

The emerge command:

emerge -av $(eix -I#C kde-base)
Tagged as: , No Comments

Pidgin settings for gchat & Off The Record Messaging (OTR)

In Advanced tab:

Connection security: "Use old-style SSL
Connect Port: 443
Connect Server:

From a comment:

Filed under: Uncategorized No Comments

kill the x server

ctrl + alt + F1
Filed under: Uncategorized No Comments