Skip to content

Instantly share code, notes, and snippets.

@shangdawei
shangdawei / debian-preseeded-iso.sh
Created August 22, 2022 00:30 — forked from zuzzas/debian-preseeded-iso.sh
Create Debian netinstall iso with preseed file
set -e
set -u
# hat-tips:
# - http://codeghar.wordpress.com/2011/12/14/automated-customized-debian-installation-using-preseed/
# - the gist
# required packages (apt-get install)
# xorriso
@shangdawei
shangdawei / replace-debian-with-arch.txt
Created August 12, 2022 13:17 — forked from m-ou-se/replace-debian-with-arch.txt
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
@shangdawei
shangdawei / etc-network-interfaces
Created July 6, 2022 07:23 — forked from yohangdev/etc-network-interfaces
Proxmox single IP public with bridge/local network (NAT)
# source: https://raymii.org/s/tutorials/Proxmox_VE_One_Public_IP.html
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet static
address 163.172.103.199
netmask 255.255.255.0
@shangdawei
shangdawei / 百度云盘批量转存用户分享
Created February 13, 2020 13:45 — forked from j-iNFINITE/百度云盘批量转存用户分享
百度云盘批量转存用户分享
/**
* 贪灵Gollum for Baiduyun, Ver.3.4.4
* 立即执行函数:百度云盘批量转存用户分享。
*
* 【特点】
* - 可保持或无视原分享者的目录结构。
* - 支持差分转存。
* - 自动分解转存,可突破单次转存总文件数5000的限制。
* - 可在分享主页下,进入某文件夹来转存其下级子文件夹。
* - 支持专辑转存。
@shangdawei
shangdawei / tasker_forward_SMS.js
Created January 13, 2020 17:25 — forked from IcedMango/tasker_forward_SMS.js
How to use tasker forward SMS to telegram
//bot秘钥
var apiKey = "";
//请求链接
var apiUrl = "api.telegram.org";
//会话ID
var chatId = "";
//发件人名称
var senderName = global('SMSRN');
if (senderName.match(/\d*/g)[0].length > 0) {
senderName = "";
if 64 - 64: i11iIiiIii
if 65 - 65: O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
if 73 - 73: II111iiii
if 22 - 22: I1IiiI * Oo0Ooo / OoO0O00 . OoOoOO00 . o0oOOo0O0Ooo / I1ii11iIi11i
import os
if 48 - 48: oO0o / OOooOOo / I11i / Ii1I
if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * Ii1I
if 46 - 46: ooOoO0o * I11i - OoooooooOO
if 30 - 30: o0oOOo0O0Ooo - O0 % o0oOOo0O0Ooo - OoooooooOO * O0 * OoooooooOO
if 60 - 60: iIii1I11I1II1 / i1IIi * oO0o - I1ii11iIi11i + o0oOOo0O0Ooo
import os
import sys
import re
import hashlib
import csv
import time
import locale
import getopt
@shangdawei
shangdawei / gpt_parser.py
Last active March 25, 2024 05:52 — forked from culots/gpt_parser.py
Feed this your GPT.bin, and out it shoots a partition.xml
#!/usr/bin/python
# Author : n0fate
# E-Mail rapfer@gmail.com, n0fate@live.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
@shangdawei
shangdawei / arm_cortex_m3_mutex.c
Created March 18, 2018 14:29 — forked from hdznrrd/arm_cortex_m3_mutex.c
basic implementation of a no-block / no-wait mutex for ARM Cortex M3 and compatible models
// this is a very basic mutex implementation
// its aim is to try to acquire access to a critical section or fail.
// there is no spinlock or event-waiting going on.
// in case it fails to acquire the lock, it simply returns false.
//
//
// relevant read:
//
// Synchronization primitives
// http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABHCIHB.html
static inline void arch_spin_lock(arch_spinlock_t *lock)
{
unsigned long tmp;
__asm__ __volatile__(
1: "1: ldrex %0, [%1]\n"
2: " teq %0, #0\n"
3: WFE("ne")
4: " strexeq %0, %2, [%1]\n"
5: " teqeq %0, #0\n"
6: " bne 1b"