Skip to content

Instantly share code, notes, and snippets.

View spacelatte's full-sized avatar
🤔
0x727E3A21F2

Mert Akengin spacelatte

🤔
0x727E3A21F2
View GitHub Profile
#!/usr/bin/env python3
import os, sys, time, json, socket, threading, hashlib, pickle
from urllib import request
SERVERS = [
"whois.arin.net",
"whois.apnic.net",
"whois.abuse.net",
@spacelatte
spacelatte / react.docker.sh
Last active May 22, 2019 07:54
react docker bash quick start
#!/bin/bash
which docker > /dev/null || {
echo "Docker not found! which is required!"
exit 1
}
test -z "$1" && {
echo "Easy Usage: $0 app-name [port]" 1>&2
docker run --rm -itv "$(pwd):/data" -p 9005:9005 -p ${PORT:-3000}:3000 pvtmert/react
"darkblue
"desert
"evening
"murphy
"slate
"torte
colorscheme slate
set ai
set autoindent
set autoread
@spacelatte
spacelatte / procparse.py
Last active June 6, 2020 15:36
procparse.py: parse linux /proc filesystem and expose as API
#!/usr/bin/env python3
import io, re, os, sys, time, json, socket, threading
def reader(file):
with open("/proc/{}".format(file)) as file:
return file.read().split("\n")
return []
def generic_parser(file):
@spacelatte
spacelatte / s3blogapi.py
Last active May 22, 2019 07:56
an aws s3 storage blog with simple lambda api supports posts and tags
#!/usr/bin/env python3
import os, re, sys, time, uuid, json, pprint, pathlib, collections, boto3
base_path = "basedir"
bucket_id = "yourbucketname"
#if not hasattr(re, "Match"):
# import _sre
# re.Match = _sre.SRE_Match
@spacelatte
spacelatte / tmux.dockerfile
Created May 28, 2019 15:59
i need to update actual static-docker repo but too lazy for that for now
#!/usr/bin/env docker build --compress -t pvtmert/tmux:static -f
FROM debian:stable
ENV CC clang
ENV DIR tmux-repo
ENV REPO https://github.com/tmux/tmux.git
#VOLUME /data
WORKDIR /data
#!/bin/bash
PORT=${PORT:-22}
SOCK=${SOCK:-/tmp/$(hostname).sock}
ps aux \
| grep -v grep \
| grep ssh \
| grep "$@" \
| grep -qi "$SOCK:0:$PORT" \
|| ssh -vNC \
-oCompression=yes \
@spacelatte
spacelatte / nc-ssh-proxy.c
Created June 5, 2019 12:59
using this as ForceCommand or login shell to forward unix sockets as proxycommand
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv) {
// argv[0]: self
// argv[1]: -c, coming from ssh
// argv[2]: actual argument
// argv[N]: ...
@spacelatte
spacelatte / cfssl.json
Created August 31, 2019 17:42
Generated Using: `Array.from(document.querySelectorAll("a[href]")).filter(x => x.href.includes("/R1.2/")).filter(x => x.href.includes("darwin-amd64")).map(x => x.href)`
{
"linux": [
"https://pkg.cfssl.org/R1.2/cfssl-bundle_linux-amd64",
"https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64",
"https://pkg.cfssl.org/R1.2/cfssl-newkey_linux-amd64",
"https://pkg.cfssl.org/R1.2/cfssl-scan_linux-amd64",
"https://pkg.cfssl.org/R1.2/cfssl_linux-amd64",
"https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64",
"https://pkg.cfssl.org/R1.2/mkbundle_linux-amd64",
"https://pkg.cfssl.org/R1.2/multirootca_linux-amd64"
#!/usr/bin/env bash
export USERNAME=airflow
export DBNAME=${USERNAME}
export AIRFLOW_HOME=/data
cd "${AIRFLOW_HOME}"
start() {
echo scheduler webserver | xargs -n1 -P9 -- airflow &