Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# Set the default policies to allow everything while we set up new rules.
# Prevents cutting yourself off when running from remote SSH.
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush any existing rules, leaving just the defaults
iptables -F
@x1a0
x1a0 / csv2sc.py
Created January 21, 2014 23:18
Convert `.csv` to `.sc`
#!/usr/bin/env python
import sys
import string
if len(sys.argv) < 2:
print "Usage: %s infile [outfile] [delimiter_char]" % sys.argv[0]
sys.exit(1)
filename_in = sys.argv[1]
;;;
;;; By Zoid @BatMud
;;;
;;; Set stats
; /x_stats_set <str|dex|con|int|wis|cha|siz> <value>
/def -i x_stats_set=\
/let _name=x_stats_%{1}%;\
/let _prev=$[prgetval(_name)]%;\
/let _diff=$[{2} - {_prev}]%;\
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.glaurung.batMap.gui.search.SearchPanel.searchForRoomsWith(SearchPanel.java:94)
at com.glaurung.batMap.gui.search.SearchPanel.actionPerformed(SearchPanel.java:70)
at javax.swing.JTextField.fireActionPerformed(JTextField.java:508)
at javax.swing.JTextField.postActionEvent(JTextField.java:721)
at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:836)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2929)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
### Keybase proof
I hereby claim:
* I am x1a0 on github.
* I am x1a0 (https://keybase.io/x1a0) on keybase.
* I have a public key whose fingerprint is A1C5 7E23 F214 D0B0 23DD EE5C 7611 A0C8 01E2 2E78
To claim this, I am signing this object:
;; enhance entity name card
/def -F -p100 -mregexp -t'^\| A ([a-z]+) (fire|air|water|earth) entity ([a-z]+) with power .+ \|$' x_rw_entity_card_scan=\
/let size=0%;\
/let adjective=0%;\
/if ({P1} =~ 'titchy') /let size=$[size+1]%;\
/elseif ({P1} =~ 'miniscule') /let size=$[size+2]%;\
/elseif ({P1} =~ 'small') /let size=$[size+3]%;\
/elseif ({P1} =~ 'medium') /let size=$[size+4]%;\
/elseif ({P1} =~ 'large') /let size=$[size+5]%;\
/elseif ({P1} =~ 'huge') /let size=$[size+6]%;\
@x1a0
x1a0 / zerofree.sh
Last active January 18, 2017 16:40
Zero out space on a virtual machine
init 1
for i in `mount | grep sda | grep ext | cut -b 9` ; do mount -o remount,ro /dev/sda$i && zerofree -v /dev/sda$i && mount -o remount,rw /dev/sda$i ; done ;
var runFrom = function(step, lastStep, callback) {
var cb = step >= lastStep ? callback : function() {
runFrom(step + 1, lastStep, callback);
};
this['step' + step].call(this, cb);
};
runFrom(1, 17, function() {
console.log('finally done...');
});
@x1a0
x1a0 / map.tf
Created January 18, 2016 19:38 — forked from michael-donat/map.tf
; TEMP !!!!
/def -t'Nagle porywa cie nurt i niesie na wschod!' oxen_kanaly_event = \
/_map_go exit:e
;------------------------------------------------------------------------
; ... LISTY ... |
;------------------------------------------------------------------------
/set _map_standard_exits=\
n|polnoc|\
s|poludnie|\
@x1a0
x1a0 / pre-commit.sh
Last active December 25, 2015 04:19
Git pre-commit script for checking debug codes
# If there are debug codes, print the offending file names and fail.
FILES_PATTERN='\.scala$'
FORBIDDEN='println'
git diff --cached --name-only | \
grep -E $FILES_PATTERN | \
GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n $FORBIDDEN && echo 'COMMIT REJECTED Found "$FORBIDDEN" references. Please remove them before commiting' && exit 1