Skip to content

Instantly share code, notes, and snippets.

View mgalgs's full-sized avatar
🍔
pizza

Mitchel Humpherys mgalgs

🍔
pizza
View GitHub Profile
@mgalgs
mgalgs / selectDay.js
Created August 26, 2016 15:25
Tools -> Script Editor, and paste in the following code
var dayNumToName = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
];
@mgalgs
mgalgs / pygame_demo.py
Created July 20, 2016 21:38
pygame demo
import pygame as pg
pg.init()
width = 500
height = 500
screen = pg.display.set_mode((width, height))
# (x, y) coordinates. We'll put it right in the middle.
x = width / 2
y = height / 2
http {
upstream str-backend {
server 10.134.0.251:8000; # web-worker-01
server 10.134.13.53:8000; # web-worker-02
server 10.134.17.101:8000; # web-worker-03
server 10.134.18.224:8000; # web-worker-04
server 10.134.22.195:8000; # web-worker-05
server 10.134.29.85:8000; # web-worker-06
server 10.134.33.133:8000; # web-worker-07
server 10.134.33.183:8000; # web-worker-08
@mgalgs
mgalgs / lsusb
Last active May 21, 2016 17:33
lsusb -v on a dell xps 13 (9350)
can't get debug descriptor: Resource temporarily unavailable
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 9 Hub
bDeviceSubClass 0
bDeviceProtocol 3
@mgalgs
mgalgs / lspci
Last active October 19, 2017 23:32
lspci -v on a dell xps 13 (9350)
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 08)
Subsystem: Dell Device 0704
Flags: bus master, fast devsel, latency 0
Capabilities: [e0] Vendor Specific Information: Len=10 <?>
00:02.0 VGA compatible controller: Intel Corporation Skylake Integrated Graphics (rev 07) (prog-if 00 [VGA controller])
Subsystem: Dell Device 0704
Flags: bus master, fast devsel, latency 0, IRQ 280
Memory at db000000 (64-bit, non-prefetchable) [size=16M]
Memory at 90000000 (64-bit, prefetchable) [size=256M]
#!/usr/bin/env python2
import sys
import string
text = ''
caps = set()
with open(sys.argv[1]) as f:
for line in f:
@mgalgs
mgalgs / .gitignore
Last active August 29, 2015 14:23
itamaraty checker
/itamaraty
@mgalgs
mgalgs / init
Last active August 29, 2015 14:21
minimal busybox init script
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
echo -e "\nBoot took $(cut -d' ' -f1 /proc/uptime) seconds\n"
exec /bin/sh
@mgalgs
mgalgs / init
Last active August 29, 2015 14:21
Bare bones Busybox /init (adapted from http://jootamam.net/howto-initramfs-image.htm)
#!/bin/sh
# Mount things needed by this script
mount -t proc proc /proc
mount -t sysfs sysfs /sys
# Disable kernel messages from popping onto the screen
echo 0 > /proc/sys/kernel/printk
# Clear the screen
[2015-04-28 12:55:28 +0000] [11796] [DEBUG] 3 workers
[2015-04-28 12:55:29 +0000] [11796] [DEBUG] 3 workers
[2015-04-28 12:55:29 +0000] [11807] [DEBUG] GET /bid/openorders/
[2015-04-28 12:55:29 +0000] [11807] [ERROR] Error handling request
Traceback (most recent call last):
File "/home/django/virtualenvs/homestead_django/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle
File "/home/django/virtualenvs/homestead_django/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 171, in handle_request
File "/home/django/virtualenvs/homestead_django/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 206, in __call__
File "/home/django/virtualenvs/homestead_django/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 196, in get_response
File "/home/django/virtualenvs/homestead_django/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 226, in handle_uncaught_exception