Skip to content

Instantly share code, notes, and snippets.

View xiaozhuai's full-sized avatar

Weihang Ding xiaozhuai

  • Shanghai, China
  • 05:51 (UTC +08:00)
View GitHub Profile
@ledudu
ledudu / lebo
Created February 16, 2020 04:13 — forked from loerise/MiTV ADBlock
乐播投屏广告屏蔽
127.0.0.1 sdkauth.hpplay.cn
127.0.0.1 adeng.hpplay.cn
127.0.0.1 ad.hpplay.cn
127.0.0.1 conf.hpplay.cn
127.0.0.1 fix.hpplay.cn
127.0.0.1 adcdn.hpplay.cn
127.0.0.1 sl.hpplay.cn
127.0.0.1 rp.hpplay.cn
@catchdave
catchdave / replace_synology_ssl_certs.sh
Last active April 28, 2024 07:17
CLI script to programmatically replace SSL certs on Synology NAS
#!/bin/bash
#
# *** For DSM v7.x ***
#
# How to use this script:
# 1. Get your 3 PEM files ready to copy over from your local machine/update server (privkey.pem, fullchain.pem, cert.pem)
# and put into a directory (this will be $CERT_DIRECTORY).
# Personally, I use this script (https://gist.github.com/catchdave/3f6f412bbf0f0cec32469fb0c9747295) to automate steps 1 & 4.
# 2. Ensure you have a user setup on synology that has ssh access (and ssh access is setup).
# This user will need to be able to sudo as root (i.e. add this line to sudoers, <USER> is the user you create):
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@sosher
sosher / README.md
Created July 10, 2016 18:38 — forked from agrif/README.md
my current ipxe setup

All of this should go into a directory that is available via HTTP and NFS. In variables.ipxe you can provide the HTTP root and NFS root paths, which are used later. Also there are some variables to set the default iscsi root (without the last part after the colon) and the initiator iqn. These are used to auto-fill the iscsi menu options.

You should tell iPXE to boot bootstrap.ipxe.

The bootstrap process reads a bunch of files and sets a bunch of variables. Of importance, it will read the file macs/XXXXXXX.ipxe

@brcha
brcha / qtyaml.h
Created September 30, 2014 13:09
Qt Yaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*
@denji
denji / swap-commands.txt
Created July 3, 2014 08:24 — forked from dan-palmer/swap-commands.txt
OSX swap disable/enable launchd
# check swap usage
sysctl vm.swapusage
# disable encrypted swap - SNOW LEOPARD
sudo defaults write /Library/Preferences/com.apple.virtualMemory UseEncryptedSwap -boolean no
# disable encrypted swap - LION
sudo defaults write /Library/Preferences/com.apple.virtualMemory DisableEncryptedSwap -boolean yes
# disable swap
@pfreixes
pfreixes / gist:3187511
Created July 27, 2012 11:36
Supervisorctl bash autocomplete
# pfreixes, 2012-07-27
# Add to /etc/bash_completion.d/supervisorctl
_supervisor()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 3, 2024 17:56
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S