Skip to content

Instantly share code, notes, and snippets.

View Senorsen's full-sized avatar
👋
Hello

Sen Zhang Senorsen

👋
Hello
View GitHub Profile
@Acris
Acris / build-shadowsocks-libev-for-asuswrt-merlin.sh
Last active November 7, 2023 08:18
Build shadowsocks-libev for asuswrt-merlin
#!/bin/bash
set -e
# libev version
LIBEV_VER=4.27
# mbedTLS version
MBEDTLS_VER=2.16.2
# libsodium version
@LordShedy
LordShedy / guide.md
Created January 21, 2019 18:30
How to make AirPods work with linux (Debian 4.9.0-8-amd64)

Steps

  1. set "ControllerMode = bredr" in /etc/bluetooth/main.conf

  2. sudo /etc/init.d/bluetooth restart

  3. pair again.

@Mygod
Mygod / export-ble-infos.py
Last active April 22, 2024 17:14
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Copyright 2021 Mygod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@x-magic
x-magic / smstools-eventhandler.sh
Created November 19, 2016 06:33
SMS Server Tools 3 event handler script (mainly used for converting messages to UTF-8 encoding, for example, those messages with CJK characters included)
#!/bin/bash
#
# This script processes events from smsd.
# It mainly will converts SMS encoded with UCS2 encoding to UTF-8 format expected by many other applications.
# To use it, edit your /etc/smsd.conf and add the following line:
#
# eventhandler = /path/to/smstools-eventhandler.sh
#
# When a new message is received in /var/spool/incoming/, message files with following header line will be converted:
#
@nanpuyue
nanpuyue / live_initrd_on_exfat.sh
Last active June 14, 2021 00:44
Generate the initrd for Debian/Deepin/Ubuntu Live that supported boot from iso on an exfat partition, then you can generate the new iso by “ISO Master”. Tested for Deepin 15.3, Debian 8.5 & Ubuntu 16.04.1.
#!/bin/bash
# (c) 2016 nanpuyue <nanpuyue@gmail.com>
# usage:sudo ./live_initrd_on_exfat.sh deepin-15.3-amd64.iso
NAMESERVER="1.2.4.8"
EXFAT_BIN="sbin/mount.exfat"
FILE_LIST="sbin/mount.exfat sbin/mount.exfat-fuse lib/x86_64-linux-gnu/libfuse.so.*"
ISO=$(readlink -f "$1")
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 17, 2024 07:59
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@bsara
bsara / git-ssh-auth-win-setup.md
Last active May 19, 2024 19:14
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@evanwill
evanwill / gitBash_windows.md
Last active May 13, 2024 04:59
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@Senorsen
Senorsen / flash-nexus.sh
Last active August 11, 2016 09:28
Flash Nexus Device (especially approriate for unlocked & rooted devices)
#!/bin/sh
# Author: Senorsen <senorsen.zhang@gmail.com>
# Prerequisites: adb, fastboot, unzip
# Flash Nexus Device (especially approriate for unlocked & rooted devices), which cannot be upgraded with OTA
# First download nexus factory image from:
# https://developers.google.com/android/nexus/images
set -e
FILE="$1"
@parmentf
parmentf / GitCommitEmoji.md
Last active May 18, 2024 12:54
Git Commit message Emoji