Skip to content

Instantly share code, notes, and snippets.

View davidbarkhuizen's full-sized avatar
🧐

david barkhuizen davidbarkhuizen

🧐
  • .za
View GitHub Profile
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
# run build tool using monodeveloop tool runner, to build solution/projet
$ mdtool build target.sln
# IDE -------------------------------------
(Ctrl + .), (Alt + Enter) = meta code menu
timer infrastructure
-------------------
python pseudo-code
from pytimer import TreeTimer
root_node = TreeTimer(string_log_function, apex_label)
new_node = treeTimer.start('new node label')
...
First, install libbluetooth-dev
$ sudo apt-get install libbluetooth-dev
Then install pybluez
$ sudo apt-get install python-bluez
nodejs cheat sheet
// install express
// http://expressjs.com/en/starter/installing.html
sudo npm install -g express-generator
npm init
npm install express --save
======
sc.exe
======
list services > sc queryex
start service xxx > sc start xxx
stop service xxx > sc stop xxx
uninstall service xxx > sc delete xxx
=========
@davidbarkhuizen
davidbarkhuizen / linux_sheet.md
Last active January 27, 2021 17:24
linux (ubuntu) memo

general linux | bash commands

change default shell to bash for username

$ sudo chsh -s /bin/bash username

multi-line command prompt, e.g.

[path to cwd] user $ ...

# default file storage location
/data/db
# goto end of doc
ctrl + w,v
# goto begin of doc
ctrl + w,y
# save document
ctrl + o
http://stackoverflow.com/questions/14978411/http-post-and-get-using-curl-in-linux
# make post request with json loaded from file post.json
curl -X POST -d @post.json http://example.com/path/to/resource --header "Content-Type:application/json"
# make a get request, accepting all content tyopes
curl -i -H "Accept: *" -H "Content-Type: application/json" -X GET http://hostname/resource