Skip to content

Instantly share code, notes, and snippets.

@tzutalin
tzutalin / install_nv340_driver.sh
Last active April 30, 2016 16:07
Ubuntu14.04-nvidia-340 Driver installation
#!/bin/sh
# My GPU: Gefore710M
sudo apt-get remove nvidia* && sudo apt-get autoremove
sudo add-apt-repository -y ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-340
# Install CUDA 6.0
sudo apt-get install nvidia-cuda-toolkit
# Install opencl
@tzutalin
tzutalin / startWifiAdb.sh
Last active December 25, 2015 01:41
Use Wifi Adb
#!/bin/sh
PORT=5555
if [ $# -ne 0 ]; then
while [ $# != 0 ]
do
PORT=$1
shift
done
@tzutalin
tzutalin / CMakeLists.txt
Created March 9, 2016 11:04
BuildAnroidUsingOpencvCMake
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
#########################################################
# Set project name
#########################################################
IF( NOT PROJECT_NAME )
IF ( NOT "x$ENV{PROJECT_NAME}" STREQUAL "x" )
SET( PROJECT_NAME $ENV{PROJECT_NAME} )
ELSE()
@tzutalin
tzutalin / download_opencv.py
Created March 11, 2016 11:58
download_opencv_script
#!/usr/bin/env python
__author__ = 'TzuTaLin'
import os
import sys
import shutil
from subprocess import call
import zipfile
import subprocess
def unzipFile(filename):
@tzutalin
tzutalin / timer-c++03.cpp
Last active March 11, 2023 12:25 — forked from gongzhitaao/CppTimer.md
Simple high resolution timer in C++
#include <iostream>
#include <ctime>
class Timer
{
public:
Timer() { clock_gettime(CLOCK_REALTIME, &beg_); }
double elapsed() {
clock_gettime(CLOCK_REALTIME, &end_);
@tzutalin
tzutalin / opencl-headers.sh
Last active May 6, 2016 07:04 — forked from velenux/opencl-headers.sh
Download OpenCL headers
DIR=.
VERSION=12
echo "Downloading headers for version ${VERSION}..."
mkdir -p "${DIR}/CL-${VERSION}"
cd "${DIR}/CL-${VERSION}"
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/opencl.h
@tzutalin
tzutalin / build-android-opencv.sh
Last active October 1, 2022 21:18
Build OpenCV for android
#!/usr/bin/env sh
NDK_ROOT="${1:-${NDK_ROOT}}"
if [ ! -d "${WD}/android-cmake" ]; then
echo 'Cloning android-cmake'
git clone https://github.com/taka-no-me/android-cmake.git
fi
### ABI setup
#ANDROID_ABI=${ANDROID_ABI:-"armeabi-v7a with NEON"}
@tzutalin
tzutalin / keytool-importkeypair
Last active July 5, 2016 02:40
android-signature.sh
#! /bin/bash
#
# This file is part of keytool-importkeypair.
#
# keytool-importkeypair is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# keytool-importkeypair is distributed in the hope that it will be
@tzutalin
tzutalin / update_upstream.sh
Created July 14, 2016 06:17
update_upstream.sh
#!/bin/sh
git remote add upstream $1
git fetch upstream
git pull --rebase upstream master
@tzutalin
tzutalin / run_flatc.py
Created August 2, 2016 12:37
run flatc
#!/usr/bin/env python
__author__ = 'TzuTaLin'
# Copyright (c) 2016 Tzutalin
# Create by TzuTaLin <tzu.ta.lin@gmail.com>
import os
import platform
import subprocess