Skip to content

Instantly share code, notes, and snippets.

Avatar

Lance R. Vick lrvick

View GitHub Profile
@lrvick
lrvick / flask_geventwebsocket_example.py
Created Sep 1, 2011
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
View flask_geventwebsocket_example.py
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@lrvick
lrvick / bitcolor.js
Created Mar 18, 2012
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
View bitcolor.js
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@lrvick
lrvick / github-troll.md
Last active Nov 24, 2020
Trolling Github's DMCA repo with their own security flaws.
View github-troll.md
@lrvick
lrvick / get_results.py
Created Jun 22, 2011
Get async celery results from subtasks
View get_results.py
from celery.result import AsyncResult
from celery.execute import send_task
def get_results(queries):
result = send_task('task1',queries)
results = result.get()
#this does not return ids until _after_ all the tasks are complete, for some reason.
while results:
#pop first off queue, this will shorten the list and eventually break out of while
first_id = results.pop(0)
@lrvick
lrvick / propaganda.md
Last active Oct 31, 2020
#! propaganda - External media or resources that have influenced or validated our culture in terms of security, privacy, or digital sovereignty.
View propaganda.md

Movies & Documentaries

  • The Social Dilemma (2020)
  • American Selfie (2020)
  • Snowden (2016)
  • Hackers
  • The Matrix
  • Sneakers

Games

  • Deus Ex
@lrvick
lrvick / results.py
Created Jun 22, 2011 — forked from ask/get_results.py
Get async celery results from nested subtasks as they complete
View results.py
from tasks import task1
def get_results(queries):
query_procs = task1.delay(queries).get().join()
results = []
for query_proc in query_procs:
# while the following iterate() is happening, the other query_procs are ignored.
# ideas on iterating over all of them at once?
for result in query_proc.iterate():
yield result
View diff.txt
--- iso1
+++ iso2
├── isoinfo -l -i {} -R
│ @@ -1,11 +1,11 @@
│ Directory listing of /
│ dr-xr-xr-x 3 0 0 2048 Oct 16 2020 [ 29 02] .
│ -dr-xr-xr-x 2 0 0 2048 Oct 16 2020 [ 29 02] ..
│ +dr-xr-xr-x 3 0 0 2048 Oct 16 2020 [ 29 02] ..
│ dr-xr-xr-x 3 0 0 2048 Oct 16 2020 [ 30 02] boot
View gist:83782b75801c6de6d48bac856c7888ae
--- rc11-a/airgap_x86_64.iso
+++ rc11-b/airgap_x86_64.iso
├── isoinfo -l -i {} -R
│ @@ -1,11 +1,11 @@
│ Directory listing of /
│ dr-xr-xr-x 3 0 0 2048 Oct 14 2020 [ 29 02] .
│ -dr-xr-xr-x 3 0 0 2048 Oct 14 2020 [ 29 02] ..
│ +dr-xr-xr-x 2 0 0 2048 Oct 14 2020 [ 29 02] ..
│ dr-xr-xr-x 3 0 0 2048 Oct 14 2020 [ 30 02] boot
View apv-coral-proprietary-blobs.txt
product/app/QtiTelephonyService/QtiTelephonyService.apk
product/app/datastatusnotification/datastatusnotification.apk
product/app/uceShimService/uceShimService.apk
product/etc/permissions/com.qualcomm.qcrilmsgtunnel.xml
product/etc/permissions/com.qualcomm.qti.imscmservice-V2.0-java.xml
product/etc/permissions/com.qualcomm.qti.imscmservice-V2.1-java.xml
product/etc/permissions/com.qualcomm.qti.imscmservice-V2.2-java.xml
product/etc/permissions/embms.xml
product/etc/permissions/qcrilhook.xml
product/etc/permissions/telephonyservice.xml
You can’t perform that action at this time.