selfjungle Just another WordPress weblog

10Apr/140

Export/apply git diff as patch

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

Link: Stackoverflow

Tagged as: No Comments
27Mar/140

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 pam_systemd.so:

session         optional        pam_systemd.so

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
18Mar/140

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/multi-user.target.wants/dhcpcd.service'
rm '/etc/systemd/system/multi-user.target.wants/dhcpcd.service'
Tagged as: No Comments
6Mar/140

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
21Feb/140

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

In Advanced tab:

Connection security: "Use old-style SSL
Connect Port: 443
Connect Server: talk.google.com

From a comment:

Filed under: Uncategorized No Comments
8Jan/140

kill the x server

ctrl + alt + F1
CTRL + C
Filed under: Uncategorized No Comments
25Oct/130

git auto-completion

wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -O ~/.git-completion.bash
source ~/.git-completion.bash
Tagged as: , No Comments
18Oct/130

pushing to a non-bare git repo

Init a directory as a bare repo in the first place:

git init . # non-bare
git init -bare . # bare

To be able to push into a non-bare repo, just check out a branch users don't push to:

git checkout -b DUMMY_BRANCH_DONT_USE

Or turn it into a bare repo:

rm *
mv .git/* .
rm .git
sed -i 's/bare = false/bare = true/' config

Source: gitolite

Tagged as: No Comments
15Oct/130

print range of lines of a file

Print from line N..M from FILE:

sed -n N,Mp FILE
Tagged as: No Comments
15Oct/130

what files does your executable open

strace -e trace=open EXECUTABLE