Skip to content

Instantly share code, notes, and snippets.

@lyc8503
lyc8503 / Bilibili共享大会员.user.js
Last active November 17, 2024 19:47
和朋友共享 Bilibili 大会员账号 (主要自用, 不对该脚本提供任何技术支持, 请勿询问我与此脚本有关的任何问题. 仅限和朋友分享账号, 请勿用于商业用途.)
// ==UserScript==
// @name Bilibili VIP
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 不给叔叔送钱
// @author You
// @match *://www.bilibili.com/bangumi/play/*
// @match *://www.bilibili.com/video/*
// @connect api.bilibili.com
// @icon https://www.bilibili.com/favicon.ico
@lateautumn233
lateautumn233 / lxc.md
Last active November 7, 2024 15:46
在安卓上运行Lxc容器

Lxc on Android 📱

1. 编译内核

1.1. 调整内核配置

使用此仓库快捷添加配置

git fetch https://github.com/lateautumn233/android_kernel_docker main
git merge -s ours --no-commit --allow-unrelated-histories --squash FETCH_HEAD
@ppoffice
ppoffice / README.md
Last active October 28, 2024 13:22
A step by step guide to upgrade webview on an old Android Emulator

Tools

  1. emulator (30.3.5) (via Android SDK)
  2. adb (30.0.5) (via Android SDK)
  3. apktool (2.5.0) and Java runtime
  4. zip (3.0)
  5. unzip (6.0)

Make sure you have JAVA_HOME and ANDROID_HOME environment variables correctly set.

@taylorza
taylorza / GO-Fillslice.md
Last active August 8, 2024 04:04
Golang - Fill slice/array with a pattern

Filling an array or slice with a repeated pattern

Looking for an efficient pure GO approach to copy repeating patterns into a slice, for a toy project, I ran a few tests and discovered a neat approach to significantly improve performance. For the toy project, I am using this to fill a background buffer with a specific RGB color pattern, so improving this performance significantly improved my acheivable framerate.

All the test were run with a buffer of 73437 bytes, allocated as follows

var bigSlice = make([]byte, 73437, 73437)

Fill the slice with the value 65 by looping through each element and setting the value

@chenyiping1995
chenyiping1995 / Android_CN.sh
Last active June 21, 2023 08:54
This script snippet attempts to modify a few settings in SettingsProvider (that is normally not accessible to end user) for easier use of stock Android OS.
# Android Debug Bridge (adb) interactive shell should be used to change these settings.
# Since the 'settings' shell command only exists on Android 4.2 or newer versions of Android, even if the SettingsProvider has the key/value pairs, there is no way for legacy OS prior to Android 4.2 to change these with the command specified in this shell snippet.
# See https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/provider/Settings.java for latest SettingsProvider key/value pairs.
# See https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-$(Android_Version_Code)_r$(Android_Version_Revision_Code)/core/java/android/provider/Settings.java for SettingsProvider key/value pairs for a specific version of Android. Android Version Code and Android Version Revision Code could be found at https://android.googlesource.com/platform/frameworks/base/+refs .
# Specifies the device's UTC system clock and date should be set automatically from sources like NITZ, GNSS or NTP.
@magisterquis
magisterquis / domainfront.go
Last active January 11, 2023 14:34
Domain fronting in Go
package main
import (
"crypto/tls"
"fmt"
"log"
"net/http"
"net/http/httputil"
)
@entropiae
entropiae / Install pyenv on Ubuntu 18.04 + fish shell
Last active September 20, 2024 22:12
Install pyenv on Ubuntu 18.04 + Fish shell
Install pyenv on Ubuntu 18.04 + fish shell
- Install the packages required to compile Python
$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- Download pyenv code from github
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
- Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned
$ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish
@imba-tjd
imba-tjd / .Cloud.md
Last active November 19, 2024 04:28
☁️ 一些免费的云资源

  • IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装。PaaS提供语言环境和框架(可以自己选)。SaaS只能使用开发好的软件(卖软件本身,如税务会计、表格文字)。BaaS一般类似于非关系数据库,但各家不通用
  • 云服务的特点:零前期成本&按需付费&弹性(类似于租,可随时多加、退掉;但没有残值)、高可用(放在机房中,不同AZ间水电隔离)

其他人的集合

@cromat
cromat / wsl-redis-start.md
Last active January 8, 2024 21:32
Run redis inside WSL as background service on Windows startup

Step by step guide to run redis-server inside WSL(Windows Subsystem for Linux) on Windows

I have tried to setup redis as starting background task with wsl-autostart, Task Scheduler and with lot vbs scripts including one described here but none of them seemed to work.

In the end I have manually created a simple one that does the job. This script basically starts a hidden Ubuntu Window and starts redis-server inside it.

  1. Install WSL (this is tested with Ubuntu 18.04 version)
  2. Install redis-server inside WSL sudo apt install redis-server
  3. Add sudo permission to your user to execute service command without password
@5S
5S / crypt.py
Created January 31, 2019 17:23
PyCryptodome を利用して AES 形式による暗号化/復号を行うクラス
# -*- coding: utf-8 -*-
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Util import Padding
class AESCipher(object):
def __init__(self, key):
self.key = (hashlib.md5(key.encode('utf-8')).hexdigest()).encode('utf-8')