This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install related library | |
sudo apt install git intltool libtool network-manager-dev libnm-util-dev libnm-glib-dev libnm-glib-vpn-dev libnm-gtk-dev libnm-dev libnma-dev ppp-dev libdbus-glib-1-dev libsecret-1-dev libgtk-3-dev libglib2.0-dev xl2tpd strongswan libnss3-dev libssl-dev | |
git clone https://github.com/nm-l2tp/network-manager-l2tp.git | |
cd network-manager-l2tp | |
autoreconf -fi | |
intltoolize | |
./configure \ | |
--disable-static --prefix=/usr \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Need to run manual paste command | |
### Create snapshot | |
lvcreate -L50G -s -n centos-disk-snapshot /dev/sanbox-vg/centos-disk-fresh | |
### Restore snapshot | |
lvconvert --merge /dev/sanbox-vg/centos-disk-snapshot | |
lvchange -an /dev/sanbox-vg/centos-disk-fresh | |
lvchange -ay /dev/sanbox-vg/centos-disk-fresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The command below creates a tgz file with all emails for [email protected] in .eml format: | |
# execute as root | |
/opt/zimbra/bin/zmmailbox -z -m [email protected] getRestURL "//?fmt=tgz" > /tmp/account.tgz | |
# You can do the same via a REST URL: | |
wget http://ZIMBRA.SERVER/home/[email protected]/?fmt=tgz | |
# to restore email: | |
/opt/zimbra/bin/zmmailbox -z -m [email protected] postRestURL "//?fmt=tgz&resolve=reset" /tmp/account.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can override config options very easily. | |
# Just create a custom options file; it may be version specific: | |
# - custom-options.sh | |
# - custom-options-5.sh | |
# - custom-options-5.3.sh | |
# - custom-options-5.3.1.sh | |
# | |
# Don't touch this file here - it would prevent you to just "svn up" | |
# your phpfarm source code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample centos xen config file | |
vcpus = '2' | |
memory = '2046' | |
# | |
# Disk device(s). | |
# | |
# Comment 'file:/home/freakie/CentOS-7-x86_64-Minimal-1611.iso,hdc:cdrom,r' after installation complete | |
disk = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER=db2 | |
PORT=3306 | |
(echo > /dev/tcp/$SERVER/$PORT) | |
if [ "$?" -ne 0 ]; then | |
echo "Connection to $SERVER on port $PORT failed" | |
/etc/init.d/mysql stop | |
/etc/init.d/mysql bootstrap | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
c=5 # seconds to wait | |
REWRITE="\e[25D\e[1A\e[K" | |
echo "Starting..." | |
while [ $c -gt 0 ]; do | |
c=$((c-1)) | |
sleep 1 | |
echo -e "${REWRITE}Backup Bola..$c" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
# | |
# @package Localhost Port Forwarder | |
# Allow access private server behind firewall | |
# | |
# @todo | |
# + Server config save | |
# + Multiple server port | |
# + Switch port forward type L - Local Port R - Remote Port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# phpMyAdmin default Apache configuration | |
Alias /dbadmin /var/www/dbadmin | |
<Directory /var/www/dbadmin> | |
Options FollowSymLinks | |
DirectoryIndex index.php | |
<IfModule mod_php5.c> | |
AddType application/x-httpd-php .php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
## | |
# | |
# Generate mac address | |
# | |
## | |
for ($i=0;$i<5;$i++){$m[$i]=int(rand(256));} printf "02:%X:%X:%X:%X:%X\n",@m; |