Skip to content

Instantly share code, notes, and snippets.

View csrutil's full-sized avatar

TSAO csrutil

View GitHub Profile
@mcspring
mcspring / Makefile
Created June 26, 2018 07:36
Static build of nginx with custom openssl, pcre and zlib
# Author: Eric Pruitt (http://www.codevat.com)
# License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
# Description: This Makefile is designed to create a statically linked nginx
# binary without any dependencies on the host system's version of glibc.
NGINX_VERSION=1.15.0
OPENSSL_VERSION=1.0.2o
PCRE_VERSION=8.42
ZLIB_VERSION=1.2.11
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active December 2, 2025 15:44
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@honwen
honwen / cross_and_static_compile_shadowsocks-libev.sh
Last active February 28, 2023 22:56 — forked from harv/cross_and_static_compile_shadowsocks-libev.sh
cross & static compile shadowsocks-libev
#!/bin/bash
export http_proxy=http://127.0.0.1:8080
export https_proxy=http://127.0.0.1:8080
export CC=clang
export CXX=clang++
# git init
git config --global user.name 'docker'
@BigNerd95
BigNerd95 / regd_diff.c
Last active March 1, 2023 09:05
Atheros Country Code ART bypass passing a custom Country Name when loading the driver (e.g.: insmod ath cn=AU)
char *user_country_name = ""; // [MOD]
module_param_named(cn, user_country_name, charp, S_IRUGO); // [MOD]
MODULE_PARM_DESC(cn, "Country Name"); // [MOD]
static int __ath_regd_init(struct ath_regulatory *reg)
{
struct country_code_to_enum_rd *country = NULL;
u16 regdmn;
if (!reg)
@npk48
npk48 / ps4无采集卡原生推送bilibili直播
Created July 26, 2017 17:35
ps4无采集卡原生推送bilibili直播
ps4原生支持推送twitch直播 要转发b站 实现思路非常简单
1. 修改路由器劫持流到本地
2. 推送流到b站
第一步可以通过两种方法实现
1. 路由器iptable修改
熟悉dd-wrt或者open-wrt的都很好操作,推送端口为1935, 只要把所有twitch的ip段导向到本地就行了
把1.1.1.109改成你本地的rtmp服务器ip就行(路由器或者pc)
iptables -t nat -A PREROUTING -d 103.53.48.0/23 -p tcp --dport 1935 -j DNAT --to-destination 1.1.1.109:1935
iptables -t nat -A POSTROUTING -j MASQUERADE
require_relative 'boot'
require_relative 'rails_initializable_hack'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Rails5NewDemo
@brannondorsey
brannondorsey / one_liners.md
Last active July 8, 2022 05:07
One Liners

Count the number of unique characters in a file

# https://unix.stackexchange.com/questions/5010/how-can-i-count-the-number-of-different-characters-in-a-file
# works for linux. There is a variation for MacOS in the link ^
sed 's/\(.\)/\1\n/g' text.txt | sort | uniq -c # sort -nr # uncomment this to sort the list by frequency

Replace a string in all instances of files in a directory

@mbenatti
mbenatti / 0-font-awesome-bootstap-phoenix.md
Last active February 2, 2024 14:59
Installing Bootstrap 4 + Font Awesome from NPM in Phoenix Framework using sass
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's using Brunch

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@PSJoshi
PSJoshi / ip-ranges.txt
Created April 6, 2017 12:21
IP ranges for Google, Amazon etc
* CloudFare IP list: https://www.cloudflare.com/ips/
* Google's IP addresses:
nslookup -q=TXT _netblocks.google.com 8.8.8.8
nslookup -q=TXT _netblocks2.google.com 8.8.8.8
nslookup -q=TXT _netblocks3.google.com 8.8.8.8
Each of the above line will display a CIDR block or Google’s IP addresses.
* Amazon IP addresses: https://ip-ranges.amazonaws.com/ip-ranges.json
# wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7.3-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
# rpm -ihv pgdg-redhat96-9.6-3.noarch.rpm
# yum -y install postgresql96-devel postgresql96 postgresql96-contrib
$ gem install pg -- --with-pg-config=/usr/pgsql-9.6/bin/pg_config