Skip to content

Instantly share code, notes, and snippets.

View ruzickap's full-sized avatar

Petr Ruzicka ruzickap

View GitHub Profile
@ruzickap
ruzickap / cz01-pgpool0{1,2}_installation.sh
Created October 25, 2014 10:13
cz01-pgpool0{1,2} pgpool servers installation
#pgpool installation
yum localinstall -y http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
yum install -y pgpool-II-93 postgresql93
scp -r cz01-psql01.example.com:/root/{.ssh,.pgpass} /root/
scp cz01-psql01.example.com:/root/.pgpass /root/
cp /etc/pgpool-II-93/pcp.conf.sample /etc/pgpool-II-93/pcp.conf
echo "admin:`pg_md5 password123`" >> /etc/pgpool-II-93/pcp.conf
@ruzickap
ruzickap / f5_dns_vip.sh
Created December 23, 2014 13:57
BIGIP F5 DNS VIP configuration
tmsh create sys application service dns-ext-vip1_53 { \
description "DNS VIP - External - NS1 53" \
strict-updates disabled \
tables add { \
vs_pool__members { \
column-names { addr port conn_limit } \
rows { \
{ row { 10.0.1.10 53 0 } } \
{ row { 10.0.1.20 53 0 } } \
} \
@ruzickap
ruzickap / f5_ldap_vip.sh
Created December 23, 2014 14:01
BIGIP F5 LDAP VIP configuration
tmsh create sys application service ds-vip_389 { \
description "Directory Server VIP 389" \
strict-updates disabled \
lists add { irules__irules { } } \
tables add { \
vs_pool__pool_members { \
column-names { addr port conn_limit } \
rows { \
{ row { 10.0.0.150 389 0 } } \
{ row { 10.0.0.151 389 0 } } \
@ruzickap
ruzickap / f5_https_vip.sh
Created December 23, 2014 14:06
BIGIP F5 HTTPS VIP configuration
tmsh create sys application service https-vip_443 { \
description "HTTPS Server VIP 443" \
strict-updates disabled \
tables add { \
pool__hosts { \
column-names { name } \
rows { { row { config.cloud.example.com } } } \
} \
pool__members { \
column-names { addr port_secure connection_limit } \
# Turn OFF Firewall
chkconfig firewalld off
service firewalld stop
echo "192.168.122.46 centos7-client.ec.example.com centos7-client" >> /etc/hosts
# Change DNS server to 192.168.122.247 (ad.example.com)
cat >> /etc/dhcp/dhclient-eth0.conf << EOF
supersede domain-name-servers 192.168.122.247;
@ruzickap
ruzickap / openwrt_nodogsplash.sh
Last active October 10, 2015 20:48
OpenWrt - Nodogsplash configuration
#Download the nodosplash compiled for Turris router (mpc85xx) [if it's not already in the "main repository"]
curl -L --insecure "https://github.com/ruzickap/linux.xvx.cz/raw/gh-pages/files/turris_configured/root/nodogsplash_0.9_beta9.9.8-2_mpc85xx.ipk" -O /tmp/nodogsplash_0.9_beta9.9.8-2_mpc85xx.ipk
#Install the package (try first: opkg install nodogsplash)
opkg install /tmp/nodogsplash_0.9_beta9.9.8-2_mpc85xx.ipk
#Backup the original config file
mv /etc/nodogsplash/nodogsplash.conf /etc/nodogsplash/nodogsplash.conf-orig
#Create main config file
@echo Change DNS to AD server
netsh interface ipv4 add dnsserver "Local Area Connection" address=192.168.122.247 index=1
@echo Change TimeZone
tzutil /s "Central Europe Standard Time"
@echo Configure NTP server
net start w32time
w32tm /config /manualpeerlist:"ntp.cesnet.cz" /reliable:yes /update
@echo Change TimeZone
tzutil /s "Central Europe Standard Time"
@echo Configure NTP server
net start w32time
w32tm /config /manualpeerlist:"ntp.cesnet.cz" /reliable:yes /update
@echo Change hostname
powershell -NoProfile -command "$sysInfo = Get-WmiObject -Class Win32_ComputerSystem; $sysInfo.Rename('ad');"
@ruzickap
ruzickap / win7-user.bat
Last active December 27, 2015 21:49
win7 customization file. Run right after you first log in with administrator rights.
:: Tested on Windows 7
echo on
rem for /f "tokens=3" %%i in ('netsh interface ip show addresses "Local Area Connection" ^|findstr IP.Address') do set IP=%%i
rem for /f "tokens=2 delims=. " %%j in ('nslookup %IP% ^|find "Name:"') do set HOSTNAME=%%j
@echo.
@echo Enable Administrator
@ruzickap
ruzickap / create_autostart_iso.sh
Last active December 27, 2015 21:59
Create iso containing VirtIO drivers and autostart script.
#!/bin/bash -x
URL="http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-65.iso"
ISO=`basename $URL`
sudo rm autostart.iso
wget --continue $URL
sudo mount -o loop ./$ISO /mnt/iso