Skip to content

Instantly share code, notes, and snippets.

View Algogator's full-sized avatar
💭
I may be slow to respond.

Algogator

💭
I may be slow to respond.
View GitHub Profile
@Algogator
Algogator / starthacky
Created July 24, 2014 11:18
Start Hackystat script
xterm -hold -e java -Xmx512M -jar /home/anna/hackystatserver/hackystat-8.4.127-services-bin/hackystat-sensorbase-uh/sensorbase.jar &
xterm -hold -e java -Xmx512M -jar /home/anna/hackystatserver/hackystat-8.4.127-services-bin/hackystat-analysis-dailyprojectdata/dailyprojectdata.jar &
xterm -hold -e java -Xmx512M -jar /home/anna/hackystatserver/hackystat-8.4.127-services-bin/hackystat-analysis-telemetry/telemetry.jar &
xterm -hold -e java -Xmx512M -jar /home/anna/hackystatserver/hackystat-8.4.127-services-bin/hackystat-ui-wicket/projectbrowser.jar &
@Algogator
Algogator / ip.txt
Created September 26, 2015 14:39
Send IP to Dad
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' | mail -s "IP Address" anna.cs.au@gmail.com
#!/bin/bash
#http://askubuntu.com/questions/16143/is-there-a-way-to-start-a-bash-script-after-boot-only-when-wlan0-is-connected
while true
do
nmcli -t -f DEVICE,STATE dev | grep -q "^wlan0:connected$"
if [ $? -eq 0 ]; then
break
else
sleep 60
fi
@Algogator
Algogator / ruby.rb
Last active October 5, 2015 02:03
Ruby Cheat Sheet
#ActiveRecord::Base
module ActiveRecord
class Base
end
end
module Math
PI = 3.141 # ...
end
@Algogator
Algogator / image_scraper.py
Last active April 14, 2017 12:13
Multi Threaded image scraper
import json
import concurrent.futures
import requests
from PIL import Image
from io import BytesIO
import mimetypes
from urllib.parse import urlparse
from os.path import splitext
with open("res.json") as f:
git rm -r --cached
git push origin +dd61ab32^:master
git reset HEAD^ --hard
git push origin -f
git reset HEAD^
vagrant@ubuntu-xenial:~$ nosetests pysal/
...................................................................................................................................................EEEE........................................E........................SS.SSSSSSS...........................SSSSSS.................................................................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.......................................S....../home/vagrant/pysal/pysal/weights/weights.py:189: UserWarning: There are 3 disconnected observations
warnings.warn("There are %d disconnected observations" % ni)
/home/vagrant/pysal/pysal/weights/weights.py:190: UserWarning: Island ids: 6, 8, 11
warnings.warn("Island ids: %s" % ', '.join(str(island) for island in self.islands))
........./home/vagrant/pysal/pysal/core/IOHandlers/gwt.py:148: RuntimeWarning: DBF relating to GWT was not found, proceeding with unordered string ids.
warn("DBF relating to GWT was not found, proceeding with unordered string i
Authentication (OpenID Connect) with Ipsilon:
Authorization code flow
1. Get client ID
- Register fedora happiness packets with Ipsilon (file an infrastructure ticket)
- Register scopes: Name and email (file an infrastructure ticket)
- Dynamic client registration https://github.com/puiterwijk/oidc-register (I don't think dynamic client registration is supported right now)
2. POST to authorization endpoint (https://id.fedoraproject.org/openidc/Authorization)
When you use screen you need to detach with CTRL+A+D before you exit ssh.
screen -dm [session name] [commands]
resume later using screen -x
C-a [ scroll mode
=======================
fuser 8080/tcp
https://127.0.0.1:8443/oidc/callback/?state=7TTjurj4Tha5RPxmLljB761aXqxqb080&code=fc43fb13-a3d7-4424-b355-d46995ecc31b_m9PCdr5ku2fETztToq4CwlE7p3YCGusp
JWT Nonce verification failed.
Request Method: GET
Request URL: https://127.0.0.1:8443/oidc/callback/?state=d0rXx9DPdJS6QeL27GrHAGB9u0bpBM1w&code=7c8f5d09-c29a-4897-97e1-8ca507d7f903_AB4TYxuZbXNozQuUIX-cGSqmNe8JeG6c
Django Version: 1.11.5
Exception Type: SuspiciousOperation
Exception Value: