Skip to content

Instantly share code, notes, and snippets.

View genothomas's full-sized avatar
🎯
Focusing

Geno Thomas genothomas

🎯
Focusing
View GitHub Profile
@genothomas
genothomas / Markdium-Shell.bash
Created April 11, 2020 04:29 — forked from cmaster11/Markdium-Shell.bash
Markdium-Script PAM
#!/bin/bash
# We want to trigger the script only when the SSH session starts.
# To be notified also when session closes, you can watch for
# the "close_session" value.
if [[ "$PAM_TYPE" != "open_session" ]]; then
exit 0
fi
read -r -d '' CONTENT <<-EOF || true
@genothomas
genothomas / Markdium-Shell.bash
Created April 11, 2020 04:29 — forked from cmaster11/Markdium-Shell.bash
Markdium-How to get notified whenever someone logs in via SSH?
if [[ -n $SSH_CONNECTION ]] ; then
read -r -d '' CONTENT <<-EOF || true
Now UTC: $(date --utc "+%F %T")
Env:
$(printenv)
EOF
curl -s -X POST "https://hook.notify17.net/api/raw/REPLACE_WITH_YOUR_API_KEY" \
-F title="SSH - User $USER logged in" \
@genothomas
genothomas / bulk_dns_lookup.sh
Created May 30, 2020 07:50
Generates a CSV of DNS lookups from a list of domains
#!/bin/bash
# Bulk DNS Lookup
# Generates a CSV of DNS lookups from a list of domains.
#
# File name/path of domain list:
domain_list='domains.txt' # One FQDN per line in file.
#
# IP address of the nameserver used for lookups:
ns1_ip='1.1.1.1' # Cloudflare
ns2_ip='9.9.9.9' # Quad9
@genothomas
genothomas / ALPM.md
Created June 7, 2020 10:57
How to enable HIPM+DIPM for Event ID 129 – storachi – Reset to device, DeviceRaidPort0, was issued.

Erik August 9, 2014 at 5:07 am

Actually, this is the incorrect setting for your issue! (That setting only affects purely PCI Express devices, such as Graphics Cards) It is actually the "AHCI Link Power Management – HIPM/DIPM" Power Options setting which is changed from HIPM (Balanced) to Active (High Performance). This setting, by default, is HIDDEN inside of the advanced power settings menu. In order to expose it (as well as transition time setting from "Partial" hard disk state to "Slumber" hard disk state; "AHCI Link Power Management – Adaptive"), you must go inside the registry to both:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPowerPowerSettings012ee47-9041-4b5d-9b77-535fba8b1442b2d69d7-a2a1-449c-9680-f91c70521c60 and change the "Attributes" key value from 1 (default; hidden) to 2 (exposed). [This will expose "AHCI Link Power Management – HIPM/DIPM" under Hard Disk power settings] HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPowerPowerSettings012ee47-9041-4b5d-9b77-535fba8b1442dab60367-53fe-4f

@genothomas
genothomas / mysql_backup
Created July 7, 2020 06:46 — forked from timkuijsten/mysql_backup
mysql per database backup without mysql.event warning
#!/bin/sh -
# The important part is not to put the password as an argument to the mysql
# commands, i.e. don't use the -p option. Instead use a .my.cnf file in the home
# dir of the user you are running this script as, i.e. /root/.my.cnf if running
# as root. Make the file readable for the owner only: chmod 400 /root/.my.cnf
# See: http://stackoverflow.com/questions/17829659/securing-backup-credentials-for-mysqldump/17844997#17844997
umask 007
@genothomas
genothomas / tmux.md
Created July 23, 2020 04:46 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@genothomas
genothomas / reclaimWindows10.ps1
Created July 31, 2020 03:45 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <[email protected]>
# Modified by: alirobe <[email protected]> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@genothomas
genothomas / benchmark-commands.md
Created August 23, 2020 12:51 — forked from ueokande/benchmark-commands.md
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@genothomas
genothomas / letsencrypt-jetty.sh
Created August 26, 2020 14:27 — forked from xkr47/letsencrypt-jetty.sh
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore
@genothomas
genothomas / jenkins-slave
Created October 10, 2020 09:06 — forked from bols-blue/jenkins-slave
jenkisn daemon sclipt./etc/init.d/jenkins-slave and /etc/default/jenkins-slave
# defaults for jenkins continuous integration server
JENKINS_ARGS="-jnlpUrl http://test.lnc.jp:8080/computer/wock/slave-agent.jnlp"
# jenkins home location
JENKINS_HOME=/opt/jenkins-slave
# location of the jenkins war file
JENKINS_WAR=$JENKINS_HOME/slave.jar
# pulled in from the init script; makes things easier.
NAME=jenkins