This file contains hidden or 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 | |
| # bash < <(curl -s https://gist.githubusercontent.com/Jakis/edb8e65f0dc295c71535/raw/8c80ae83cd41ce5be7af92fa96c2569813ecc612/soloist.sh ) | |
| # Running the script if you have downloaded it: | |
| # ./3rq96e.sh | |
| # | |
| testcli() { | |
| res=$( xcode-select -h &>/dev/null ) | |
| local status=$? | |
| if [ $status -ne 0 ] |
This file contains hidden or 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
| # Short example that's easy to paste. The original author has a more complete implementation that also tests udp: | |
| # http://www.travisgan.com/2014/03/use-powershell-to-test-port.html | |
| $RemoteServer = "192.168.1.20" | |
| $Port = "8090" | |
| $test = New-Object System.Net.Sockets.TcpClient; | |
| Try { | |
| Write-Host "Connecting to "$RemoteServer":"$Port" (TCP).."; | |
| $test.Connect($RemoteServer, $Port); | |
| Write-Host "Connection successful"; } | |
| Catch { Write-Host "Connection failed"; } |
This file contains hidden or 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
| function SetACL() | |
| { | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [string] $Path, | |
| [Parameter(Mandatory=$true)] | |
| [string] $Usertoadd | |
| ) | |
| $Acl = (Get-Item $Path).GetAccessControl('Access') |
This file contains hidden or 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
| for ((i=1;i<=$#;i++)); | |
| do | |
| if [ ${!i} = "-s" ] | |
| then ((i++)) | |
| dashs=${!i}; | |
| elif [ ${!i} = "-log" ]; | |
| then ((i++)) | |
| dashlog=${!i}; |
This file contains hidden or 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
| TARGET=".DS_Store" | |
| #Find all instances of $TARGET and 'git rm' them to remove from the git index. | |
| find . -name "${TARGET}" -print0 | xargs -0 git rm -f --ignore-unmatch | |
| #Check for the presence of .gitignore. If it exists, verify that it contains the value for $TARGET. | |
| #If it doesn't exist, create it, and add the value from $TARGET | |
| if [ ! -f "./.gitignore" ] | |
| then |
This file contains hidden or 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
| $ErrorActionPreference = "Stop" | |
| #Variables unique to this install: | |
| $appname = "Chef Client for windows" | |
| #$installurl = 'http://www.opscode.com/chef/install.msi' | |
| #$installfile = 'install.msi' | |
| $installurl = "https://opscode-omnibus-packages.s3.amazonaws.com/windows/2008r2/x86_64/chef-windows-11.16.4-1.windows.msi" | |
| $installfile = "chef-windows-11.16.4-1.windows.msi" | |
| #old $options = '/passive /norestart' |
This file contains hidden or 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
| function global:Expand-ZIPFile($file, $destination) { | |
| $shell = new-object -com shell.application | |
| $zip = $shell.NameSpace($file) | |
| foreach($item in $zip.items()) { | |
| $shell.Namespace($destination).copyhere($item) | |
| } | |
| } | |
| Expand-ZipFile -file "c:\temp.zip" -destination "c:\temp\" | |
This file contains hidden or 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
| $ErrorActionPreference = "Stop" | |
| #Variables unique to this install: | |
| $appname = "Git for Windows v1.9.4" | |
| $installurl = "https://github.com/msysgit/msysgit/releases/download/Git-1.9.4-preview20140611/Git-1.9.4-preview20140611.exe" | |
| $installfile = "Git-1.9.4-preview20140611.exe" | |
| $switches = "/silent /norestart" | |
| $pathtoadd = "C:\Program Files (x86)\Git\bin" |
This file contains hidden or 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
| URL='http://www.splunk.com/page/download_track?file=6.1.1/universalforwarder/linux/splunkforwarder-6.1.1-207789-linux-2.6-x86_64.rpm&ac=ga0508_s_splunk&wget=true&name=wget&platform=Linux&architecture=x86_64&version=6.1.1&product=splunk&typed=release' | |
| SPLUNKBINARY='splunkforwarder-6.1.1-207789-linux-2.6-x86_64.rpm' | |
| declare -a servers=('node01' 'node02' 'node03' 'node04' 'node05' 'node06') | |
| for i in "${servers[@]}"; do echo ----- "${i}" -----; sudo ssh "${i}" 'wget -O /tmp/"${SPLUNKBINARY}" "${URL}" && \ | |
| yum install -y /tmp/"${SPLUNKBINARY}" && \ | |
| SPLUNK="/opt/splunkforwarder/bin/splunk" && \ | |
| "${SPLUNK}" start --accept-license --answer-yes --no-prompt && \ | |
| "${SPLUNK}" restart && \ | |
| "${SPLUNK}" version';done |
This file contains hidden or 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
| USER="user" | |
| PASS="pass" | |
| #Using the splunk binary to restart | |
| SPLUNK="/opt/splunkforwarder/bin/splunk" | |
| $SPLUNK list forward-server -auth "${USER}":"${PASS}" | |
| $SPLUNK list deploy-poll -auth "${USER}":"${PASS}" | |
| $SPLUNK restart -auth "${USER}":"${PASS}" |
NewerOlder