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
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
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
#!/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
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
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
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
class run_noop ( | |
$git_dir = '/opt/my_puppet_module', | |
) { | |
# Install git puppet repo into git directory | |
vcsrepo { $git_dir: | |
ensure => latest, | |
provider => git, | |
source => 'https://github.com/user/my_puppet_module.git', | |
revision => 'master', |
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 yum_nginx_api ( | |
$git_ver = 'latest', | |
$git_dir = '/opt/yum-nginx-api', | |
) { | |
# Install git client | |
package { 'git': | |
ensure => $git_ver, | |
} |
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 | |
PATH="/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/opt/puppet/bin:$PATH" | |
declare -x PE_CERT=$(puppet agent --configprint hostcert) | |
declare -x PE_KEY=$(puppet agent --configprint hostprivkey) | |
declare -x PE_CA=$(puppet agent --configprint localcacert) | |
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure" |