Skip to content

Instantly share code, notes, and snippets.

@ssh60
ssh60 / create_self_extracting_script.sh
Created May 12, 2021 05:31 — forked from jcward/create_self_extracting_script.sh
Quick bash script to create self-extracting .sh files /w Base64 encoded contents (e.g. binary, zip, etc)
#!/bin/bash
#
# create_self_extracting_script.sh <INPUT_FILE> [<OUTPUT_SCRIPT>]
#
# Creates a self-extracting shell script containing INPUT_FILE as Base64-encoded
# bytes. When executed, the script writes INPUT_FILE and restores its permissions.
#
# (c) Jeff Ward, 2017
# MIT License
@ssh60
ssh60 / gist:622098b7f7dcbb15bc71e462aef769a7
Created November 8, 2016 17:03 — forked from jlintz/gist:feb0f2f797179074b223
Logstash log_format for Nginx
log_format logstash_json '{ "@timestamp": "$time_iso8601", '
'"@version": "1", '
'"remote_addr": "$remote_addr", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"upstream_addr": "$upstream_addr", '
'"upstream_status": "$upstream_status", '
'"upstream_response_time": "$upstream_response_time", '
'"status": "$status", '
'"uri": "$uri", '
@ssh60
ssh60 / json-log.conf
Created November 8, 2016 17:02 — forked from josephholsten/json-log.conf
Complete JSON nginx log_format
# json-log.conf - log all useful nginx variables in json formatted log
# for details about these variables, see http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
log_format json-log '{'
# $arg_*
# $args
# $binary_remote_addr
'"body_bytes_sent":"$body_bytes_sent",'
'"bytes_sent":"$bytes_sent",'
'"connection":"$connection",'
# $connection_requests
@ssh60
ssh60 / check_yaml.sh
Created November 8, 2016 16:20
Check YAML syntax with shell and python
#!/bin/sh
set +e
declare -i RESULT=0
if [ -z $1 ] ; then
echo "Usage $0 <directory to check>"
exit 1
fi
@ssh60
ssh60 / centos7_template
Created November 8, 2016 16:19 — forked from eye-scuzzy/centos7_template
CentOS 7.2 VMware vSphere 6 template with guest customization working
## Download latest CentOS 7 x86_64 minimal iso image
## Good readings
# https://labs.vmware.com/vmtj/methodology-for-performance-analysis-of-vmware-vsphere-under-tier-1-applications
# https://labs.vmware.com/vmtj/virtualizing-latency-sensitive-applications-where-does-the-overhead-come-from
## Create typical CentOS VM
# compatible with 'ESXi 6.0 and later'
# set 'Guest OS Family' to 'Linux'
# set 'Guest OS Version' to 'CentOS 4/5/6/7 (64 bit)'