Skip to content

Instantly share code, notes, and snippets.

@johncylee
johncylee / tmpoverlay.sh
Last active October 13, 2022 08:09
Use RAM as tmp overlay
#!/bin/bash
set -e
# Assuming tmpfs on $TMPDIR / /tmp
function cleanup {
echo
if findmnt -t overlay "$D" &>/dev/null; then
sudo umount -l "$D"
@johncylee
johncylee / mailauth.py
Created September 4, 2015 06:14
Simple Python script to test SMTP, POP3 & IMAP4 auth.
#!/usr/bin/env python
from smtplib import SMTP, SMTP_SSL
from poplib import POP3, POP3_SSL
from imaplib import IMAP4, IMAP4_SSL
import argparse
def smtp(host, user, password):
tests = [SMTP(host), SMTP_SSL(host)]
@johncylee
johncylee / sshproxy.sh
Created January 14, 2013 06:44
usage: sshproxy.sh to remote host and open an incognito chrome window using that host as proxy
#!/bin/sh
remotehost=${1:-0xlab.org}
x-terminal-emulator -e ssh -M -D 8080 $remotehost &
exec google-chrome --incognito --proxy-server="socks5://localhost:8080"