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/python | |
import glob | |
import os | |
import sys | |
from PIL import Image | |
EXTS = 'jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'png', 'PNG' |
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 | |
if [ $2 == "start" ] | |
then | |
rvictl -s $1 | |
open /Applications/Wireshark.app | |
elif [ $2 == "stop" ] | |
then | |
rvictl -x $1 | |
else | |
echo "$0 [iOSDeviceIdentifier] [start|stop]" |
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
mkfifo /tmp/fifo; | |
ssh-keygen; | |
ssh-copyid root@remotehostaddress; | |
sudo ssh root@remotehost "tshark -i eth1 -f 'not tcp port 22' -w -" > /tmp/fifo &; | |
sudo wireshark -k -i /tmp/fifo; |
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
ssh root@host "tcpdump -i any -s0 -U port $1 -w -" | /Applications/Wireshark.app/Contents/MacOS/Wireshark -k -i - |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
) | |
func trace2() { | |
pc := make([]uintptr, 15) | |
n := runtime.Callers(2, pc) |
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
SFILE:=$(wildcard *.go) | |
VERSION=`git describe --tags` | |
BUILD=`date +%F_%T%z` | |
TAGETFILE=uploadTool | |
LDFLAGS_DEBUG=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}" | |
LDFLAGS_REL=-ldflags "-w -s -X main.Version=${VERSION} -X main.Build=${BUILD}" | |
all: mac | |
@echo ${BUILD} ${VERSION} $(SFILE) |
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
bash -c "echo 7 > /etc/yum/vars/releasever" && yum install -y yum-utils && sudo yum-config-manager --add-repo https://openresty.org/package/rhel/openresty.repo && sudo yum install -y openresty && command -v opentresty | |
yum install -y yum-utils | |
sudo yum-config-manager --add-repo https://openresty.org/package/rhel/openresty.repo | |
sudo yum install -y openresty | |
# change info about os version | |
vi /etc/yum.repos.d/openresty.repo | |
sudo yum install openresty | |
#python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=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
# 全局环境变量设置 | |
export GOPATH=/users/choe | |
# 局部环境变量设置,必须是前置条件 | |
ok1:export GOPATH=/users/choe/github/en/code/ | |
ok1: | |
@echo $(GOPATH) | |
# 错误的环境变量的设置 | |
error: | |
export GOPATH=/users/choe/github/ |
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 write_to_file(this_data, target_file, append_data) | |
try | |
set the target_file to the target_file as string | |
set the open_target_file to open for access file target_file with write permission | |
if append_data is false then set eof of the open_target_file to 0 | |
write this_data to the open_target_file starting at eof | |
close access the open_target_file | |
return true | |
on error | |
try |
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
# | |
# It will: | |
# | |
# deal with files with spaces, newlines, leading dashes, and other funniness | |
# handle an unlimited number of files | |
# won't repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files | |
# Also see: | |
# | |
# GNU tar manual http://www.gnu.org/software/tar/manual/tar.html#SEC107 | |
# How can I build a tar from stdin?, searc |