This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Run: python3 check_sub.py path_to.srt | |
Give the following: | |
- error if the first line in file is a number with no spaces around it | |
- error if there are two blank lines between two subtitle chunks | |
- error if sync info matches the standard format, with no spaces at the | |
beginning or end | |
- error if a subtitle chunk has more than three subtitles lines | |
- warning if a subtitle chunk has no subtitle lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
""" | |
This module provides | |
""" | |
from __future__ import unicode_literals | |
import os | |
import sys | |
from multiprocessing import Process, Queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Draft for installing everything needed for a fresh os. | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
# === Install git === | |
sudo apt-get install git -y | |
sudo apt-get install vim -y | |
sudo apt-get install build-essential -y | |
# === Install Sublime Text === |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream local { | |
server localhost:19999; | |
keepalive 64; | |
} | |
upstream some_other { | |
server some_other:19999; | |
keepalive: 64; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place this in /etc/ufw/before.rules | |
*nat | |
-A PREROUTING -p tcp -s 10.10.0.0/24 --dport 7000 -j DNAT --to-destination 10.0.0.3:7000 | |
-A PREROUTING -p tcp -s 10.10.0.0/24 --dport 9160 -j DNAT --to-destination 10.0.0.3:9160 | |
-A PREROUTING -p tcp -s 10.10.0.0/24 --dport 9042 -j DNAT --to-destination 10.0.0.3:9042 | |
COMMIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import socket | |
from struct import unpack | |
import pprint | |
from collections import namedtuple | |
interface = sys.argv[1] | |
raw_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From stackoverflow answer https://stackoverflow.com/a/938800 | |
import os | |
_proc_status = '/proc/%d/status' % os.getpid() | |
_scale = {'kB': 1024.0, 'mB': 1024.0*1024.0, | |
'KB': 1024.0, 'MB': 1024.0*1024.0} | |
def _VmB(VmKey): | |
'''Private. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to get in a terminal: curl -X GET http://is.gd/installzsh_sh > installzsh.sh | |
TARGET_USER=$1 | |
echo "Installing zsh..." | |
sudo apt-get install git curl zsh -y > /dev/null; | |
echo "Installing oh-my-zsh" | |
if [ "$TARGET_USER" != "" ]; then | |
echo "Installing oh-my-zsh for user $TARGET_USER"; | |
export RUNZSH=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Config taken from http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ | |
set-option -g default-shell $SHELL | |
# split panes using | and - | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
du -k --max-depth=1 | sort -nr | awk ' | |
BEGIN { | |
split("KB,MB,GB,TB", Units, ","); | |
} | |
{ | |
u = 1; | |
while ($1 >= 1024) { | |
$1 = $1 / 1024; | |
u += 1 |