Skip to content

Instantly share code, notes, and snippets.

@JJSmithNet
JJSmithNet / e_chef_auto_update_core_rpms.rb
Created September 28, 2017 00:04
Chef Auto Update Core RPMS
### Install Core RPMs that should be safe to automatically
### Only execute if YUM has not been run in a day and the
### RPM is already installed
### Currently only supported on SomeHost
if ::File.mtime('/var/lib/yum/rpmdb-indexes/version') < Time.now - 86400
if node['hostname'] == 'SomeHost'
%w{bash chkconfig dbus dbus-libs dracut glibc glibc-common kmod kmod-libs kpartx krb5-libs libblkid libmount libuuid libssh2 libxml2 nspr nss nss-softokn nss-softokn-freebl nss-sysinit nss-tools nss-util openldap openssl-libs pcre python python-libs systemd systemd-libs systemd-sysv util-linux tzdata}.each do |core|
package core do
action :upgrade
only_if "rpm -q #{core}"
@JJSmithNet
JJSmithNet / TitaniumBackup_Notes.MD
Last active September 22, 2017 02:21
TitaniumBackup Notes
### Generate JSON using Shell Variables
jq -n --arg juser ${USER} '{ user: $juser }'

Simpler

curl --silent "127.0.0.1:9200/_cat/repositories?h=id" | while read W ; do curl --silent "127.0.0.1:9200/_cat/snapshots/${W}?h=id" | while read X ; do curl --silent "127.0.0.1:9200/_snapshot/${W}/${X}?pretty" | jq --raw-output -c --monochrome-output ".snapshots[] | \"\(.indices) \(.state)\"" ; done ; done

Get Status of all Repositories/SnapShots/Indicies

curl --silent "127.0.0.1:9200/_cat/repositories?h=id" | \
while read REPO ; \
 do curl --silent "127.0.0.1:9200/_cat/snapshots/${REPO}?h=id" | \
@JJSmithNet
JJSmithNet / MSTSC_Perfect_Span.PS1
Last active July 31, 2017 15:29
Pretty close to perfect span of RDP window over 2/3 Monitors
# Windows 10
# 1920x1080 * 2 (on Triple Head System)
# Lock the TaskBar: On
# Use small TaskBar buttons: On
# TaskBar location on screen: Top
# Use AeroSnap on remote system and it will fill up
# ..each Screen pretty well because basically each
# ..half of the AeroSnap will fill up that space on
# ..on that Display. I know, confusing to explain.
MSTSC.EXE /SPAN /W:3840 /H:1015 /V:SomeRDPServer
@JJSmithNet
JJSmithNet / extApps.xml
Created July 19, 2017 18:55
MRemoteNG External Tools
<?xml version="1.0" encoding="utf-8"?>
<Apps>
<App DisplayName="OpenSSH" FileName="C:\Program Files\Git\usr\bin\MinTTY.EXE" Arguments="-o daemonize=false --exec &quot;C:\Program Files\Git\usr\bin\ssh.EXE&quot; -p %Port% -l%UserName% %HostName%" WaitForExit="False" TryToIntegrate="True" />
<App DisplayName="NSLookUp" FileName="C:\Windows\System32\CMD.EXE" Arguments=" /C C:\Windows\system32\nslookup.EXE %HOSTNAME% &amp; PAUSE.EXE&quot;" WaitForExit="False" TryToIntegrate="False" />
<App DisplayName="TraceRoute" FileName="C:\Windows\System32\CMD.EXE" Arguments="/C TITLE TraceRoute %HOSTNAME% &amp; COLOR 1E &amp; IF &quot;%HOSTNAME%J&quot;==&quot;J&quot; ( ECHO No HostName Provided &amp; PAUSE ) ELSE ( C:\Windows\System32\TraceRT.EXE %HOSTNAME% &amp; PAUSE )" WaitForExit="False" TryToIntegrate="False" />
<App DisplayName="WinSCP (SCP)" FileName="C:\WinSCP\WinSCP.EXE" Arguments="scp://%UserName%@%HostName%/" WaitForExit="False" TryToIntegrate="False" />
<App DisplayName="WinSCP (SFTP)" FileName

snmpwalk -v1 -cinternal 1.3.6.1.4.1.2435

function Get-SSLSecurityProtocols {
$protopath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols"
& REG.EXE QUERY "$protopath\PCT 1.0\Server" /v Enabled
& REG.EXE QUERY "$protopath\SSL 2.0\Server" /v Enabled
& REG.EXE QUERY "$protopath\SSL 3.0\Server" /v Enabled
& REG.EXE QUERY "$protopath\TLS 1.0\Server" /v Enabled
& REG.EXE QUERY "$protopath\TLS 1.1\Server" /v Enabled
& REG.EXE QUERY "$protopath\TLS 1.1\Server" /v DisabledByDefault
& REG.EXE QUERY "$protopath\TLS 1.2\Server" /v Enabled
& REG.EXE QUERY "$protopath\TLS 1.2\Server" /v DisabledByDefault