Skip to content

Instantly share code, notes, and snippets.

View bettse's full-sized avatar

Eric Betts bettse

View GitHub Profile
@nigelkersten
nigelkersten / SystemConfigurationPythonMac
Created October 18, 2010 22:17
SystemConfig examples with Python on OS X
These links aren't always easy to find.
http://developer.apple.com/library/mac/#documentation/Networking/Reference/SCNetworkConfiguration/Reference/reference.html
http://developer.apple.com/library/mac/#documentation/Networking/Reference/SCPreferences/Reference/reference.html
nigelk$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
@prasincs
prasincs / foscam_docs.md
Last active June 10, 2023 08:54
FOSCAM Documentation

Adapted from http://www.digitalham.co.uk/web/development/embedding-cctv/ipcam-cgi-sdk/

AFAIK, everything is based on the CGI scripts below, there might be ways to get the streams but I believe it's doable without hacking the firmware and stuff. All functions should be accessible via GET and POST methods.

ACL groups:visitor、operator and Administrator.

Upgrade_firmware.cgi and upgrade_htmls.cgi only support post method,others cgi only support get method.

next_url:

@ifels
ifels / golang_pipe_http_response.go
Last active February 1, 2023 19:19
golang pipe the http response
package main
import (
"io"
"net/http"
"os/exec"
)
var (
BUF_LEN = 1024
@swiftgeek
swiftgeek / iButtonRW.ino
Last active April 13, 2025 13:58
RW1990 programmer, with arduino
// Based on https://danman.eu/blog/cloning-ibutton-using-rw1990-and-avr/
// and: http://elimelecsarduinoprojects.blogspot.com/2013/06/read-dallas-ibutton-arduino.html
// By Swift Geek 28-08-2015
// TODO: danger to atmega328! Use OpenCollector logic!
// Used 4.8kΩ Pull-up and 3.1 Vcc for arduino/pull-up
#include <OneWire.h>
OneWire ibutton (8); // I button connected on PIN 2.
@dannysperry
dannysperry / initialize_and_connect_methods
Last active December 10, 2023 09:54
PPPP_Read debugging
read_size = FFI::MemoryPointer.new(:int32, 1)
read_size.write_int32(4)
p2p_buffer_size = 128 * 1024
input_buffer = FFI::MemoryPointer.new(:char, p2p_buffer_size, true)
some_obj = SandBox.new.authenticate read_size, input_buffer, 100000
class SandBox
def authenticate(read_size, input_buffer, timeout=100000)
@blark
blark / gist:e8f125e402f576bdb7e2d7b3428bdba6
Last active January 3, 2023 03:29
HID Preamble Bits
# from http://www.proxmark.org/forum/viewtopic.php?pid=5415#p5415
0000 0010 0000 0000 01xx xxxx xxxx xxxx xxxx xxxx xxxx 26-bit
0000 0010 0000 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx 27-bit
0000 0010 0000 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx 28-bit
0000 0010 0000 001x xxxx xxxx xxxx xxxx xxxx xxxx xxxx 29-bit
0000 0010 0000 01xx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 30-bit
0000 0010 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 31-bit
0000 0010 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 32-bit
0000 0010 001x xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 33-bit
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 3, 2025 08:56
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@akosma
akosma / webkit.swift
Created October 24, 2016 07:55
Small command-line macOS application using Swift
#!/usr/bin/env xcrun swift
// Adapted from
// https://forums.developer.apple.com/thread/5137
// https://joearms.github.io/2016/01/04/fun-with-swift.html
import WebKit
class ApplicationDelegate: NSObject, NSApplicationDelegate {
internal var window: NSWindow
/*
* HID RFID Reader Wiegand Interface for Arduino Uno
* Originally by Daniel Smith, 2012.01.30 -- http://www.pagemac.com/projects/rfid/arduino_wiegand
*
* Updated 2016-11-23 by Jon "ShakataGaNai" Davis.
* See https://obviate.io/?p=7470 for more details & instructions
*/
#define MAX_BITS 100 // max number of bits