Skip to content

Instantly share code, notes, and snippets.

@yelban
yelban / removeNHIICC.sh
Created February 3, 2020 02:19 — forked from wancw/0 - Readme.md
移除 macOS 健保卡元件
launchctl unload /Library/LaunchDaemons/NHIICC.plist
# or "killall macHC"
security remove-trusted-cert -d /Library/StartupItems/NHIICC/cert/NHIServerCert.crt
security delete-certificate -c NHI.Self.Server.Cert
rm -r /Library/StartupItems/NHIICC
rm /Library/LaunchDaemons/NHIICC.plist
rm -r /usr/local/share/NHIICC
rm -r /Users/Shared/share/NHIICC
<?php
class connector {
private $process;
private $pipes;
private $core;
public function __construct($core) {
$this->core = $core;
$cmd = "/opt/tg-bin/telegram-cli --json -k /opt/tg-bin/server.pub --disable-link-preview -I -R -C -N";
@yelban
yelban / README.md
Created April 8, 2020 14:30 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster

Install the required packages

apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev make git -y

Compile

cd /usr/src
git clone --recursive https://github.com/vysheng/tg.git
@yelban
yelban / nginx.conf
Created June 11, 2020 02:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@yelban
yelban / 01.js
Created July 29, 2020 09:48 — forked from vielhuber/01.js
Google Translate API Hacking #knowhow #tools
function Bp(a, b) {
var c = b.split(".");
b = Number(c[0]) || 0;
for (var d = [], e = 0, f = 0; f < a.length; f++) {
var h = a.charCodeAt(f);
128 > h ? d[e++] = h : (2048 > h ? d[e++] = h >> 6 | 192 : (55296 == (h & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ? (h = 65536 + ((h & 1023) << 10) + (a.charCodeAt(++f) & 1023), d[e++] = h >> 18 | 240, d[e++] = h >> 12 & 63 | 128) : d[e++] = h >> 12 | 224, d[e++] = h >> 6 & 63 | 128), d[e++] = h & 63 | 128)
}
a = b;
for (e = 0; e < d.length; e++) a += d[e], a = Ap(a, "+-a^+6");
a = Ap(a, "+-3^+b+-f");

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@yelban
yelban / checkVersion.js
Created October 27, 2020 02:47 — forked from ngoclt/checkVersion.js
Check iOS version with Javascript
checkVersion = function () {
var agent = window.navigator.userAgent,
start = agent.indexOf( ‘OS ‘ );
if( ( agent.indexOf( ‘iPhone’ ) > -1 || agent.indexOf( ‘iPad’ ) > -1 ) && start > -1 ){
return window.Number( agent.substr( start + 3, 3 ).replace( ‘_’, ’.’ ) );
}
return 0;
}
@yelban
yelban / BasicERC20.sol
Created November 2, 2020 01:22 — forked from giladHaimov/BasicERC20.sol
Basic ERC20 implementation
pragma solidity ^0.4.19;
contract ERC20Basic {
string public constant name = "ERC20Basic";
string public constant symbol = "BSC";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
@yelban
yelban / pidCheck.js
Created December 2, 2020 00:36 — forked from twlca/pidCheck.js
檢查身分證字號
/* 依據內政部:
1. 身分證編碼原則
2. 外來人口統一證號編碼原則(居留證) https://www.immigration.gov.tw/ct_cert.asp?xItem=1106801&ctNode=32601&mp=1
身分證及居留證通用
第一碼 縣市編碼原則:
A=10 台北市 J=18 新竹縣 S=26 高雄縣
B=11 台中市 K=19 苗栗縣 T=27 屏東縣
C=12 基隆市 L=20 台中縣 U=28 花蓮縣
D=13 台南市 M=21 南投縣 V=29 台東縣