This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
download_location="/home/wineuser/.wine/drive_c" | |
hlds_bin="${download_location}/Counter-Strike/hlds.exe" | |
function log() { | |
printf >&2 "%s:\t%s\n" "$(date)" "${@}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ -z "${LOGGING_NO_COLORS}" ] && [ -t 1 ] && [ -n "$(tput colors)" ] || LOGGING_NO_COLORS="TRUE" | |
log() { | |
local color=$1;shift | |
local msg="$(date +%T.%3N) ${BASH_SOURCE[2]##*/}[${BASH_LINENO[1]}]: ${@}" | |
local reset="\e[0m" | |
if [ -n "${LOGGING_NO_COLORS}" ]; then | |
color="";reset="" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Recursively traverses all collections and objects/arrays contained within documents replacing every | |
instance of 'find' with 'replace'. | |
mongo <db_name> mongo_search_and_replace.js | |
*/ | |
function escapeRegExp(str) { | |
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ./mitmproxy -U http://doesnt.matter -p 8001 -s mitmproxy_transparent_reverse_proxy.py | |
# | |
# HTTP_PROXY=http://localhost:8001 ./program_to_run | |
# | |
def request(flow): | |
if flow.request.method == "CONNECT": | |
return | |
if flow.live: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# RancherOS docker version updater. | |
# Author: @rajiteh | |
# License: BSD | |
# | |
# How to use: | |
# You need to use a persistent console (tested on ubuntu). | |
# Set up the script to be called at console initalization time. | |
# | |
# Example cloud-config.yml usage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM aquasec/trivy | |
RUN apk add --no-cache docker-cli | |
ADD scan.sh /scan.sh | |
ENTRYPOINT ["sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ZERO = new UnitValue(0, 'px') | |
function appendToDoc(dstDoc, fileRef, isFirstDoc) { | |
const srcDoc = app.open(fileRef, undefined, true); | |
superSelect() | |
superCopy() | |
const dstDocWidth = new UnitValue(dstDoc.width.as('px') < srcDoc.width.as('px') ? srcDoc.width.as('px') : dstDoc.width.as('px'), 'px') | |
const dstDocHeight = new UnitValue(isFirstDoc ? srcDoc.height.as('px') : dstDoc.height.as('px') + srcDoc.height.as('px'), 'px') | |
const pasteTopLeftRightBottom = isFirstDoc ? [ZERO, ZERO, dstDocWidth, dstDocHeight] : [new UnitValue(dstDoc.height.as('px'), 'px'), ZERO, dstDocWidth, dstDocHeight] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was initially generated by Windows Terminal 1.1.2021.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PROMETHEUS_SERVER="http://prometheus-server.example.com" | |
# install prometheus-query from https://github.com/ryotarai/prometheus-query | |
# $ go get -u github.com/ryotarai/prometheus-query | |
while IFS="" read -r -e -d $'\n' -p 'query> ' query; do | |
history -s "$query" | |
prometheus-query -start "1 minute ago" -query "$query" --format tsv | column -t | |
echo "---" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## ./script path1 path2 | |
src=$1 | |
dst=$2 | |
function percentage { | |
jq -n "$(du -s $1 | cut -f1)/$(du -s $2 | cut -f1)*100" | |
} | |
cat last_check || : |
NewerOlder