Skip to content

Instantly share code, notes, and snippets.

@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;
}

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 / 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");
@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

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 / 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
<?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 / 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
@yelban
yelban / hosts
Created January 8, 2020 06:42 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost