Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'pony'
require 'text-table'
# We write a file with the following format:
# ip_address,mac_address,accepted,alerted,first_seen_timestamp
email_to_alert = "email"
gmail_username = 'email'
gmail_app_password = 'password'
@ns408
ns408 / amzn.sh
Created July 21, 2019 11:55 — forked from 0x1F602/amzn.sh
perl -e 'use utf8; binmode STDOUT, ":encoding(UTF-8)"; no bytes; my $c = "\x{1F0A1} \x{1F0B1} amazon \x{1F0C1} \x{1F0D1}"; use POSIX; my $L = floor(length($c)/2); my $z = 0; for $x (1..50) { for $y (1..50) { $z = !$z; if ($x == 25 && $y == (25 - $L)) { print "$c"; } if ($x == 25 && $y >= (25 - $L) && $y <= (25 + $L - !(length($c) % 2))) { next; } if ($z) { print "."; } else { print " "; } }; $z = !$z; print "\n"; }'
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
#!/bin/sh
COMMAND=$1
FILENAME=$2
FILESIZE=$3
usage() {
echo "Usage: ./simpleluks.sh command [args ...]"
echo " ./simpleluks.sh create some_name size_in_GB"
echo " ./simpleluks.sh open some_name"
echo " ./simpleluks.sh close some_name"
}
@ns408
ns408 / README.rst
Created October 16, 2018 02:31 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@ns408
ns408 / tmux-cheatsheet.markdown
Created May 2, 2018 04:42 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ns408
ns408 / parse_yaml.sh
Created April 26, 2018 14:51 — forked from pkuczynski/LICENSE
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@ns408
ns408 / gist:9cfd6370aa7d5660ff3be35d646485b6
Created April 23, 2018 16:29 — forked from dustismo/gist:6203329
How to install leveldb on ubuntu
sudo apt-get install libsnappy-dev
wget https://leveldb.googlecode.com/files/leveldb-1.9.0.tar.gz
tar -xzf leveldb-1.9.0.tar.gz
cd leveldb-1.9.0
make
sudo mv libleveldb.* /usr/local/lib
cd include
sudo cp -R leveldb /usr/local/include
@ns408
ns408 / git-commit-author-rewrite.md
Created April 14, 2018 09:37 — forked from trey/git-commit-author-rewrite.md
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <[email protected]>"

or

$ git commit --amend --reset-author
import unicodedata
with open("steam_crash.txt", 'rb') as myfile:
message = myfile.read()
print('Length of message in bytes: ' + str(len(message)))
message = message.decode('utf-8')
print('Number of characters in message: ' + str(len(message)))
'''
USAGE:
Use python3
Place addresses to track, one per line, in addresses.txt
Place assetchains to track, one per line, in assets.txt
Adjust balance_threshold and send_amount as needed
If you need to specify an alternative komodo_cli location, either pass it as the first argument
when invoking the script, or change the komodo_cli variable.
'''