Skip to content

Instantly share code, notes, and snippets.

View oogali's full-sized avatar

Omachonu Ogali oogali

  • Ordinary Stack
  • Princeton, NJ
  • 09:13 (UTC -04:00)
View GitHub Profile
@oogali
oogali / quick-example.py
Created January 25, 2014 07:03
A basic attempt at using the newspaper module
#!/usr/bin/env python
import sys
import logging
import newspaper
def main(argv=None):
if argv is None:
argv = sys.argv
@oogali
oogali / config-example.py
Last active January 4, 2016 09:29
Easy peasy configurations
import os
import sys
import logging
import ConfigParser
def main(argv=None):
if argv is None:
argv = sys.argv
logging.basicConfig(format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', level=logging.DEBUG)
@oogali
oogali / bane-of-my-kickstart-existance.txt
Created January 12, 2014 18:55
damn selinux! install hangs here for almost a minute (or two) as it reindexes, crunches policies, or some other thing as it increases in memory usage...during install
┌─────────────────────┤ Package Installation ├──────────────────────┐
│ │
│ │
│ 91% │
│ │
│ Packages completed: 218 of 251 │
│ │
│ Installing selinux-policy-targeted-3.7.19-231.el6.noarch (3 MB) │
│ SELinux targeted base policy │
│ │
@oogali
oogali / dotfiles-setup.sh
Created December 17, 2013 18:27
dotfiles magic
#!/bin/sh
set -e
setup_pathogen() {
mkdir -p ${HOME}/.vim/autoload ${HOME}/.vim/bundle
curl -Sso ${HOME}/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
}
setup_mutt() {
@oogali
oogali / adjust-qf-seq.py
Created December 6, 2013 00:46
QuickFIX Sequence Number Sillyness
#!/usr/bin/env python2.7
import os
import sys
import argparse
def write_seqnum(file, innum, outnum):
try:
fp = open(file, "w")
fp.write("%010d : %010d" % (int(innum), int(outnum)))
@oogali
oogali / README.md
Created November 28, 2013 18:00
Python CLI interface for MTA-Metro North Train Time
@oogali
oogali / starter.py
Last active November 9, 2016 09:57
A template for your Python program, per a blog post from GvR
#!/usr/bin/env python
import sys
def main(argv=None):
if argv is None:
argv = sys.argv
return 0
@oogali
oogali / root-disk-selection.ks
Created November 24, 2013 17:04
Kickstart snippet to avoid installing on wrong hard drive (or wiping your USB stick)
%pre
MIN_SIZE=100
MAX_SIZE=600
rootdisk=
for dev in sd vd xvd ; do
for drive in a b c d ; do
bdev="/sys/block/${dev}${drive}"
if [ -z "${rootdisk}" ]; then
if [ -d "${bdev}" ] && [ "$(cat ${bdev}/removable)" == "0" ]; then
@oogali
oogali / sanitize.js
Created October 30, 2013 19:21
chrome://browser/content/sanitize.js
//@line 5 "/builds/slave/rel-m-rel-osx64_bld-0000000000/build/browser/base/content/sanitize.js"
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/commonjs/sdk/core/promise.js");
@oogali
oogali / vz-bridge-is-falling.txt
Created October 4, 2013 16:09
Verizon Industry Letter: Copper Retirement Donora, PA
The Pennsylvania Department of Transportation (PennDOT) has notified
Verizon that in May 2014 it intends to demolish the Donora-Webster
Bridge due to safety concerns.
The bridge has been closed to traffic since 2009 and PennDOT has
informed Verizon that it does not intend to preserve or maintain
this structure any longer.
PennDOT has directed Verizon pursuant to its permit regulations to
remove its facilities that span the bridge by March of 2014.