Skip to content

Instantly share code, notes, and snippets.

View marschhuynh's full-sized avatar
🎯
Focusing

Marsch Huynh marschhuynh

🎯
Focusing
View GitHub Profile
import pi2go, time
pi2go.init()
# Here we set the speed to 60 out of 100 - feel free to change!
speed = 65
count = 0
isLeft = 0
disError = 10000
@marschhuynh
marschhuynh / dock_faster.md
Created April 24, 2017 05:19
Make dock on mac appear faster

defaults write com.apple.dock autohide-delay -float 0

defaults write com.apple.dock autohide-time-modifier -float 0.5

killall Dock

@marschhuynh
marschhuynh / build_tensorflow_and_opencv.md
Last active March 25, 2017 10:13
Build tensorflow and opencv
## Build OpenCV for python 3
#### For python3 on ubuntu
```bash
cmake -Wno-deprecated-gpu-targets \
-D BUILD_TIFF=ON \
-D BUILD_opencv_java=OFF \
-D WITH_CUDA=ON \
@marschhuynh
marschhuynh / opencv_build.sh
Last active December 6, 2017 05:07
Build open cv for python on Mac
cmake -D BUILD_TIFF=ON \
-D BUILD_opencv_java=OFF \
-D WITH_CUDA=OFF \
-D WITH_OPENGL=ON \
-D WITH_OPENCL=ON \
-D WITH_IPP=OFF \
-D WITH_TBB=ON \
-D WITH_EIGEN=ON \
-D WITH_V4L=ON \
-D WITH_VTK=OFF \
@marschhuynh
marschhuynh / swap.sh
Created February 9, 2017 05:13
Create swap on linux
sudo /bin/dd if=/dev/zero of=/swap bs=1M count=1024
sudo /sbin/mkswap /swap
sudo chmod 600 /swap
sudo /sbin/swapon /swap
@marschhuynh
marschhuynh / gist:71db5ed80eef45996624093047f20be9
Created December 30, 2016 17:53
Run command line as another user
su - root -c "command"
OR
su - -c "command arg1"
@marschhuynh
marschhuynh / proxy.sh
Last active March 15, 2020 09:55
Sock proxy
#! /bin/sh
SERVER=gg-sing
HOST=localhost
PORT=8123
SOCK_ID=$(date +%s)
ssh -CNM -f -q -D 8123 -S /tmp/proxy-${SOCK_ID}.sock ${SERVER}
sudo networksetup -setsocksfirewallproxy "Wi-Fi" localhost 8123
@marschhuynh
marschhuynh / mongo-autostart-osx.md
Created December 20, 2016 16:44 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

.sm-title {
font-size: 16px;
padding: 0px 25px 0px 0px;
}
.sm-label {
color: #bbb;
font-size: 12px;
}
http://macnhack.blogspot.com/2015/10/huong-dan-patch-applehda-cho-cac-laptop.html