This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# tailscale completion -*- shell-script -*- | |
_tailscale() | |
{ | |
local cur prev words cword | |
_init_completion -n = || return | |
if [[ $cword -eq 1 ]]; then | |
SUBCOMMANDS=$(tailscale --help 2>&1 | awk '/SUBCOMMANDS/{ f = 1; next } /FLAGS/{ f = 0 } f{print $1}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
custom "Google Map" source for Mobile Atlas Creator 1.9.8 | |
save in *.xml and move to /mapsources | |
--> | |
<customMapSource> | |
<name>Google Map</name> | |
<minZoom>0</minZoom> | |
<maxZoom>20</maxZoom> | |
<tileType>PNG</tileType> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
filename=${0##*/} | |
usage() | |
{ | |
cat<<EOF | |
Usage: | |
$filename <iface> | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <limits.h> | |
#include <assert.h> | |
unsigned long int strtoul_wrapper(const char *nptr, char **endptr, int base,int *ret_errno) | |
{ | |
int set_error = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
file=$1 | |
path=${file%%.zip} | |
mkdir -p $path | |
LANG=en_US.BIG-5 7z e -y -o"$path" "$file" 2>/dev/null | |
(cd "$path" && convmv -f BIG5 -t UTF-8 --notest --replace * ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- python -*- | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import zipfile | |
import getpass | |
def usage(): |
NewerOlder