Skip to content

Instantly share code, notes, and snippets.

View kholia's full-sized avatar
🎯
Focusing

Dhiru Kholia kholia

🎯
Focusing
View GitHub Profile
@kylemcdonald
kylemcdonald / is-it-illegal.txt
Created April 29, 2015 20:43
Google Suggest: Is it legal / illegal to...
is it legal to accelerate fast
is it legal to accept a post dated check
is it legal to access the deep web
is it legal to add a tip to a bill
is it legal to add music to youtube video
is it legal to advertise cigarettes
is it legal to advertise on facebook
is it legal to advertise on your car
is it legal to armor your car
is it legal to arrange music
@samhocevar
samhocevar / gist:00eec26d9e9988d080ac
Last active December 12, 2025 02:49
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@andromedarabbit
andromedarabbit / create-bootable-el-capitan-iso.sh
Last active June 20, 2023 21:41
Create bootable El Capitan ISO
#!/usr/bin/env bash -x
hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/install_app
exitStatus=$?
if [ $exitStatus -ne 0 ]; then
exit $exitStatus
fi
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o "/tmp/El Capitan"
#include "si5351.h"
#include "Wire.h"
Si5351 si5351;
unsigned long long n = 600;
bool set_phase90(unsigned long long frequency)
{
unsigned long long pll_freq = frequency * n;
@spuder
spuder / LICENSE.txt
Last active December 3, 2023 12:07
python script to generate .pdf and .gerber files from a kicad project
MIT License
Copyright (c) [spuder] 2022
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Lekensteyn
Lekensteyn / parse_pbzx.py
Last active September 24, 2024 18:14 — forked from pudquick/parse_pbzx.py
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages
#!/usr/bin/env python
# Extract .cpio file from a pbzx Payload file.
#
# Based on https://gist.github.com/pudquick/ac29c8c19432f2d200d4,
# this version adds a command-line interface, improves efficiency (1 MiB chunks
# instead of a full copy in memory), adds Python 3 compatibility and
# automatically decompresses stuff (some blocks may not be compressed).
#
# Example usage (from Python):
#
@JonathanThorpe
JonathanThorpe / sipiradio.py
Last active October 14, 2024 09:00
Si473x i2c/i2s radio for Rasperrby Pi
#!/usr/bin/python3
import quick2wire.i2c as i2c
import time
import RPi.GPIO as GPIO
import alsaaudio
import threading
import logging
import sys
#Work in progress library for Si473x for Raspberry Pi by Jonathan Thorpe <jt@jonthorpe.net>
@meeuw
meeuw / parse_pbzx.py
Last active July 6, 2017 10:25 — forked from pudquick/parse_pbzx.py
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages.without any third party tools
#!/usr/bin/python
# tar -Oxf /Volumes/install_app/Packages/Essentials.pkg Payload|python pbzx.py|tar t
import subprocess
import struct
import sys
def pbzx():
if sys.stdin.read(4) != "pbzx":
print "Not a pbzx stream"
@tymarbut
tymarbut / README.md
Last active March 3, 2026 09:02
Baofeng (or other radio) data TX/RX for Raspberry Pi

This flow (and associated circuits/hardware) is designed to allow Node-RED to pass messages via radio waves in the same way as it passes messages via MQTT, using commonly-available, inexpensive handheld radios and the Raspberry Pi. The flow has been tested using Baofeng, Wouxun, and Quansheng handheld ham radios. In short, the goal is to allow packet-like transmissions between Node-RED systems over miles, while keeping the hardware costs down (or free for those hams who have surplus Baofengs hanging around). This could be used for a backup to MQTT when the Wifi is unreliable, or simply as a long-distance and network-agnostic message channel.

Prerequisites: Software

First, we need PulseAudio to make and receive sounds with our USB soundcard:

sudo apt-get install pulseaudio -y
@speters
speters / pwl_serstream.py
Last active October 25, 2025 16:36
Simulate serial RS232 data to use as a PWL file for LTspice
#!/usr/bin/python
data = "asdfg"
bps = 115200
num_databits=8
parity = 'n'
num_stopbits = 1
lvl_0 = 3.3
lvl_1 = 0.0