This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, Signal, I2C, ADC, Timer | |
import ssd1306 | |
import time | |
adc = ADC(0) | |
i2c = I2C(-1, Pin(5), Pin(4)) | |
display = ssd1306.SSD1306_I2C(128, 32, i2c) | |
MAX_HISTORY = 250 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = true | |
[alias] | |
gl = log --oneline -n 10 | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
co = checkout | |
upstream-merge = !"git fetch origin -v && git fetch upstream -v && git merge upstream/master && git push" | |
[core] | |
pager = diff-so-fancy | less --tabs=4 -RFX | |
[color "diff-highlight"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import necessary packages | |
import sensor | |
import time | |
import image | |
# import the lcd optionally | |
# to use the LCD, uncomment Lines 9, 24, 33, and 100 | |
# and comment Lines 19 and 20 | |
#import lcd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kernel=u-boot-dtok.bin | |
framebuffer_depth=16 | |
# Prevent the firmware from loading HAT overlays now that we handle pin muxing. | |
# ourselves. See: | |
# https://www.raspberrypi.org/documentation/configuration/device-tree.md#part3.4 | |
dtoverlay= | |
dtparam=i2c_arm=on,i2c_arm_baudrate=400000 | |
dtparam=spi=on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
public class FirebaseAdapter { | |
private FirebaseAuth.AuthStateListener mAuthListener; | |
private FirebaseAuth mAuth; | |
@Inject | |
public FirebaseAdapter() { | |
mAuth = FirebaseAuth.getInstance(); | |
initialiseAuth(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias update='sudo apt update && sudo apt dist-upgrade -y --auto-remove' | |
alias adb_camera='adb shell am start -a android.media.action.IMAGE_CAPTURE' | |
alias adb_launch='adb shell am start -a android.intent.action.MAIN ' | |
alias adb_brightness='adb shell am broadcast -a com.enhancedworld.devicemanager.SET_BRIGHTNESS --ei com.enhancedworld.devicemanager.extra.LEVEL ' | |
alias adb_flash_boot='adb remount; adb sync; adb reboot bootloader; fastboot flash boot $OUT/boot.img; fastboot reboot' | |
alias adb_peripherals='adb shell dumpsys com.google.android.things.pio.IPeripheralManager' | |
alias cat='bat --theme zenburn' | |
alias ping='prettyping --nolegend' | |
alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules" | |
alias grep="grep -n -I --color" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
int maxfd, fd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Default values for blank parameters | |
DEBUG=0 | |
IN_FILE=/etc/some-input-file.conf | |
OUT_FILE=/var/log/some-output-file.log | |
# Option parser, the order doesn't matter | |
while [ $# -gt 0 ]; do | |
case "$1" in |
Ad-free time!, UnoTelly etc. services provide a nice way to unblock regions for Netflix and others using their custom DNS servers.
But I don't want to direct all my DNS traffic to them and I'm too lazy to manually configure all my devices (phones, tablets, media center boxes etc.). So here's how to transparently unblock Netflix for all your devices using the [Asuswrt Merlin][merlin] firmware. It's a custom router firmware which can be used on the Asus RT-N66U router for example.
Enable JFFS partition and SSH login from http://<ROUTER-IP>/Advanced_System_Content.asp