Skip to content

Instantly share code, notes, and snippets.

View void285's full-sized avatar
🎯
Focusing

Leonarda void285

🎯
Focusing
View GitHub Profile
// By qiushan
// Detail page: https://vps123.top/script-to-delete-table-column-on-hyperpolyglot.html
// License: MIT
// [http://hyperpolyglot.org] is a wonderfull website which provides contrast of programming languages. Sometimes the table contains languages that you don't care about, you can use this script to delete them, just modify the $columnscnt and $delcolumns vars, and run it from the console.
// how many columns does the table have;
var columnscnt = 5;
// which columns do you what to delete;
var delcolumns = [2, 5];
@void285
void285 / linode-speedtest.sh
Last active May 29, 2019 13:28 — forked from cyfdecyf/linode-speedtest.sh
Linode speedtest with 9 facilities (Linode open new datacenter in Toronto in 2019-04)
#!/bin/bash
list="
http://speedtest.newark.linode.com/100MB-newark.bin
http://speedtest.atlanta.linode.com/100MB-atlanta.bin
http://speedtest.dallas.linode.com/100MB-dallas.bin
http://speedtest.fremont.linode.com/100MB-fremont.bin
http://speedtest.toronto1.linode.com/100MB-toronto.bin
http://speedtest.frankfurt.linode.com/100MB-frankfurt.bin
http://speedtest.london.linode.com/100MB-london.bin
@void285
void285 / refresh_cloudflare_cache.py
Created June 8, 2019 05:32
Refresh/Clear cloudflare site cache with your API. This is the python version. See more at https://vps123.top/refresh-cloudflare-site-files-cache.html
#coding: utf-8
import requests
import argparse
import json
# your account email
EMAIL = 'user@example.com'
# your account api, get from the profile page
APIKEY = 'c2547eb745079dac9320b638f5e225cf483cc5cfdda41'
@void285
void285 / concat_bilibili_video.sh
Last active March 2, 2020 08:00
自动合并哔哩哔哩官方客户端下载的flv格式分段视频。直接合并,不重编码。放到可执行目录下后,cd到分段视频所在目录,执行即可。如需要可指定保存文件名。
#! /bin/bash
# ###########
#
# put the file at any executable path, cd to the video path, and do the cmd below:
#
# cmd format: bilibili.sh filename [1]
#
# filename is the output name of the video/audio
# if the optional arg is 1, an audio file will be extractd from the generated video file
@void285
void285 / detect_file_tyle.md
Created April 16, 2020 04:37
file type statistic

file /bin/* | awk -F":" '{print $2}' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//' | sort | uniq -c | sort -k1nr | more

output example from coreelec:

CoreELEC:~ # file /bin/* | awk -F":" '{print $2}' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//' | sort | uniq -c | sort -k1nr | more
    138 ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
    135 symbolic link to busybox
     17 POSIX shell script, ASCII text executable
     11 Bourne-Again shell script, ASCII text executable
      4 ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
@void285
void285 / coreelec_vs_emuelec.md
Created April 16, 2020 04:54
coreelec and emuelec bin / sbin files difference

emuelec bin:

En
OpenBOR
PPSSPPSDL
Skyscraper
advmame
advmame.sh
amiberry
@void285
void285 / get_used_space_of_root.sh
Created April 17, 2020 02:40
Get Used Space Rate of Root
used=$(df | grep "% /$" | awk '{print $5}' | sed 's/%//g')
@void285
void285 / openwrt_process_watchdog.sh
Created April 26, 2020 13:33
restart process if down on openwrt
cnt=`ps | grep "kcptun" | grep -v "grep" | wc -l`
if [ $cnt -eq 0 ];then
/usr/bin/kcptun-client -c /var/etc/kcptun/client.general.json
echo "restart kcptun service at `date`" >> /root/check.log
else
echo "$cnt kcptun service on at `date`"
fi
# add this line to cron with `crontab -e`
# * * * * * /root/openwrt_process_watchdog.sh
@void285
void285 / apache_log_ip_statistic.sh
Created April 30, 2020 02:54
Get a sorted list of user ip from apache log
cat /var/log/apache2/mysite_access.log | awk '{print $1}' | sort | uniq -c | sort -nr
173.245.48.0/20
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
141.101.64.0/18
108.162.192.0/18
190.93.240.0/20
188.114.96.0/20
197.234.240.0/22
198.41.128.0/17