Skip to content

Instantly share code, notes, and snippets.

View andrewc12's full-sized avatar

Andrew Innes andrewc12

  • Perth, Australia
View GitHub Profile
#!/bin/sh
# Example frobnication hook script
PREREQ=""
BASE_MODULES="f2fs crc32_generic crc32-pclmul libcrc32c crc32c_generic crc32c-intel"
prereqs()
{
echo "$PREREQ"
#!/bin/sh
MY_DEVICE=my_device
RELAY_CTRL=/sys/class/leds/tp-link:blue:relay/brightness
#send relay status via mqtt
sendstatus(){
#get relay status
STATUS=$(cat $RELAY_CTRL)
#send MQTT status message
case "$STATUS" in
#GOAL: To document how to build a clone of the original firmware using lede 17
#TODO: Clean up descriptions, provide links to the manual pages, remove cruft, automate more
sudo apt-get install subversion g++ zlib1g-dev build-essential git python -y
sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget -y
sudo apt-get install ccache -y
sudo apt-get install quilt -y
vi /etc/rc.button/reset
#!/bin/sh
. /lib/functions.sh
OVERLAY="$( grep ' /overlay ' /proc/mounts )"
case "$ACTION" in
pressed)
[ -z "$OVERLAY" ] && return 0
@andrewc12
andrewc12 / buildenv and quilt_rev10.txt
Created May 10, 2017 23:35
Build firmware for Kankun small k (KK-SP3) EXPERIMENTAL!!!
#GOAL: To document how to build a clone of the original firmware using lede 17
#TODO: Clean up descriptions, provide links to the manual pages, remove cruft, automate more
#BUG: Button doesn't factory restore properly
sudo ve install subversion g++ zlib1g-dev build-essential git python -y
sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget -y
sudo apt-get install ccache -y
sudo apt-get install quilt -y
@andrewc12
andrewc12 / gist:cb1ce8804629a2c6ce10a2b62bc4842a
Last active May 8, 2017 10:20
Preliminary collection of files that need to be touched
arch/mips/ath79/Kconfig
config ATH79_MACH_KK_SP3
bool "KANKUN Small K support"
select SOC_AR933X
select ATH79_DEV_ETH
select ATH79_DEV_GPIO_BUTTONS
select ATH79_DEV_LEDS_GPIO
select ATH79_DEV_M25P80
select ATH79_DEV_USB
@andrewc12
andrewc12 / buupdate.sh
Last active March 15, 2017 02:34
Update BU from source
#!/bin/bash
#update packages
sudo apt-get update
sudo apt-get install -y \
ccache eatmydata \
git build-essential libtool autotools-dev automake pkg-config \
libssl-dev libevent-dev bsdmainutils libboost-all-dev
# try to get the source
try:
import usocket as socket
except:
import socket
import uio
import uos
#based on
#https://github.com/micropython/micropython/blob/master/examples/network/http_server.py
#https://github.com/azmodie/espwebserver/blob/master/main.py