Skip to content

Instantly share code, notes, and snippets.

View jacyzon's full-sized avatar

Yizhang Chen jacyzon

View GitHub Profile
#include <iostream>
using namespace std;
class quadrangle {
public:
class vertex {
friend class quadrangle;
friend ostream& operator<<(ostream& os, const quadrangle::vertex& vertex);
private:
@jacyzon
jacyzon / viewer_cvmat2pc.cpp
Created June 26, 2016 10:34
convert opencv mat to point cloud
#include <XnCppWrapper.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <pcl/visualization/cloud_viewer.h>
void matToPointXYZ(cv::Mat &color, cv::Mat &depth,
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud) {
const double u0 = 3.3930780975300314e+02;
const double v0 = 2.4273913761751615e+02;
@jacyzon
jacyzon / go_lean.sh
Created February 26, 2016 16:01 — forked from cam8001/go_lean.sh
Disable all the stuff we don't need on a MyBookLive.
#!/bin/bash
# See http://mybookworld.wikidot.com/forum/t-583096
# See http://tech.roxee.tv/2012/06/12/solving-the-my-book-live-insane-load/
# http://community.wd.com/t5/My-Book-Live-Duo/New-MyBook-Duo-4Tb-astonishingly-slow-I-mean-really-soul/td-p/417642/page/5
# Disable all this stuff, but also make miocrawler drops its logs.
# vi /etc/rsyslog.d/miocrawler.conf
# [root@storagecasa rsyslog.d]# cat miocrawler.conf
@jacyzon
jacyzon / ubuntu-eol.md
Created December 3, 2015 12:51 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@jacyzon
jacyzon / add_flow.json
Created November 25, 2015 08:43
localhost:8080/stats/flowentry/add
{
"dpid": 1,
"table_id": 0,
"priority": 10000,
"match":{
"in_port": 3
},
"actions":[
{
"type": "SET_NW_SRC",
@jacyzon
jacyzon / pointer_hell.c
Last active March 14, 2017 04:28
Welcome to Pointer Hell
/*
* =====================================================================================
*
* Filename: pointer_hell.c
*
* Description: Welcome to Pointer Hell
*
* Version: 1.0
* Created: 10/27/2015 12:04:36 AM
* Revision: none
@jacyzon
jacyzon / opencv mac setup
Created October 6, 2015 05:13
mac opencv setup
# brew install opencv and python
brew tap homebrew/science
brew install opencv
brew install python
brew install python3
# setup bash_profile / zshrc to use homebrew python
export PATH=/usr/local/bin:$PATH
# virtualenv
@jacyzon
jacyzon / install.after
Created October 6, 2015 03:05
XUbuntu after install
sudo apt-add-repository ppa:numix/ppa
sudo apt-get update
sudo apt-get install numix-icon-theme-circle
sudo apt-get install fcxin-chewing
sudo apt-get install git
sudo apt-get install ruby rake
sudo apt-get install zsh
git clone https://github.com/jacyzon/dotfiles ~/.yadr
@jacyzon
jacyzon / yosemite ntfs read+write.txt
Last active September 19, 2015 13:31 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
# or via brew cask
# installs Homebrew Cask
brew install caskroom/cask/brew-cask
brew cask install osxfuse
@jacyzon
jacyzon / osx-10.9-setup.md
Last active September 28, 2015 16:46 — forked from kevinelliott/osx-10.9-setup.md
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store