Skip to content

Instantly share code, notes, and snippets.

@taka-wang
taka-wang / build-tensorflow-from-source.md
Created August 14, 2019 15:00 — forked from Brainiarc7/build-tensorflow-from-source.md
Build Tensorflow from source, for better performance on Ubuntu.

Building Tensorflow from source on Ubuntu 16.04LTS for maximum performance:

TensorFlow is now distributed under an Apache v2 open source license on GitHub.

On Ubuntu 16.04LTS+:

Step 1. Install NVIDIA CUDA:

To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit as shown:

@taka-wang
taka-wang / aes.php
Last active January 26, 2018 19:17
PHP AES
<?php
class MCrypt {
private $hex_iv = '00000000000000000000000000000000'; # converted JAVA byte code in to HEX and placed it here
private $key = 'U1MjU1M0FDOUZ.Qz'; #Same as in JAVA
function __construct() {
$this->key = hash('sha256', $this->key, true);
//echo $this->key.'<br/>';
}
function encrypt($str) {
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
pizza orderPizza() {
Pizza pizza = new Pizza();
pizza.prepare();
pizza.bake();
pizza.cut();
pizza.box();
return pizza;
}
@taka-wang
taka-wang / flash.md
Last active September 2, 2016 04:07
Flash hypriotOS 1.0 image on mac

Guide

flash -n pi3-1 -s wifi_ssid -p wifi_pass -d disk3 https://downloads.hypriot.com/hypriotos-rpi-v1.0.0.img.zip
flash -n pi3-2 -s wifi_ssid -p wifi_pass -d disk3 https://downloads.hypriot.com/hypriotos-rpi-v1.0.0.img.zip
flash -n pi2-1 -s wifi_ssid -p wifi_pass -d disk3 https://downloads.hypriot.com/hypriotos-rpi-v1.0.0.img.zip
flash -n pi2-2 -s wifi_ssid -p wifi_pass -d disk3 https://downloads.hypriot.com/hypriotos-rpi-v1.0.0.img.zip
@taka-wang
taka-wang / golang_job_queue.md
Created August 10, 2016 02:06 — forked from harlow/golang_job_queue.md
Job queues in Golang
@taka-wang
taka-wang / auto-deploy_documentation.md
Created June 14, 2016 10:52 — forked from vidavidorra/auto-deploy_documentation.md
Auto-deploying Doxygen documentation to gh-pages with Travis CI

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th

@taka-wang
taka-wang / pi3.install.md
Last active April 13, 2016 07:59
Raspberry pi 3 installation

Raspberry pi 3 installation

# Add the overlay kernel module
echo "overlay" | sudo tee -a /etc/modules

# customize wifi
echo 'network={
  ssid="your-ssid"
  psk="your-psk"
@taka-wang
taka-wang / zeromq_3.2.5.bb
Last active March 21, 2016 10:08
zmq recipe
DESCRIPTION = "ZeroMQ looks like an embeddable networking library but acts like a concurrency framework"
HOMEPAGE = "http://www.zeromq.org"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=66ea8704398d7996daeacd2fbd2b9dbd"
PR = "r001"
DEPENDS += "libtool"
DEPENDS += "util-linux"
@taka-wang
taka-wang / _service.md
Created March 19, 2016 07:20
Fixed links with working versions.

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
#! /bin/sh
### BEGIN INIT INFO
# Provides: mosquitto
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mosquitto MQTT v3.1 message broker
# Description: