Skip to content

Instantly share code, notes, and snippets.

@zeta709
zeta709 / config
Created August 28, 2017 07:12
~/.ssh/config
Host github.com
HostName github.com
User git
IdentityFile /home/user/.ssh/id_rsa_alt
IdentitiesOnly yes
@zeta709
zeta709 / mdserver.zsh
Last active February 2, 2022 14:47
Simple markdown server; pandoc;
mdserver() {
if [ "$#" -ne 1 ]; then
echo "Usage: mdserver file.md"
return
fi
local TMP="$HOME/tmp"
mkdir -p "$TMP" || return
local CSS="markdown_pandoc.css"
if [ ! -r "$TMP/$CSS" ]; then
@zeta709
zeta709 / bookmarks.sh
Last active October 18, 2016 07:12
Bookmark script for bash
#!/bin/bash
# INSTALL: copy this script to ~/bin/some_convenient_name
unset BOOKMARKS
BOOKMARKS=(\
~ \
~/bin \
)
# BOOKMARKS[99]=".."
@zeta709
zeta709 / chroot.md
Last active December 30, 2023 12:20
chroot cheatsheet
  1. Boot a live CD

  2. Mount linux partitions

# mount /dev/sdXX /mnt/linux
# mount /dev/sdYY /mnt/linux/boot
  1. Prepare for chrooting
  2. Mount /proc, /sys, and /dev
@zeta709
zeta709 / config-test.sh
Last active November 14, 2015 19:39
Gentoo related
#!/bin/bash
# genkernel --menuconfig --no-clean all
CONFIGFILE=$1
if [ ! -f "$CONFIGFILE" ]; then
echo "File not exists: $CONFIGFILE"
exit 1;
fi
@zeta709
zeta709 / virtualenv.md
Created November 15, 2014 15:18
Python virtualenv

매번 까먹어서 적어둔다.

공식 문서

https://virtualenv.pypa.io/en/latest/

자주 쓰는 명령

  • 설치: $ [sudo] pip install virtualenv
  • 환경 만들기:
    • $ virtualenv ENV
  • $ cd ENV && virtualenv .
@zeta709
zeta709 / bma_decode.py
Last active November 20, 2022 21:00
Battle.net Authenticator (Android) to TOTP
#!/usr/bin/env python
# Python port of https://gist.github.com/stbuehler/8616943
# Disclaimer
# There is absolutely no guarantee.
#
# Guide
# 0. Install Android SDK and Android Backup Extractor
# 1. Backup Battle.net Authenticator
# adb backup com.blizard.bma -f bma.ab
@zeta709
zeta709 / Fix.md
Last active August 29, 2015 14:07
CVE-2014-3566 (POODLE), OpenSSL CVE-2014-3566 Man In The Middle Information Disclosure Vulnerability

Fix for POODLE attack

Web server

Apache

  1. Edit '/etc/apache2/mods-enabled/ssl.conf'
SSLProtocol all -SSLv2 -SSLv3
  1. Retart Apache
@zeta709
zeta709 / shellshock.sh
Last active August 29, 2015 14:06
CVE-2014-6271 (ShellShock), CVE-2014-7169
# CVE-2014-6271
# * https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/
# * http://seclists.org/oss-sec/2014/q3/649
# * http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271
# * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6271
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
# CVE-2014-7169 (still vulnerable)
# * https://twitter.com/taviso/statuses/514887394294652929
# * http://seclists.org/oss-sec/2014/q3/671