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 / 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 / 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 / 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 / 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 / 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:d8a6ef19e0aa6ab39bdba61156937d88
Created April 5, 2022 04:34
How to setup postgresql in debian 11
How to setup postgresql in debian 11:
1. Install postgresql:
apt install postgresql postgresql-contrib
2. su to postgres account, in order to manipulate the database:
su - postgres
3. Create a user and database named with mydb, set password:
createuser -P mydb
@44670
44670 / netcat_udp.py
Created April 15, 2023 11:33
Netcat-like UDP Tool in Python
#!/usr/bin/env python3
"""
Netcat-like UDP Tool in Python
This Python script provides a simple and lightweight netcat-like UDP tool that allows users to
send and receive data over UDP using IPv4 and IPv6 addresses. It is designed to be easy to use
and versatile, making it suitable for various networking tasks, including testing, debugging,
and learning purposes.
By following the netcat command-line style, this script offers users a familiar interface for