Tuesday, May 26, 2015

How to make GRE tunnel iptables port redirect on Linux

1. Load the ip_nat_pptp and ip_conntrack_pptp kernel module
modprobe ip_nat_pptp
modprobe ip_conntrack_pptp

vi /etc/sysconfig/iptables-config
IPTABLES_MODULES="ip_nat_pptp"

http://www.pc-freak.net/blog/how-to-make-gre-tunnel-iptables-port-redirect-on-linux/
http://download.parallels.com/doc/pcs/html/Parallels_Cloud_Server_Users_Guide/30254.htm

Friday, May 15, 2015

Updating XAMPP for Linux


/opt/lampp/lampp stop

mv /opt/lampp /opt/lampp.old

./xampp-linux-5.5.19-0-installer.run --mode text

/opt/lampp/lampp stop

rsync -av /opt/lampp.old/cgi-bin /opt/lampp/ --delete
rsync -av /opt/lampp.old/htdocs /opt/lampp/ --delete
rsync -av /opt/lampp.old/var/mysql /opt/lampp/var/ --delete

rsync -av /opt/lampp.old/phpmyadmin/config.inc.php /opt/lampp/phpmyadmin/
rsync -av /opt/lampp.old/etc/freetds.conf /opt/lampp/etc/freetds.conf
rsync -av /opt/lampp.old/etc/httpd.conf /opt/lampp/etc/httpd.conf
rsync -av /opt/lampp.old/etc/php.ini /opt/lampp/etc/php.ini
rsync -av /opt/lampp.old/etc/extra/httpd-ssl.conf /opt/lampp/etc/extra/httpd-ssl.conf
rsync -av /opt/lampp.old/etc/extra/httpd-userdir.conf /opt/lampp/etc/extra/httpd-userdir.conf
rsync -av /opt/lampp.old/etc/extra/httpd-vhosts.conf /opt/lampp/etc/extra/httpd-vhosts.conf
rsync -av /opt/lampp.old/etc/extra/httpd-xampp.conf /opt/lampp/etc/extra/httpd-xampp.conf
rsync -av /opt/lampp.old/etc/my.cnf /opt/lampp/etc/my.cnf

mv /opt/lampp.old/moodledata /opt/lampp/

/opt/lampp/lampp start

/opt/lampp/lampp security

rm -rf /opt/lampp.old

Cloning Disk with Acronis


After Disk Cloning using Acronis True Image partition the UUID on Grub menu and fstab are different from the original.

We need to enter in rescue mode and mount the partitions (/dev/sda5 = / & /dev/sda1 = /boot in my case).

# Mount root partition:
mount /dev/sda5 /mnt  # /dev/sda5 is your root partition, e.g. /dev/sda1

# If you have a separate boot partition you'll need to mount it also:
mount /dev/sda1 /mnt/boot

# Mount your virtual filesystems:
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt$i; done

# Chroot:
chroot /mnt

Change the UUID on /etc/fstab
blkid /dev/sda5 >> /etc/fstab
blkid /dev/sda1 >> /etc/fstab
use an editor like vim and replace the old UUID by the new ones

Update Grub menu if is neccesary
#Reinstall Grub menu:
grub2-install /dev/sda
 or on 1 sector of partition
grub2-install /dev/sda1


#Delete FlexNet message if you want
dd if=/dev/zero of=/dev/sda bs=512 count=62 seek=1


#:

cd /boot
dracut -f
grub2-mkconfig -o /boot/grub2/grub.cfg
exit
reboot