Category Archives: Gentoo

Gentoo linux

Setup Ansible latest version

Download ansible from git:

cd /opt/
git clone
cd ansible

Download all necessary modules:

git submodule update --init lib/ansible/modules/core
git submodule update --init lib/ansible/modules/extras
git submodule update --init v1/ansible/modules/core
git submodule update --init v1/ansible/modules/extras

add ansible's path to PATH (I use it from root):

echo 'export PATH=/opt/ansible/bin:$PATH' >> ~/.bashrc
echo 'export PYTHONPATH=/opt/ansible/lib' >> ~/.bashrc

reload .bashrc and after check ansible version command:

ansible --version

if you see that there is no some modules:

pip install <module name>

output should looks similar to:

ansible --version
ansible 2.0.0 (devel 2c9d1257ba) last updated 2015/07/06 12:42:09 (GMT +300)
  lib/ansible/modules/core: (detached HEAD ff69ce7912) last updated 2015/07/06 12:53:13 (GMT +300)
  lib/ansible/modules/extras: (detached HEAD 4e48ef9eca) last updated 2015/07/06 12:53:21 (GMT +300)
  v1/ansible/modules/core: (detached HEAD f8d8af17cd) last updated 2015/07/06 12:53:27 (GMT +300)
  v1/ansible/modules/extras: (detached HEAD 495ad450e5) last updated 2015/07/06 12:53:33 (GMT +300)
  configured module search path = /usr/share/ansible

e2fsck cheatsheet

e2fsck has softlinks in /sbin that one can use to keep the names of fsck tools more uniform. i.e. fsck.ext2, fsck.ext3 and fsck.ext4 (similarly, other filesystem types have e.g.: fsck.ntfs) This cheatsheet will make use of these softlinks and will use ext4 and /dev/sda1 as an example.

fsck.ext4 -p /dev/sda1 — will check filesystem on /dev/sda1 partition. It will also automatically fix all problems that can be fixed without human intervention. It will do nothing, if the partition is deemed clean (no dirty bit set).

fsck.ext4 -p -f /dev/sda1 — same as before, but fsck will ignore the fact that the filesystem is clean and check+fix it nevertheless.

fsck.ext4 -p -f -C0 /dev/sda1 — same as before, but with a progress bar.

fsck.ext4 -f -y /dev/sda1 — whereas previously fsck would ask for user input before fixing any nontrivial problems, -y means that it will simply assume you want to answer «YES» to all its suggestions, thus making the check completely non-interactive. This is potentially dangerous but sometimes unavoidable; especially when one has to go through thousands of errors. It is recommended that (if you can) you back up your partition before you have to run this kind of check. (see dd command for backing up filesystems/partitions/volumes)

fsck.ext4 -f -c -C0 /dev/sda1 — will attempt to find bad blocks on the device and make those blocks unusable by new files and directories.

fsck.ext4 -f -cc -C0 /dev/sda1 — a more thorough version of the bad blocks check.

fsck.ext4 -n -f -C0 /dev/sda1 — the -n option allows you to run fsck against a mounted filesystem in a read-only mode. This is almost completely pointless and will often result in false alarms. Do not use.

IT Security Brothers (

Hi guys, I would like to present you our new project IT Security Brothers
We provide pentest, consultations and IT outsourcing services.
Feel free to hire us for IT jobs.

Gentoo: utorrent autostart

tar -zxf utorrent-server-3.0-25053.tar.gz
mv utorrent-server-v3_0/* /home/user/.utorrent/
cat > /etc/init/utorrent.conf
description «utorrent startup script»

start on (local-filesystems and started dbus and stopped udevtrigger)
stop on runlevel [016]

cd /home/user/.utorrent
exec su user -c «/home/user/.utorrent/utserver»
end script

ln -s /lib/init/upstart-job /etc/init.d/utorrent

/etc/init.d/utorrent start
update-rc.d utorrent defaults

xorg-server patching

The problem of using keyboard shortcuts with the keyboard layout is relevant from about 2004.
For example: if «ctrl+shift» is keyboard layout, then «ctrl+shift+t»(open last closed tab in google chrome) — will not work.
I'm using linux Gentoo.
Further actions will be relevant only for Gentoo.
Under root user do next steps:
emerge -f xorg-server
cd ~
cp /usr/portage/distfiles/xorg-server-1.9.2.tar.bz2 .
tar -jxf xorg-server-1.9.2.tar.bz2
cd xorg-server-1.9.2
patch -p1 < patch.xorg
ebuild /usr/portage/x11-base/xorg-server/xorg-server-1.9.2.ebuild unpack
cd /var/tmp/portage/x11-base/xorg-server-1.9.2/work
rm -rf xorg-server-1.9.2/
cp -R ~/xorg-server-1.9.2 .
ebuild /usr/portage/x11-base/xorg-server/xorg-server-1.9.2.ebuild merge
edit /var/lib/portage/world and delete string x11-base/xorg-server-1.9.2
/etc/init.d/xdm restart