Skip to content

Instantly share code, notes, and snippets.

-- Windows WinScp Command line to push files to a server
"C:\WinSCP.exe" /privatekey="C:\privatekey.ppk" /console /command "open scp://getkub@10.12.123.456:22" "put C:\filedowloads\sampletext.sh /tmp/" "exit"
@getkub
getkub / SSOByPasser.ksh
Last active April 4, 2024 18:35
CURL snippet to do commands on SSO (Siteminder etc) protected systems
#!/usr/bin/ksh
#################################################################################
#
# CURL snippet to do commands on SSO (Siteminder etc) protected systems
# This script will set cookies in one server
# Copies the cookie information into another server
# Imports the cookie information to maintain seemless CURL commands
#
#################################################################################
page_name="ABC_Test"
@getkub
getkub / splunkWindowsForwarderInstall
Last active August 29, 2015 14:07
Splunk Windows Forwarder Install Command Line by diaryfolio.com
set installable="E:\installables\splunkforwarder-6.0.5-214064-x64-release.msi"
set dep_server="10.1.2.3:8089"
set installDir="E:\Program Files\SplunkUniversalForwarder"
msiexec.exe /I %installable% AGREETOLICENSE=Yes INSTALLDIR=%installDir% DEPLOYMENT_SERVER=%dep_server% SPLUNKD_PORT=8089 SERVICESTARTTYPE=auto LAUNCHSPLUNK=1 /quiet
@getkub
getkub / Splunk_SavedSearch_Dashboard
Created October 17, 2014 14:27
Splunk Dashboard driven by SavedSearch and SideViewUtils Advanced XML
<view autoCancelInterval="90" isSticky="False" isVisible="true" onunloadCancelJobs="true" template="dashboard.html" >
<label>diaryfolio.com - Technical Blog </label>
<module name="AccountBar" layoutPanel="appHeader" />
<module name="AppBar" layoutPanel="appHeader" />
<module name="SideviewUtils" layoutPanel="appHeader" />
<module name="Message" layoutPanel="messaging">
<param name="filter">*</param>
<param name="maxSize">2</param>
@getkub
getkub / SplunkReloadEndPoints
Created October 17, 2014 15:20
Splunk: Reload Views, Saved Searches etc.. without restarting Splunk
myAPP="diaryfolioApp"
mgmtPort=8089
# Reload Views only
curl -k -u splunk:changeme https://`hostname`:${mgmtPort}/servicesNS/nobody/${myAPP}/data/ui/views/_reload
# Reload SavedSearches only
curl -k -u splunk:changeme https://`hostname`:${mgmtPort}/servicesNS/nobody/${myAPP}/saved/searches/_reload
@getkub
getkub / splunkUserUpdatecURL
Created October 22, 2014 15:38
Splunk Mass User Update
curl -k -u adminUser:adminUserPassword -X POST -d "name=${reqUser}&password=${reqPass}&roles=${reqRole}&realname=${reqName}&email=${reqEmail}" https://${IP_ADDR}:${mgmtPort}/services/authentication/users 2>/dev/null
@getkub
getkub / MSPowershellCommands
Last active October 23, 2015 13:25
Microsoft Commands - Powershell
# Various Move/Copy commands with pipe operators
http://technet.microsoft.com/en-us/library/hh849852.aspx
#Move files
gci -af -rec | move-item -destination C:\Data\xyz\destinationDir
# find alternative
netstat -aon | select-string ":8089" | select-string "LISTENING"
# wmic
@getkub
getkub / List_WebDevelopment_stuff
Last active August 29, 2015 14:09
List of Good Webdevelopment modules
# Web Developers cannot live without "bootstrap", "JQuery"
# But on top of this there are some very good modules
################################################################################
################################################################################
################# T H E M E S #################
################################################################################
# Themes for Bootstrap
http://bootswatch.com
@getkub
getkub / plunkerEmbed
Created November 21, 2014 15:28
Embedding plunker Code
<iframe style="border: 1px solid #999;width: 100%; height: 300px"
src="http://embed.plnkr.co/xlGFOu2WfRGL1zJOtlu9" frameborder="0"
allowfullscreen="allowfullscreen">
Loading plunk...
</iframe>
ldapsearch -h yourserver.com -p 389 -b 'DC=dc,DC=com,DC=mycompany' -D "CN=userid,OU=org_unit,DC=dc,DC=com,DC=mycompany" -w 'xyz!' '(objectclass=*)' '*' | grep ^dn: | more