Skip to content

Instantly share code, notes, and snippets.

View rasmusmerzin's full-sized avatar
🎮

Emil Rasmus Merzin rasmusmerzin

🎮
View GitHub Profile
#!/bin/bash
INDENT=4
USAGE='[q] quit [j/k] move [G] submit [h/l] select [H/L] jump [A] select all'
DESC_HEIGHT=2
err() { echo "error: $*" >&2 && exit 1; }
is_installed() { command -v "$*" >/dev/null; }
#!/bin/sh
mem_min=1
mem_max=$((($(free -m | awk '/^Mem:/{print $2}')-128)/1024))
mem=$(printf "%d" "$1")
if [ "$mem" -lt "$mem_min" ]
then mem=$mem_min
elif [ "$mem" -gt "$mem_max" ]
then mem=$mem_max
fi
network={
# ssid="public_network"
key_mgmt=NONE
}
network={
# ssid="ms_bs_network"
key_mgmt=WPA-EAP
eap=PEAP
phase2="auth=MSCHAPV2"
# identity="username"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="description" content="Website description" />
<title>Website</title>
<link rel="icon" href="./favicon.ico" />
<link rel="manifest" href="./manifest.json" />
<link rel="stylesheet" href="./main.css" />
#!/bin/bash
echo '## Operators'
"$@" help | awk '
BEGIN {
doprint = 0
}
/^\s*$/ {
doprint = 0
}
#[derive(Debug)]
struct Card(bool);
impl Card {
fn isCompatible(&self) -> bool {
self.0
}
}
struct Vsinder {
#!/bin/bash
# inspect codebase for occurances
keyword=$1
shift
eval $(
grep "$keyword" "$@" -n | while read -r line
do
fl=${line%%:*}

Gcloud DNS

  1. Create a VM instance (enable http & https)
    Compute Engine > VM Instances
  2. Configure static IP address
    VPC Network > External IP Addresses
  3. Create a DNS zone (with the domain name)
    Network Services > Cloud DNS
  4. Add a record set
    blank name (and optionally www, api, etc.)
#!/bin/bash
[ -z "$1" ] && {
echo "error: specify file or directory"
exit 1
}
files=$(find "$@" -type f)
exit_code=$?; [ $exit_code -ne 0 ] && exit $exit_code
name_width=20
create function generate_alphanum() returns char as $$
select substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', trunc(random() * 36)::int + 1, 1)
$$ language sql;
create function generate_alpha() returns char as $$
select chr((65 + trunc(random() * 26))::int)
$$ language sql;
create function generate_alphanum_string(len int) returns varchar as $$
select array_to_string(array(