Skip to content

Instantly share code, notes, and snippets.

Avatar

Kamilion kamilion

View GitHub Profile
View 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 Mar 13, 2020
hooky, a really terrible package manager shell.
View hooky.py
#!/usr/bin/python3
__author__="Kamilion@gmail.com"
import simpleeval
import apt
import readline
import os
import atexit
@kamilion
kamilion / reobj.py
Created Feb 15, 2020
ReOBJ, a simple ORM for rethinkdb
View reobj.py
__author__ = 'Kamilion@gmail.com'
########################################################################################################################
## Imports
########################################################################################################################
# We should do logging, right?
import logging
# Flask imports
#from flask import g
@kamilion
kamilion / putty_COM13.log
Last active Nov 26, 2019
pine-pinephone-20191101-plasma.img warmboot log
View putty_COM13.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 Nov 6, 2019
Teensy 4.0 Clockspeed (iMX RT1062)
View 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 / signal.py
Created Aug 17, 2019
Micropython usignal.py for phusion passenger's my_init
View signal.py
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 Dec 31, 2018 — forked from nacx/__init__.py
Pluggable command line tool
View __init__.py
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
View example.customizer.hook.sh
#!/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 Jun 16, 2020
Samba4 AD config
View krb5.conf
[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 Nov 19, 2018
Acquire::http::ProxyAutoDetect "/usr/share/squid-deb-proxy-client/apt-avahi-discover";
View apt-avahi-discover.py
#!/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