Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
@aculich
aculich / WCEnumerator.hs
Created July 10, 2011 05:17 — forked from ivant/Makefile
wc using Data.Enumerator
{-# LANGUAGE ScopedTypeVariables, ViewPatterns, OverloadedStrings #-}
import Control.Applicative
import Control.Exception (SomeException)
import Control.Monad (when, mapM)
import Control.Monad.Trans (lift)
import Data.Char (ord)
import Data.Enumerator hiding (map, mapM, length, filter, foldl')
import Data.List (foldl')
import Data.Word (Word8, Word64)
import qualified Data.ByteString as SB
@aculich
aculich / forwarder.py
Created November 28, 2011 07:52
SSHForwarder class for use with the python ssh module: http://pypi.python.org/pypi/ssh
#!/usr/bin/env python
# This code is licensed according to the main package that it depends on:
# http://pypi.python.org/pypi/ssh
# License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
# http://www.gnu.org/licenses/lgpl.html
import sys, os, os.path
import select
import SocketServer
@aculich
aculich / fw-install
Created March 8, 2012 23:56
hello world bash script for fwknop install
#!/bin/bash
echo hello
@aculich
aculich / ssh-controlmaster-side-by-side.log
Last active November 30, 2020 15:25
This is a side-by-side session showing the `ssh -O ctl_cmd` in action; with port `forward`/`cancel` from localhost on the left side, and the output of ssh connected to remotehost on the right side. You may want to view this in raw mode to see it best. See: https://serverfault.com/questions/457295/removing-port-forwardings-programmatically-on-a-c…
localhost$ ssh -v -M -S/tmp/controlmaster-remotehost remotehost
OpenSSH_6.0p1 Debian-3ubuntu1, OpenSSL 1.0.1c 10 May 2012
...
Authenticated to remotehost.lxc ([10.0.3.167]:22).
@aculich
aculich / wikipedia-infoboxes-in-pandas.ipynb
Last active March 21, 2024 04:51
How to extract Wikipedia infoboxes and wikitables using Pandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aculich
aculich / remove-empty-columns.csv
Last active April 5, 2022 16:57
remove-empty-columns
foo bar baz
a 1
b 2
c
4
e 5
# List of all downloaded files from system's Quarantine Manager sqlite db
echo "select LSQuarantineAgentName from LSQuarantineEvent where LSQuarantineAgentName not like 'Google Chrome%';" | sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2
# Set default mail app to GMail through command line without going through Mail.app setup process
defaults write com.apple.LaunchServices.plist LSHandlers -array-add '{LSHandlerRoleAll=com.google.gmailnotifier;LSHandlerURLScheme=mailto;}'
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'