使用此仓库快捷添加配置
git fetch https://github.com/lateautumn233/android_kernel_docker main
git merge -s ours --no-commit --allow-unrelated-histories --squash FETCH_HEAD
// ==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 |
使用此仓库快捷添加配置
git fetch https://github.com/lateautumn233/android_kernel_docker main
git merge -s ours --no-commit --allow-unrelated-histories --squash FETCH_HEAD
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)
# 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. |
package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
) |
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 |
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.
sudo apt install redis-server
# -*- 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') |