Skip to content

Instantly share code, notes, and snippets.

View 44670's full-sized avatar
🐢
I may be slow to respond.

44670

🐢
I may be slow to respond.
View GitHub Profile
@44670
44670 / designer.html
Created December 24, 2014 12:49
designer
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../code-mirror/code-mirror.html">
<polymer-element name="my-element">
<template>
<style>
@44670
44670 / init.lua
Last active September 7, 2020 20:30
coin
pinCoin = 1
pinLcdCS = 2
pinLcdCLK = 5
pinLcdDAT = 7
PWD='defaultpwd'
--dofile('secrets.lua')
timeLimit = 120
initialSecondsPerCoin = 3600
@44670
44670 / lcd.py
Created April 17, 2017 06:44
lcd
#/usr/bin/python
#
# Written for PyUSB 1.0 (w/libusb 1.0.3)
#
import usb, sys # 1.0 not 0.4
import time
import psutil
@44670
44670 / genpass.py
Last active November 2, 2019 08:06
import getpass
import base64
from hashlib import pbkdf2_hmac
pwd = getpass.getpass()
salt = raw_input('Salt:')
iters = 10000
hmac = pbkdf2_hmac(hash_name='sha256',password=pwd,salt=salt,iterations=iters)
@44670
44670 / debian-buster-arm64-rpi4
Last active May 22, 2021 10:42
debian buster arm64 on raspberry pi 4
# build rootfs on host
debootstrap --arch=arm64 buster rootfs https://mirrors.163.com/debian/
chroot rootfs
apt install apt-transport-https network-manager nano sudo
useradd -m -G video,render,sudo,dialout -s /bin/bash pi
passwd pi
# edit /etc/fstab
/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime,nodiratime 0 1
@44670
44670 / gist:30a742f317b52780c41f3d6e256f218c
Last active August 30, 2023 11:41
Building upstream RISC-V GCC+binutils+newlib: the quick and dirty way
Building upstream RISC-V GCC+binutils+newlib: the quick and dirty way
September 5, 2017
There are a number of available options for building a RISC-V GCC toolchain. You might use the build system from the riscv/riscv-tools repository, or investigate toolchain generators such as crosstool-ng. However in the case of riscv-tools, it’s not always clear how this corresponds to the code in the relevant upstream projects. When investigating a potential bug, you often just want to build the latest upstream code with as little fuss as possible. For distribution purposes you’d probably want to perform a proper multi-stage build, but for a quick test you might find the following recipe useful:
git clone --depth=1 git://gcc.gnu.org/git/gcc.git gcc
git clone --depth=1 git://sourceware.org/git/binutils-gdb.git
git clone --depth=1 git://sourceware.org/git/newlib-cygwin.git
mkdir combined
cd combined
@44670
44670 / index.html
Created August 13, 2020 08:17 — forked from corburn/index.html
Minimal HTML5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
@44670
44670 / election-rebuild behind a proxy.md
Created September 20, 2020 14:10
election-rebuild behind a proxy

edit node_modules\electron-rebuild\src\rebuild.ts:

add following code when initializing rebuildArgs:

rebuildArgs.push('--proxy=http://YOUR_PROXY_SERVER')
@44670
44670 / genpass.py
Created February 18, 2021 02:14
genpass.py
import getpass
import base64
from hashlib import pbkdf2_hmac
pwd = getpass.getpass()
salt = input('Website Name:')
iters = 10000
hmac = pbkdf2_hmac(hash_name='sha256',password=pwd.encode('utf8'),salt=salt.encode('utf8'),iterations=iters)
pwd = base64.b64encode(hmac).decode('utf8')
@44670
44670 / gist:42a1baa1fe770c2a37170ca0ad6f7737
Last active February 4, 2024 06:23
Allwinner D1 Set HDMI Resolution
HDMI_RESOLUTION=5 #720p
cd /sys/kernel/debug/dispdbg
echo disp0 > name; echo switch1 > command; echo 4 $HDMI_RESOLUTION 0 0 0x4 0x101 0 0 0 8 > param; echo 1 > start;