Skip to content

Instantly share code, notes, and snippets.

@hijak
hijak / qc.sh
Created January 4, 2014 20:32
QC SCRIPT
#!/bin/bash
#a QC script helper
read -p "
----------------------------------------------------------------
QC SCRIPT HELPER Press enter to continue Press ctrl-c to exit
----------------------------------------------------------------" &&
@hijak
hijak / nginX-useful
Created November 1, 2013 09:18
Nginx Useful location entry's
###only allow GET and HEAD requests (if request method IS NOT get or head then return 405 error)
if ($request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
###deny other host headers (ref scams) (if the host is not mydomain return 405 error)
if ($host !~* ^(mydomain.com|www.mydomain.com)$ ) {
return 405;
}
@hijak
hijak / Eth-Remap-rhel-deb
Created October 31, 2013 14:34
Ethernet Nic Name Remapping
###For RedHat distros
lspci -vv | grep 'Ethernet\|Serial' | awk 'NR == 1{ printf $1 } NR == 2 { print " mac " $7 }' | sed –e 's/-/:/g' -e 's/:f[ef]:f[ef]//g' -e 's/01:00.0/eth0/g' -e 's/01:00.1/eth1/g' -e 's/01:00.2/eth2/g' -e 's/01:00.3/eth3/g' > /etc/iftab && ifrename
###For Debian distros
lspci -vv | grep 'Ethernet\|Serial' | awk 'NR == 1{ printf $1 } NR == 2 { print $7 }' | sed –e 's/-/:/g' -e 's/:f[ef]:f[ef]//g' -e 's/01:00.0/eth0/g' -e 's/01:00.1/eth1/g' -e 's/01:00.2/eth2/g' -e 's/01:00.3/eth3/g' > /etc/mactab && nameif
@hijak
hijak / ESX-5.1-QC
Last active December 27, 2015 02:09
ESXi 5.1 QC commands
###Displays current hostname
hostname
###shows order or nics should display I350 gigbit nics as first as these are the onboard ports (r720)
esxcfg-nics -l
###Shows IP addresses for management interfaces and vMotion
esxcfg-vmknic -l | grep IPv4
###ExNet management gateway (public gateway)
@hijak
hijak / Windows-Interfaces
Last active December 27, 2015 02:09
Windows Powershell examples for interface config
##rename interface
netsh interface set interface name=”Old Name” newname=”newname”
##add ip config
netsh interface ip set address name="Public" static 192.168.0.100 255.255.255.0 192.168.0.1
##add dns config
netsh interface ip add dns "public" 83.138.151.80 INDEX=1
netsh interface ip add dns "public" 83.138.151.81 INDEX=2