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 <utility> | |
#include <sstream> | |
#include <iostream> | |
#include <iterator> | |
#include <type_traits> | |
// Adopt std::void_t from c++17 | |
template <typename... Ts> | |
struct make_void | |
{ |
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/expect | |
spawn telnet 192.168.255.1 | |
expect "VxWorks login:" | |
send "MOTOMANrobot\r" | |
expect "Password:" | |
send "MOTOMANrobot\r" | |
interact |
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
import urllib2 | |
from bs4 import BeautifulSoup | |
import requests | |
import urlparse | |
import os | |
extensions = ( '.pdf', '.jpg', '.png' ) | |
url = raw_input('Input url:') |
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 | |
distro="$(lsb_release --id --short)" | |
if [ "$distro" != "Debian" -a "$distro" != "Ubuntu" ]; then | |
echo Unsupported distro $distro | |
exit 1 | |
fi | |
# 2.6.32-5-amd64 | |
# 2.6.32-37-generic |
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
% Display statistics of input rawdata | |
% and draw a plot figure of it. | |
infile = input('Please enter your data file:', 's'); | |
rawdata = load(infile); | |
disp('90 percentile:'); | |
disp(prctile(rawdata, 90)); | |
disp('99 percentile:'); | |
disp(prctile(rawdata, 99)); |
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 bash | |
# The POST string is like | |
# \"id\"=<some number> | |
# Count the requests by mid | |
# The result is like: | |
# count id | |
# ... ... | |
# known search patterns: | |
# %22mid%22%2A |
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 | |
# Use lame to shrink sound file | |
SOUND=$1 | |
FILE_NAME=`echo ${SOUND} | awk -F"/" '{print $NF}'` | |
TMP_FILE="/tmp/${FILE_NAME}" | |
lame -b 64 --resample 22.50 ${SOUND} ${TMP_FILE} | |
mv ${TMP_FILE} ${SOUND} |
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 | |
# coding:utf-8 | |
# Refresh TexturePacker *.tps | |
import sys | |
import os | |
import xml.sax | |
import cStringIO | |
# import string | |
import re |
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 | |
# coding:utf-8 | |
import sys | |
import git | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEText import MIMEText | |
import time | |
SENDER = "" |
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 | |
# PRE-COMMIT HOOK | |
# | |
# The pre-commit hook is invoked before a Subversion txn is | |
# committed. Subversion runs this hook by invoking a program | |
# (script, executable, binary, etc.) named 'pre-commit' (for which | |
# this file is a template), with the following ordered arguments: | |
# | |
# [1] REPOS-PATH (the path to this repository) |
NewerOlder