Skip to content

Instantly share code, notes, and snippets.

View markuskreitzer's full-sized avatar

Markus markuskreitzer

View GitHub Profile
@markuskreitzer
markuskreitzer / Vid_Dl.pl
Created May 24, 2012 16:10
Dr. Reeves Video Lecture Series for Random Signals and Systems Extraction Script
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
use LWP::Simple;
use File::Basename;
my $url = "http://www.eng.auburn.edu/~reevesj/Classes/ELEC3800/restricted/modules.html";
my $mech = WWW::Mechanize->new();
@markuskreitzer
markuskreitzer / main.c
Created October 1, 2012 04:55
PWM Code Draft For Lab 4, Session 7
#include <hidef.h> /* common defines and macros */
#include <mc9s12c32.h> /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12c32"
#pragma CODE_SEG DEFAULT
#define PWMDTY0 DUTY_CYCLE // These HCS12 defines are too cryptic!
// ################
// Global Variables
// ################
int duty_perc = 0;
#!/usr/bin/env python
import urllib2
import urllib
from BeautifulSoup import BeautifulSoup, Comment
from pprint import pprint
url = 'http://www.alicehendersonrealty.com/ajax/'
query = {
'type_of_property': 'Rental',
'min_price': 0,
@markuskreitzer
markuskreitzer / get_pebble_order_status.py
Created February 21, 2014 15:46
Get my Pebble order status!
#!/usr/bin/env python
import urllib2
from BeautifulSoup import BeautifulSoup
url = 'https://getpebble.com/orders/XXXXXXXXXXXXXXXXXXXXXXX'
request = urllib2.Request(url)
result = urllib2.urlopen(request)
t = result.read()
bs = BeautifulSoup(t)
print bs.find("span",{"class": "order-status"}).getText()
@markuskreitzer
markuskreitzer / get_pebble.py
Created March 7, 2014 16:13
Get my order status from the pebble website
#!/usr/bin/env python
import urllib2
from BeautifulSoup import BeautifulSoup
order_key = 'xxxxxxxxxxxxxxxxxx'
url = 'https://getpebble.com/orders/' + order_key
request = urllib2.Request(url)
result = urllib2.urlopen(request)
t = result.read()
bs = BeautifulSoup(t)
print bs.find("span",{"class": "order-status"}).getText()
@markuskreitzer
markuskreitzer / C_and_F_primes.py
Created March 20, 2014 15:54
Check to see if corresponding C and F values are prime.
from pyprimes import isprime
'''
Quick little program I came up with. I was driving around Auburn when I
wondered what temperatures could be prime for both F and C.
(C) Markus Kreitzer, 2014
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International License.
@markuskreitzer
markuskreitzer / README.md
Last active August 29, 2015 14:00
Decypt and Encrypt using OpenSSH pivate and public keys

How to encrypt a file using a OpenSSH public key.

Requirements:

  • openssl
  • ssh-keygen
  • sshpub-to-rsa
    • Python with the following libs:
      • pyasn1

Directions

If you haven't already, generate an SSH key using ssh-keygen. Not that you encrypt with the public key (that everyone has) and decrypt with the private key (the secret key only you have).

# coding=utf-8
import urllib2
from bs4 import BeautifulSoup
fortune_500 = 'http://fortune.com/fortune500/2015'
page = urllib2.urlopen(fortune_500)
#page = open('boo.html')
soup = BeautifulSoup(page, 'lxml')
@markuskreitzer
markuskreitzer / distance_matrix.py
Created September 5, 2017 19:52
Prints distance between all points in a 2x2 matrix
#!/usr/bin/env python
import numpy as np
a = np.ones([2,2])
for from_rownum, row in enumerate(a):
for from_colnum, number in enumerate(row):
print "Cell:", from_rownum, from_colnum
for to_rownum, row in enumerate(a):
for to_colnum, number in enumerate(row):
distance = np.sqrt((to_rownum - from_rownum)**2 + (to_colnum - from_colnum)**2)
### Keybase proof
I hereby claim:
* I am elec3647 on github.
* I am lyapunov (https://keybase.io/lyapunov) on keybase.
* I have a public key ASAVeQnnf40XlbNkE_rjZvW99A5Q9WOz1hn4o1WCE5S5nwo
To claim this, I am signing this object: