This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 || : |
This file contains hidden or 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 hidden or 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/sh | |
RUNNING="$(docker ps --format "{{ .ID }}" | xargs docker inspect --format "{{ .Image }}" | xargs docker inspect --format "{{ .Id }} {{ .RepoTags }}")" | |
AVAILABLE="$(docker images --format "{{ .ID }} [{{ .Repository }}:{{ .Tag }}]" --no-trunc)" | |
NEEDS_UPDATE=0 | |
echo "${RUNNING}" | while read line; do | |
current_id=$(echo "${line}" | awk '{print $1}') | |
current_tag=$(echo "${line}" | awk '{print $2}') | |
updated_id=$(echo "${AVAILABLE}" | grep -F "${current_tag}" | awk '{print $1}') | |
if [ "$current_id" != "$updated_id" ]; then | |
echo "Update required for ${current_tag}" |
This file contains hidden or 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 hidden or 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 | |
PATH=$PATH:/usr/local/bin/ | |
WORK_DIR=~/.bitbar/pr_status | |
CHANGE_FILE="${WORK_DIR}/changed" | |
LOGGING=0 | |
mkdir -p ${WORK_DIR} | |
function errcho { | |
if [ "${LOGGING}" != "0" ]; then |
NewerOlder