How to resize LVM logical volumes with ext4 as filesystem


# Unmount the filesystem and check its' LV
umount /mnt/foo
e2fsck -f /dev/mapper/vg0-foo

# Shrink ext4 and then the LV to the desired size
resize2fs -p /dev/mapper/vg0-foo 40G
lvreduce -L 40G /dev/mapper/vg0-foo

# Before continuing, run e2fsck. If it bails because the partition
# is too small, don't panic! The LV can still be extended with
# lvextend until e2fsck succeeds, e.g.:
# lvextend -L +1G /dev/mapper/vg0-foo
e2fsck -f /dev/mapper/vg0-foo

# Resize the filesystem to match the LVs size, check and mount it
resize2fs -p /dev/mapper/vg0-foo
e2fsck -f /dev/mapper/vg0-foo
mount /mnt/foo

umount /mnt/bar

# Extend the LV to use all free space
lvextend -l +100%FREE /dev/mapper/vg0-bar
e2fsck -f /dev/mapper/vg0-bar

# Resize the partition to fill the LV
resize2fs -p /dev/mapper/vg0-bar
e2fsck -f /dev/mapper/vg0-bar
mount /mnt/bar

source:
source

mini backup with rsync

#!/bin/bash
# Backup file remote/local
# By Carlo Bertini [WaYdotNET]
# il tutto utilizzando rsync senza scomodare subversion

# RSYNC OPTION 
# -r => ricorsivo
# -l => copy symlinks as symlinks
# -p => preserve permissions
# -v => verbose
# -u => update, ignorare i file che sono piรน nuovi nella destinazione
# -a => archive mode
# -z => comprime i file durante l invio
# -h => rendere leggibile l output
# --delete => cancello i file estranei nella destinazione

# il comando si deve chiamare con:
demo="sync_to_waydotnet [up or down] local_folder remote_folder" 

# VARIABILI
base="~/backup"
type=$1
local_folder=$2
remote_folder=$base/$3
host="HOST.EXT"
user="user"

if [ $type = "up" ] ; then
	echo "UPLOAD $local ==> $remote"	
	rsync -lrpuazhv --delete -e ssh $local_folder $user@$host:$remote_folder
elif [ $type = "down" ] ; then
	echo "DOWNLOAD ...... $remote ==> $local"
	rsync -lrpuazhv --delete -e ssh  $user@$host:$remote_folder $local_folder
else
	echo -e "la forma corretta da scrivere e' n $demo'"
fi
echo "Have a nice day :P"

how to highlight and bookmarks pdf files on linux

Because i need to highlight and bookmarks pdf file on linux/windows, only solution wich i’ve found is
Foxit Reader 3.3.1 for Windows

[UPDATE]
Foxit Reader 4.0 for Windows link 06/29/10

The linux version is too old and not have these function, but with wine work well (you need also mdac2.8 and jet4.0)

tips 4 me:
create foxit in $HOME/bin

#!/bin/sh
wine /home/waydotnet/wine_tools/Foxit Reader.exe $1

and

chmod +x foxit

If you found another solution, please comment ๐Ÿ˜€

Bye

My notes

1) compile wxruby 64bit system:

export CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC

2) Set proxy:

export http_proxy="http://user:pass@proxy:port"
export ftp_proxy="http://user:pass@proxy:port"