Skip to content

Instantly share code, notes, and snippets.

View matyapiro31's full-sized avatar

Akira matyapiro31

  • Searching for Job
  • Japan
View GitHub Profile
#!/bin/sh
# I put all my dev stuff in here
export DEV_PREFIX=$HOME/Dev/
# Don't forget to adjust this to your NDK path
export ANDROID_NDK=${DEV_PREFIX}/android-ndk-r8d/
export CROSS_COMPILE=arm-linux-androideabi
#!/bin/sh
PRE_IFS=$IFS
IFS=$'\n'
if [ ! -e $1 ]; then
mkdir -p $1
k=$1/
else
if [ -f $1 ]; then
echo "Error:the argument is a file!"
exit 0
#!/usr/bin/python
#usage export2file.py foo.ovpn VPN_Name
#coding:utf-8
import sys
argv = sys.argv
argc = len(sys.argv)
ovpnfile = open(argv[1])
cafile = open("ドキュメント/pem/ca-"+argv[2]+".pem","w")
certfile = open("ドキュメント/pem/cert-"+argv[2]+".pem","w")
root/
|-dists/
|-(distribution name)/
|-InRelease (signed Release)
|-Release
|-Release.gpg(public key)
|-main/
|-binary-amd64/
|-Packages (created by apt-ftparchive packages)
|-Packages.bz2
@matyapiro31
matyapiro31 / xdg-open
Last active November 20, 2015 22:18
xdg-open in cygwin
#!/bin/sh
PWD=$(pwd)
cd $@
WPNAME=`cygpath -d $(pwd)`
/cygdrive/c/Windows/explorer.exe $WPNAME
cd $PWD
#!/bin/bash
word=`zenity --entry --title="Search text..." --text="Insert texts to search."`
if [ "$?" = 1 ];then
exit;
fi
time=$(date +%s)
touch /tmp/list.test_$time
touch /tmp/hlist.test_$time
touch /tmp/mhlist.test_$time
@matyapiro31
matyapiro31 / xcd
Created November 20, 2015 22:17
cd to windows path in cygwin.
#!/bin/bash
function xcd () {
if [ "$1" != "" ];then
cd "$(cygpath -u "$1")"
fi
return 0;
}
@matyapiro31
matyapiro31 / selector.sh
Last active March 26, 2016 15:04
WindowsでAdbのショートカットを作った ref: http://qiita.com/matyapiro31/items/b001caa60c6e74a8cb33
#!/bin/bash
function selector() {
#10個だけ表示。多いと遅くなる。
for i in `seq 10 -1 1`
do
line="$(./adb devices|tail -n +$i|head -n 1|sed -e 's/\r//g')"
if [ ! -z "${line}" ]
then
if [ "${line:0:4}" = "List" ]
then
#!/bin/bash
function choose_device() {
./adb start-server >/dev/null
./adb devices | tail -n+2 | head -n 1 | { while read dev_id dev_name; do
dev_model="$(./adb -s $dev_id shell cat /system/build.prop | grep ro\.product\.model | cut -d= -f2)"
printf "%s\n%s\n%s\n" "$dev_id" "$dev_name" "$dev_model"
done } | zenity --list --title="Select device" --column="ID" --column="デバイス名" --column="モデル名" |tr -d '\r'
}
<img alt="シエラレオネの国旗"
src="//upload.wikimedia.org/wikipedia/commons/thumb/
1/17/Flag_of_Sierra_Leone.svg/
125px-Flag_of_Sierra_Leone.svg.png"
...
>