Skip to content

Instantly share code, notes, and snippets.

@xsharing
xsharing / raspbian_opencv
Created November 17, 2017 09:19
compile opencv 3.3 on raspbian
wget -O opencv-3.3.1.zip https://github.com/opencv/opencv/archive/3.3.1.zip
wget -O opencv_contrib-3.3.1.zip https://github.com/opencv/opencv_contrib/archive/3.3.1.zip
sudo apt-get install -y build-essential cmake pkg-config
sudo apt-get install -y mesa-utils libgl1-mesa-dri
sudo apt-get install -y libjpeg-dev libtiff5-dev libpng12-dev libjasper-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev
sudo apt-get install -y libatlas-base-dev gfortran libeigen3-dev
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y libprotobuf-dev protobuf-compiler
@xsharing
xsharing / gitlfs.md
Last active February 23, 2016 08:26
git-lfsではまったとことか

git config credential.helper store という風に設定しないと Git LFS: (100 of 21936 files) 2.73 GB / 2.72 GB みたいに、100ファイル目ぐらいで止まってgit pushが永遠に終わらない

その他の設定とあわせて .git/configはこんな感じ


[lfs]
	url="http://****:3000/git-lfs/****"
	batch = true

Keybase proof

I hereby claim:

  • I am xsharing on github.
  • I am xsharing (https://keybase.io/xsharing) on keybase.
  • I have a public key ASC4oC7rhG81lYpb0fUfLxZZ3erauE5IH6SLDcwdZC8zUgo

To claim this, I am signing this object:

@xsharing
xsharing / gist:bd6ec011a654a97da12e
Last active August 29, 2015 14:13
conoha eth1
<?php
// curl -sS https://gist.githubusercontent.com/xsharing/bd6ec011a654a97da12e/raw | php -- 10.0.0.1 | tee /etc/sysconfig/network-scripts/ifcfg-eth1
// service network restart
// ifconfig eth1
// see https://www.conoha.jp/guide/guide.php?g=36
//HWADDR
$ifconfig = shell_exec("/sbin/ifconfig eth1");
//echo $ifconfig;
@xsharing
xsharing / gist:dc716a0146e59a4cbbd0
Created November 19, 2014 16:25
novocaine しゃべってるときだけ音出す的な
__block int suppressor_counter = 0;
[self.audioManager setInputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) {
float volume = 1.0;
{
float avg = 0.0;
for (UInt32 i=0; i<numFrames*numChannels; i++) {
avg += data[i]*data[i];
}
avg = avg / numFrames / numChannels;
@xsharing
xsharing / gist:5f6c97d2c0678c25e926
Last active August 29, 2015 14:09
zabbix alert script (phone call with twillio)
#!/bin/sh
to=$1
# zabbix上では+81..形式
subject=$2
body=$3
message=`echo $subject $subject $body`
urlencode() {
@xsharing
xsharing / gist:358fef5bc48f15da1dcb
Created October 17, 2014 07:45
amazon s3から写真だけDL
aws --profile archive s3 sync s3://utshorinji-2010s/2014/ 2014/ --exclude "*" --include "*.JPG" --include "*.jpg"
@xsharing
xsharing / gist:852e6d9ec11108227f98
Created October 1, 2014 03:27
size of each directory inside current directory
for D in *; do
if [ -d "${D}" ]; then
du -h "${D}" | tail -n 1
fi
done
@xsharing
xsharing / gist:8950335
Created February 12, 2014 05:05
remove instrumentals(karaoke) from walkman
find /Volumes/WALKMAN -iname '*instrumental*' -exec rm {} \;
find /Volumes/WALKMAN -iname '*off vocal*' -exec rm {} \;
@xsharing
xsharing / gist:8213778
Created January 2, 2014 01:41
git utf8
git config --global core.precomposeunicode true
git config --local core.precomposeunicode true