Skip to content

Instantly share code, notes, and snippets.

@reyjrar
reyjrar / elasticsearch.yml
Last active May 12, 2023 11:58
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@ahendrix
ahendrix / gist:7030300
Created October 17, 2013 18:56
bash stacktrace
function errexit() {
local err=$?
set +o xtrace
local code="${1:-1}"
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err"
# Print out the stack trace described by $function_stack
if [ ${#FUNCNAME[@]} -gt 2 ]
then
echo "Call tree:"
for ((i=1;i<${#FUNCNAME[@]}-1;i++))
@ipedrazas
ipedrazas / gist:2c93f6e74737d1f8a791
Created September 18, 2014 22:13
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
7003 gcloud compute instances list
7004 gcloud auth login
8152 gcloud compute instances stop instance-2
8153 gcloud config set project dark-caldron-89709
8154 gcloud components update
8155 gcloud compute instances stop instance-2
8156 gcloud compute instances list
8157 gcloud compute instances start instance-2
8189 gcloud compute forwarding-rules list
8190 gcloud compute networks describe default --format json
@stevenswafford
stevenswafford / google-dorks
Created June 6, 2015 05:57
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@stevenswafford
stevenswafford / webapppentest
Created June 26, 2015 03:46
Web Application Pentest Cheat Sheet
=== http status codes ===================================================
1xx Informational
100 Continue
101 Switching Protocols
102 Processing (WebDAV; RFC 2518)
2xx Success
200 OK
201 Created
@sahilsk
sahilsk / td-agent.conf
Created March 15, 2016 10:00
fluent sample configuration
##########################################
#### input
##########################################
# syslog logging
<source>
type tail
path /var/log/syslog, /var/log/auth.log, /var/log/kern.log
pos_file /tmp/td-agent/pos/syslog
refresh_interval 1
@bom-d-van
bom-d-van / mysql-tcpdump.sh
Last active May 6, 2024 12:43
tcpdump advanced filters
# https://www.percona.com/blog/2008/11/07/poor-mans-query-logging/
tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e '
while(<>) { chomp; next if /^[^ ]+[ ]*$/;
if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) {
if (defined $q) { print "$q\n"; }
$q=$_;
} else {
$_ =~ s/^[ \t]+//; $q.=" $_";
}
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@ageis
ageis / systemd_service_hardening.md
Last active June 20, 2024 02:52
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict