$hbas = Get-VMHostHba -VMHost $vmHost -Type FibreChannel foreach ($hba in $hbas) { $wwpn = (&{param ($s) for($i=14;$i -gt 0;$i-=2) {$s=$s.insert($i,":")} return $s}("{0:x}" -f $hba.PortWorldWideName)) Write-Host "`t" $hba.Device "|" $hba.model "|" "World Wide Port Name:" $wwpn }
Tmux on login
to start tmux on login add the following to your ~/.bashrc
# Start Tmux by default # If not running interactively, do not do anything if command -v tmux>/dev/null; then [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux fi
Auto attach
to automatically attach to last session or create a new if none available extend your ~/.bashrc and ~/.tmux.conf with the following
~/.bashrc
# Start Tmux by default # If not running interactively, do not do anything if command -v tmux>/dev/null; then [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux attach fi
~/.tmux.conf
# if run as "tmux attach", create a session if one does not already exist new-session -n $HOST
Emoji on Linux
Debian/Ubuntu:
apt-get install ttf-ancient-fonts
Arch Linux:
yaourt -S ttf-ancient-fonts
Powershell change VM network adapter type
Change all adapters of a vm named ‘myvm’ to while keeping all other settings like mac address:
- E1000:
get-vm 'myvm' | get-networkadapter | set-networkadapter -type e1000
- vmxnet3:
get-vm 'myvm' | get-networkadapter | set-networkadapter -type vmxnet3
- all possible values:
e1000; Flexible; Vmxnet; EnhancedVmxnet; Vmxnet3
DNS Fun
calc
A calculator supporting addition, substraction, multiplication and division (respectively : ADD, SUB ,MUL, and DIV operations). More information here.
dig 2.8.add.calc.postel.org @dns.postel.org +short
0.10.0.0
dig 8.2.sub.calc.postel.org @dns.postel.org +short
0.6.0.0
dig 2.8.mul.calc.postel.org @dns.postel.org +short
0.16.0.0
dig 8.2.div.calc.postel.org @dns.postel.org +short
0.4.0.0
IP to ASN Mapping
A service providing a way to map IPv4 and IPv6 addresses or prefixs to ASNs, get information about ASNs, and even find possible peers. More details here.
Mapping an IP address or prefix to a corresponding BGP Origin ASN:
dig 4.4.8.8.origin.asn.cymru.com TXT +short
"15169 | 8.8.4.0/24 | US | arin |"
dig 4.8.8.origin.asn.cymru.com TXT +short
"15169 | 8.8.4.0/24 | US | arin |"
dig 4.4.8.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.8.4.0.6.8.4.1.0.0.2.origin6.asn.cymru.com TXT +short
"15169 | 2001:4860::/32 | US | arin | 2005-03-14"
Getting information about a given ASN:
dig AS15169.asn.cymru.com TXT +short
"15169 | US | arin | 2000-03-30 | GOOGLE - Google Inc.,US"
fun
dig any google-public-dns-a.google.com +noall +answer
; <<>> DiG 9.8.3-P1 <<>> any google-public-dns-a.google.com +noall +answer ;; global options: +cmd google-public-dns-a.google.com. 38271 IN TXT "http://xkcd.com/1361/" google-public-dns-a.google.com. 38271 IN AAAA 2001:4860:4860::8888 google-public-dns-a.google.com. 38271 IN A 8.8.8.8
more stuff at http://www.cambus.net/interesting-dns-hacks/