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 | |
} |
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 | |
} |
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 |
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 |
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 |
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 => { |
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 |
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 | |
} | |
} |
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 |
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