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
Facter.Add(:test1) do | |
confine :kernel => 'Windows' | |
setcode do | |
powershell = 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe' | |
test1 = 'Get-Content C:\test.txt | Select-String -Pattern "test1" - SimpleMatch | foreach { $_.ToString().split(" ")[1]}' | |
Facter::Util::Resolution.exec(%Q{#{powershell} -command "#{test1}"}) | |
end | |
end | |
# Below is example of file |
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
cd /root | |
yum install -y screen | |
wget https://dl.ngrok.com/ngrok_2.0.19_linux_amd64.zip | |
unzip ngrok_2.0.19_linux_amd64.zip | |
wget https://github.com/yudai/gotty/releases/download/v0.0.10/linux_amd64.tar.gz | |
tar -zxvf linux_amd64.tar.gz | |
nohup /root/gotty -c marshyski:SuperPowers123 -p 9000 screen -S demo & | |
#/root/gotty -p 9000 -w screen -S demo #If you want users to interact with your session | |
#/root/ngrok update | |
/root/ngrok http 9000 |
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
import nflgame | |
games = nflgame.games(2014, week=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]) | |
#games = nflgame.games(2015, kind='PRE') | |
players = nflgame.combine_game_stats(games) | |
print "\n Top 10 Rushing TDS \n" | |
for p in players.rushing().sort('rushing_tds').limit(10): | |
msg = '%s %d carries for %d yards and %d TDs' |
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 windows_baseline { | |
# Create directories | |
file { | |
[ | |
'c:\temp', | |
'c:\test', | |
]: | |
ensure => directory, | |
owner => 'Administrator', |
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 | |
# ./webstarterkit.sh project_name | |
# Need Homebrew installed | |
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
if [[ $1 == "" ]]; then | |
echo "Specify project name: $0 project_name" && echo | |
exit 1 | |
fi |
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
PUPPET=/usr/local/bin/puppet | |
LINT=/usr/local/bin/puppet-lint | |
for x in `find . -iname *.pp`; do echo $x ; ${LINT} --no-2sp_soft_tabs-check --no-80chars-check --no-autoloader_layout-check -f $x \ | |
--log-format "%{path}:%{line}:%{check}:%{KIND}:%{message}" ;\ | |
echo "";\ | |
done | |
for x in `find . | grep '.svn\|.git'`; do rm -rf $x ; 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
rm -rf $WORKSPACE/* | |
export GOPATH=$WORKSPACE/ | |
export PATH=$PATH:/usr/local/bin | |
go get github.com/spf13/viper | |
go get github.com/shirou/gopsutil | |
go get github.com/dustin/go-humanize | |
go get github.com/fsouza/go-dockerclient | |
go get github.com/drael/GOnetstat |
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
# If you have an existing go project | |
# cd into src and run below command | |
cd $GOPATH/src && for x in `find github.com | grep '.git/refs/heads/master'`; do echo "`echo $x | awk -F'/.git' '{print $1}'` `cat $x`"; 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 | |
env && echo | |
runlevel && echo | |
hostname -f && echo | |
cat /etc/hosts && 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
import configuration as config | |
from subprocess import call | |
import requests | |
import time, socket | |
''' Turn off SSL errors ''' | |
requests.packages.urllib3.disable_warnings() | |
''' Wait for port 443 is listening ''' | |
while True: |