Skip to content

Instantly share code, notes, and snippets.

View lll9p's full-sized avatar

Lilin Lao lll9p

View GitHub Profile
@lll9p
lll9p / create_widgets.rs
Last active December 14, 2022 16:57
Custom widget
pub fn create_widgets_on_window(app: &Application) -> ApplicationWindow {
let container = gtk::Box::new(gtk::Orientation::Vertical, 5);
let shape_widget = shape::Shape::new(); // create custom shape widget.
let class = 0;
let mut shape_data = shapes::Shape::new_polygon(class);
shape_widget.init_shape(shapes::Shape::new_polygon(class));
use shapes::Point;
let path = [
Point::new(209., 393., class),
Point::new(339., 207., class),
@lll9p
lll9p / ENCIDFILE.txt
Created April 28, 2021 01:18
ENCIDFILE
U2FsdGVkX1/62ZxhaU11gpfRb8JPhap66xLDxbiJM42ZtWIVZoWC0edq4auuvA605ZLJCS1OuADi
QuqWQ40vzdQNviGtymbsb1FCdYg84XDSn9JpJ+kTplCGB1R+Pe6on4OPMtBTfVL6iQUin7a0w+UG
ohlx/mmyAnPEXoTL1tp01c9UQqzoFoq6egSE0G7ycLbz4N+xTAbk1qmia41j80OUY/nmSOOvOPL/
+hravoHOktDem03f54L27ZD+UAeopgLAhkd43i3rg3x8qHLaL16N2VIKaVVvF+3a+5p+kPtHZl/m
zvxNM++86nSanl2M3Im2av2T9Xwfu3VMu1vCwFqc3egncHc0DQWF+WYpcLtg6yfoR4zFtLkzCviT
ijlW7YQx+pdptHhTvw4a69VwH2TYO1qWQX48SM/cy82X50fxc0W9k8WoV3N2qvPRgzlmXaR1tkp8
MeVfyrYrEvuxEKhyNM3Vy7eMkGJKHRs4uW4ZH/rCPKqQ0cmmWV8Q+ctCzcW83kWRl+y7N0EKeude
g/ic5fA5QcRYy3xgdnGqHQlRQt24Aqu0s6z+GGJlePgGh6J9XTsJqbjp72W9bfk0hzbQTOz0S+4+
/F5X5/93VHHbeItHTK43cicGZEGJE9HxORr104rK0V76/h/oYksV+gE6uLaJHYMBY3zOt1eAV6Dj
bJM6lsz3vSH+gdwHItyD3W8YNwrEnUQbLa+nsnkdL2DjjpxlCR+4w+LzQTxPlDdILlJjDOmMCtP6
@lll9p
lll9p / Read-only FS on Arch Linux ARM.md
Created February 20, 2020 12:18 — forked from yeokm1/Read-only FS on Arch Linux ARM.md
Set up Arch Linux ARM on Raspberry Pi to boot from and use a read-only file-system

Read-only FS on Arch Linux ARM

Unlike your typical computer where you usually shutdown properly, I cannot rely on this during the use of my Raspberry Pi. If the Raspberry Pi is improperly shutdown too many times, data corruption in the file system leading to unbootable SD card may result. So we should use a read-only file system.

Full instructions and explanations are obtained from this link but you can run these commands directly. I modified some of the instructions for personal convenience.

Login with default username: alarm, password: alarm

#Optionally enable root over SSH. The rest of these instructions assume u are in root.
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_apm821xx is not set
# CONFIG_TARGET_ath25 is not set
# CONFIG_TARGET_ar71xx is not set
### Keybase proof
I hereby claim:
* I am lll9p on github.
* I am lll9p (https://keybase.io/lll9p) on keybase.
* I have a public key ASA6LTpKDZPBytODoiMJX3o-I2UUVYXrrgBq-9UqaEp2hgo
To claim this, I am signing this object:
@lll9p
lll9p / wechatjump.py
Created December 29, 2017 17:21
微信跳一跳
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import os
import subprocess
import time
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import skimage
import pathlib
A = pathlib.Path('./Notebook')
B = pathlib.Path('.')
print(A.absolute().parent==B.absolute())
# True
@lll9p
lll9p / dnsmasq.conf
Created October 26, 2016 08:40
dnsmasq config file for raspberry pi
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
#port=5353
@lll9p
lll9p / hostapd.conf
Created October 26, 2016 08:24
hostapd config file for raspberry pi
##### hostapd configuration file ##############################################
# Empty lines and lines starting with # are ignored
# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for
# management frames with the Host AP driver); wlan0 with many nl80211 drivers
interface=wlan0
# In case of atheros and nl80211 driver interfaces, an additional
# configuration parameter, bridge, may be used to notify hostapd if the
# interface is included in a bridge. This parameter is not used with Host AP
@lll9p
lll9p / .bash
Created October 14, 2016 15:35
Appendix M. Sample .bashrc and .bash_profile Files-http://www.tldp.org/LDP/abs/html/sample-bashrc.html
# =============================================================== #
#
# PERSONAL $HOME/.bashrc FILE for bash-3.0 (or later)
# By Emmanuel Rouat [no-email]
#
# Last modified: Tue Nov 20 22:04:47 CET 2012
# This file is normally read by interactive shells only.
#+ Here is the place to define your aliases, functions and
#+ other interactive features like your prompt.