Skip to content

Instantly share code, notes, and snippets.

@karelrooted
karelrooted / YouTube.mitm.sh
Last active January 26, 2026 10:49
add mitm certificate to youtube ipa/apk(tvOS,android tv).
#!/bin/bash
############################################################
# Help #
############################################################
Help() {
# Display Help
echo "add mitm certificate to youtube ipa/apk/ipk(tvOS,android tv,webOS)."
echo "usage: youtube.mitm.sh -i <youtube file path> -c <certificate file path> | [-h]"
echo "options:"
@karelrooted
karelrooted / webos.mitm.sh
Last active December 4, 2025 10:04
LG WebOS install mitm certificate
#!/bin/bash
# this file started out as : https://gist.github.com/stek29/761232c6f7e1ffbc36b98da2a3a0f4d9
# modified to support mitm certificate installation on lg webos tvs
# usage: cd /var/lib/webosbrew/init.d && curl -o ./mitm https://gist.githubusercontent.com/karelrooted/04de96d633933d1a384c25a31507a09f/raw/webos.mitm.sh && chmod +x mitm && ./mitm -c [YOUR_MITM_CERTIFICATE_FILE_PATH]
set -e
############################################################
# Help #
############################################################
Help() {
@karelrooted
karelrooted / mtr_geo.sh
Last active August 31, 2022 09:46
mtr with geo location (use ipinfo.io cli)
#!/bin/bash
mtr -wz4 $1 | awk '{if($3 ~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/) {"ipinfo "$3" -f country_name,region,city,org |grep -v org" | getline result; print $0" "result} else {print $0}}'
@karelrooted
karelrooted / tcpdump_wireshark
Last active February 14, 2017 07:03
tcpdump: Capturing with tcpdump for viewing with Wireshark
D.3. tcpdump: Capturing with tcpdump for viewing with Wireshark
It’s often more useful to capture packets using tcpdump rather than wireshark. For example, you might want to do a remote capture and either don’t have GUI access or don’t have Wireshark installed on the remote machine.
Older versions of tcpdump truncate packets to 68 or 96 bytes. If this is the case, use -s to capture full-sized packets:
$ tcpdump -i <interface> -s 65535 -w <some-file>
You will have to specify the correct interface and the name of a file to save into. In addition, you will have to terminate the capture with ^C when you believe you have captured enough packets.
tcpdump is not part of the Wireshark distribution. You can get it from http://www.tcpdump.org/ or as a standard package in most Linux distributions.
@karelrooted
karelrooted / facebook_testing_method.md
Created February 8, 2017 08:05
手机端Facebook测试方法-Charles+Hosts方案
  1. 以上可用Hosts一般可以维持可用2,3个月,若要自动更新,可以使用 SwitchHosts (https://oldj.github.io/SwitchHosts/ )等类似软件的远程文件功能,并配置定期自动刷新
@karelrooted
karelrooted / svn_relocate.sh
Last active February 8, 2017 08:13
svn relocate script
svn sw --relocate http://192.168.40.218:8080/svn/php.com http://192.168.43.124/svn/php.com
<?php
for($i=0;$i<1024;$i++){
$i = str_pad($i, 4, 0, STR_PAD_LEFT);
$create_table_list[] = "CREATE TABLE `follows_{$i}` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '维持innodb性能的主键,同时用于排序',
`uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关注者UID',
`follow_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '被关注者UID',
`created_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关注时间',
@karelrooted
karelrooted / gopath_not_set.sh
Created January 18, 2017 06:37
gopath not set
apt install golang-go
Just add the following lines to ~/.bashrc and this will persist. However, you can use other paths you like as GOPATH instead of $HOME/go in my sample.
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
go get github.com/shadowsocks/shadowsocks-go/cmd/shadowsocks-server
@karelrooted
karelrooted / fstab
Last active January 18, 2017 06:33
fstab
liumiuyong@skynas:/$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/ubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
@karelrooted
karelrooted / multi_execute.php
Created January 18, 2017 06:29
php并发执行命令
<?php
for($i=230;$i>=131;$i--){
exec('php /www/php.com/admin_html/redeal_screen_name_search.php ' . $i . ' > /dev/null 2>&1 &');
//exec('bash -c "exec nohup setsid php /www/php.com/admin_html/refetch_avatar.php '.$i.' > /dev/null 2>&1 &"');
}
exit();