Skip to content

Instantly share code, notes, and snippets.

View gist:bf3e5489763e58f00a0009a61c6e2db1
Normal: (reponse 204)
$ wget http://connectivitycheck.gstatic.com/generate_204
--2020-06-17 00:58:49-- http://connectivitycheck.gstatic.com/generate_204
Resolving connectivitycheck.gstatic.com (connectivitycheck.gstatic.com)... 172.217.24.3, 2404:6800:4008:800::2003
Connecting to connectivitycheck.gstatic.com (connectivitycheck.gstatic.com)|172.217.24.3|:80... connected.
HTTP request sent, awaiting response... 204 No Content
2020-06-17 00:58:49 (0.00 B/s) - ‘generate_204.1’ saved [0]
KBRO hijack: (reponse 302 redirect to http://192.168.81.72/redirect/R3_CHC.php)
$ wget http://connectivitycheck.gstatic.com/generate_204
View iface_restart
#!/bin/sh
filename=${0##*/}
usage()
{
cat<<EOF
Usage:
$filename <iface>
EOF
View xinmedia_bike.ics
BEGIN:VCALENDAR
PRODID:-//Xinmedia Inc//xinmedia_bike_ical//TW
VERSION:2.0
METHOD:PUBLISH
TZID:Asia/Taipei
COMMENT:2020-03-1601:26:47
BEGIN:VEVENT
SUMMARY:2020第11屆順風四馬200K騎福[尚未公布]
DTSTART;VALUE=DATE:20201226
DTEND;VALUE=DATE:20201227
@cmtsij
cmtsij / lottery.py
Created Oct 20, 2016
Taiwan lottery
View lottery.py
#!/usr/bin/env python
import random
l=range(1,1+49)
random.shuffle(l)
# extend 5 numbers. (49->54)
l.extend(random.sample(l[0:48],5))
# display
View Base64.md

OpenSSL Base64 Encoding: Binary Safe and Portable

Herewith is an example of encoding to and from base64 using OpenSSL's C library. Code presented here is both binary safe, and portable (i.e. it should work on any Posix compliant system e.g. FreeBSD and Linux).

License

The MIT License (MIT)

Copyright (c) 2013 Barry Steyn

View 20-noto-cjk.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
View sudoku.py
#!/usr/bin/env python3
# Author: Ali Assaf <ali.assaf.mail@gmail.com>
# Copyright: (C) 2010 Ali Assaf
# License: GNU General Public License <http://www.gnu.org/licenses/>
from itertools import product
def solve_sudoku(size, grid):
""" An efficient Sudoku solver using Algorithm X.
@cmtsij
cmtsij / car_dvr_convert.sh
Created Jul 9, 2014
目擊者行車記錄器 轉檔
View car_dvr_convert.sh
sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg
# start/end and crop
ffmpeg -ss [start_second] -t [period] -i [input.file] -c:a copy -filter:v "crop=640:240:0:0" [output.file]
# use -an to remove audio stream
ffmpeg -ss [start_second] -t [period] -i [input.file] -an -c:a copy -filter:v "crop=640:240:0:0" [output.file]
View asus_script.js
window.asus = window.asus || {};
asus = asus || {};
(function() {
asus.user = {
touch : "ontouchend" in document ? true : false
};
asus.url = {
the_url : document.location.href,
top_url : top.location.href
};
View GL-iNet
Index: target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr703n.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr703n.c (revision 38494)
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr703n.c (working copy)
@@ -21,7 +21,9 @@
#include "dev-wmac.h"
#include "machtypes.h"
-#define TL_WR703N_GPIO_LED_SYSTEM 27
+#define TL_WR703N_GPIO_LED_SYSTEM 13
You can’t perform that action at this time.