View stream_log_exec.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
#!/bin/bash | |
# This script doesn't work with apt-get update (even with -q). Kill -0 exits immediately. | |
print_empty_lines() { | |
for x in $(seq "$1"); do | |
tput el | |
echo | |
done | |
} |
View yara_test.yar
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
rule Hello { | |
strings: | |
// A string to match -- default is ascii | |
$ascii_string = "hello" | |
condition: | |
// The condition to match | |
$ascii_string | |
} |
View hist.awk
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
#!/usr/bin/awk -f | |
# Original script: https://stackoverflow.com/a/39637429/1637178 | |
# License: https://creativecommons.org/licenses/by-sa/3.0/ | |
# This one works with integers | |
# Example: | |
# $ du -s some_folder/* | awk '{ print $1; }' > sizes | |
# $ ./hist.awk sizes | |
# | |
# Change bin_width, bar_scale_down and %5d accordingly |
View lib_packet_parse.py
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 __future__ import annotations | |
from argparse import ArgumentParser | |
from dataclasses import dataclass | |
from math import ceil, floor | |
from pathlib import Path | |
import re | |
from typing import Callable | |
RLEN = 50 |
View bash_args_parse_example.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
#!/bin/bash | |
usage () { | |
cat<<EOF | |
usage: ... | |
EOF | |
} | |
while [[ "$#" -gt 0 ]]; do | |
case $1 in |
View disable_cursor_blink_list.js
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
// Google Apps Script editor | |
// Based on https://stackoverflow.com/a/62184934/1637178 | |
var sts = document.querySelectorAll('head > style'); | |
var st = sts[sts.length - 1]; | |
var tc = st.textContent; | |
tc = tc + "\n.monaco-editor .cursors-layer .cursor { visibility: visible !important; }"; | |
st.textContent = tc; | |
// ACE editor | |
const addCss = text => { |
View _install_github_release
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 -eou pipefail | |
VERSION="$2" | |
cd /tmp | |
set -x | |
# trap "rm $5" EXIT | |
rm SHA256SUM || true |
View exponential_backoff.js
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
function exponentialBackoff(i, dt) { | |
const f = j => j >= 0 ? Math.exp(j/3)*dt : 0 | |
const ret = f(i)-f(i-1) | |
if(ret < dt) { | |
return dt | |
} else { | |
return ret | |
} | |
} |
View setup_mvn.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
#!/bin/bash | |
# go to ~/.m2 or other folder and run ./setup.sh according to below help | |
if [ -z "$3" ]; then | |
cat <<EOF | |
usage: ./setup.sh <jfrog_username> <jfrog_password> <artifactory_url> | |
example: ./setup.sh my_username my_password https://myjfrogaccount.jfrog.io/artifactory/mymavenrepositroyname | |
EOF | |
exit | |
fi |
View aws-pricing
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 -eo pipefail | |
if [ -z "$1" ]; then | |
cat <<EOF | |
usage: | |
aws-pricing <instance_type> display pricing per availability zone | |
aws-pricing --instance-types [pattern] show all available instance types | |
filtered by optional pattern |
NewerOlder