Skip to content

Instantly share code, notes, and snippets.

View kamilion's full-sized avatar

Kamilion kamilion

View GitHub Profile
@kamilion
kamilion / t4clockspeed.ino
Created May 21, 2020 01:48
t4clockspeed.ino
/*
* Clock speed changes
* Lifted from:
* https://forum.pjrc.com/threads/57444-How-to-change-clock-speed-on-Teensy-4-0?p=214257&viewfull=1#post214257
*/
#if defined(__IMXRT1062__)
extern "C" uint32_t set_arm_clock(uint32_t frequency);
#endif
@kamilion
kamilion / hooky.py
Created March 13, 2020 07:04
hooky, a really terrible package manager shell.
#!/usr/bin/python3
__author__="[email protected]"
import simpleeval
import apt
import readline
import os
import atexit
@kamilion
kamilion / reobj.py
Created February 15, 2020 00:22
ReOBJ, a simple ORM for rethinkdb
__author__ = '[email protected]'
########################################################################################################################
## Imports
########################################################################################################################
# We should do logging, right?
import logging
# Flask imports
#from flask import g
@kamilion
kamilion / putty_COM13.log
Last active November 26, 2019 05:24
pine-pinephone-20191101-plasma.img warmboot log
=> mmc info
Device: mmc@1c0f000
Manufacturer ID: 1b
OEM: 534d
Name: BB1QT
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
@kamilion
kamilion / T4Clockspeed.ino
Created November 6, 2019 06:22
Teensy 4.0 Clockspeed (iMX RT1062)
/*
* Clock speed changes
* Lifted from:
* https://forum.pjrc.com/threads/57444-How-to-change-clock-speed-on-Teensy-4-0?p=214257&viewfull=1#post214257
*/
#if defined(__IMXRT1062__)
extern "C" uint32_t set_arm_clock(uint32_t frequency);
#endif
@kamilion
kamilion / signal.py
Created August 17, 2019 02:52
Micropython usignal.py for phusion passenger's my_init
import ffilib
# Full linux signal list:
#Spec - Default Action - Description
#SIG_DFL = 0
#SIG_IGN = 1
#SIGHUP = 1 # P1990 - Terminate - Hangup detected on controlling terminal or death of controlling process
#SIGINT = 2 # P1990 - Terminate - Interrupt from keyboard
#SIGQUIT = 3 # P1990 - Core dump - Quit from keyboard
#SIGILL = 4 # P1990 - Core dump - Illegal Instruction
@kamilion
kamilion / __init__.py
Created December 31, 2018 20:21 — forked from nacx/__init__.py
Pluggable command line tool
import os
# Automatically set the __all__ variable with all
# the available plugins.
plugin_dir = "plugins"
__all__ = []
for filename in os.listdir(plugin_dir):
filename = plugin_dir + "/" + filename
#!/bin/bash
echo "HOOK: Updating package lists..."
apt update
apt list --upgradable
echo "HOOK: Enabling squid-deb-proxy-client for local network..."
apt install squid-deb-proxy-client -y
echo "HOOK: Installing git."
apt-get install -y --no-install-recommends git
@kamilion
kamilion / krb5.conf
Last active June 16, 2020 01:45
Samba4 AD config
[libdefaults]
default_realm = USERS.SLLABS.COM
# The following krb5.conf variables are only for MIT Kerberos.
kdc_timesync = 1
ccache_type = 4
forwardable = true
proxiable = true
# The following encryption type specification will be used by MIT Kerberos
@kamilion
kamilion / apt-avahi-discover.py
Created November 19, 2018 04:06
Acquire::http::ProxyAutoDetect "/usr/share/squid-deb-proxy-client/apt-avahi-discover";
#!/usr/bin/python
#
# use avahi to find a _apt_proxy._tcp provider and return
# a http proxy string suitable for apt
import asyncore
import functools
import os
import socket
import sys