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
ENVIRONMENT="$1" | |
test_CNT="thing1 thing2 thing3" | |
beta_CNT="thing4 thing5 thing6" | |
varname=${ENVIRONMENT}_CNT | |
for i in ${!varname}; do | |
echo $i | |
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
echo -n 'CPU Temperatures (Celsius): ' | |
for thermal_zone in thermal_zone3 thermal_zone4 ; do | |
echo -n "$(echo 'scale=1;' $(cat /sys/class/thermal/$thermal_zone/temp) '/1000' | bc) " | |
done | |
echo |
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/env bash | |
# before running this script: | |
# manually assign a hostname in System Preferences/Sharing | |
# optionally, set external facts github_token_ro and github_token_rw | |
set -evx | |
sudo mkdir -p /etc/puppetlabs/{puppet,facter/facts.d} | |
export PATH=$PATH:$HOME/.gem/ruby/2.0.0/bin |
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
awaxa@air:~/tmp $ curl -s --head http://www.yahoo.com | head -n 1 | xxd | |
00000000: 4854 5450 2f31 2e31 2033 3031 2052 6564 HTTP/1.1 301 Red | |
00000010: 6972 6563 740d 0a irect.. |
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
class ntp { | |
package { 'ntp': | |
ensure => present, | |
} | |
file { '/etc/ntp.conf': | |
ensure => file, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
source => 'puppet:///modules/ntp/ntp.conf', |
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/env sh | |
iptables -F | |
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP | |
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP | |
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP | |
iptables -A INPUT -i lo -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT | |
iptables -A INPUT -j DROP |
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
Device Identifier: disk2 | |
Device Node: /dev/disk2 | |
Whole: Yes | |
Part of Whole: disk2 | |
Device / Media Name: WD My Passport 0741 Media | |
Volume Name: Not applicable (no file system) | |
Mounted: Not applicable (no file system) |
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
rescued: 1868 GB, errsize: 0 B, current rate: 0 B/s | |
ipos: 1879 GB, errors: 0, average rate: 2423 kB/s | |
opos: 1879 GB, run time: 8d 22h 7m, remaining time: n/a | |
time since last successful read: 6d 10h 9m | |
Copying non-tried blocks... Pass 3 (forwards) |
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/expect | |
set timeout 3 | |
if {[llength $argv] == 0} { | |
send_user "Usage: outlet [1-8] [on|off] \n" | |
exit 1 | |
} | |
set number [lindex $argv 0] | |
set onoff [lindex $argv 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
#!/usr/bin/expect | |
set timeout 3 | |
spawn telnet pdu | |
expect "User Name :" { send "apc\r" } | |
expect "Password :" { send "apc\r" } | |
# device manager |