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 ntxop.smem as smem | |
TACOS = (0, 32, smem._STR) | |
FOO = (32, 48, smem._INT) | |
BAR = (48, 65584, smem._PKL) | |
QUUX = (65584, 65600, smem._STR) | |
mm = smem.SmemFile('/mangos', 'r') | |
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
class Effwon: | |
def __init__(self, message): | |
self.msg = message | |
self.split() | |
self.words = self.bodycount() + self.addrcount() | |
self.headerparse() | |
self._stringify_blocks() | |
def split(self): |
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
#!/usr/bin/python3 | |
# Now uses MongoDB | |
import os | |
import pathlib | |
import pprint | |
import json | |
import texttable |
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
#!/usr/bin/python | |
# note that this will no longer work since they changed the API location | |
# and I really don't care enough about this to update the script. Sorry! | |
import httplib | |
import json | |
conn = httplib.HTTPSConnection('www.powerball.com') |
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/bash | |
# The idea is to create the files in the same directory as the source image in a variety of image sizes | |
# as used by this particular template I am using. | |
SIZES="100x100 1132x411 1132x868 150x115 150x150 238x182 337x258 426x327 536x391 536x411 860x662 983x755" | |
for X in $SIZES ; do | |
DIR=`dirname $1` | |
FILE=`basename $1` | |
echo convert $1 -resize "${X}^" -gravity center -crop ${X}+0+0 +repage ${DIR}/scaled_${X}_${FILE} |
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
This is a quick and dirty script to grab the xml status from the Novra 'cmcs' utility, | |
grab the items we care about, add those to an rrd file, and then generate graphs. Not | |
really concerned with much more than the past day, but I made the rrd database large | |
enough to give a decade's worth of data to the 15 minute mark (I think). Since I can | |
never remember how to generate an rrd file, I googled for some little online thing | |
that will help. Take a look at http://rrdwizard.appspot.com/ if you are in the same boat. | |
This entire thing is probably wrong, but it works, so close enough. | |
rrdtool create satellite.rrd --step '60' \ |
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
#!/awips2/python/bin/python | |
# This software is released into the public domain. | |
# If your jurisdiction does not recognize works | |
# released into the public domain, then this work | |
# is freely available to anyone for any reason, | |
# even if the original author finds that use | |
# morally abhorrent. | |
import s300 |
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
# snippet from httpd.conf, borrowed from wordpress .htaccess | |
# because I didn't feel like thinking about rewrite rules | |
<Location "/text"> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^text\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /text.php [L] |
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 struct | |
BLOCK_DIVIDER = 10 | |
LENGTH_OF_BLOCK = 11 | |
MODE_OF_OPERATION = 12 | |
VCP = 14 | |
ELEVATION_CUTS = 15 | |
ELEVATION_01 = 16 | |
ELEVATION_02 = 17 | |
ELEVATION_03 = 18 |