Skip to content

Instantly share code, notes, and snippets.

View gembin's full-sized avatar
🎯
Focusing

gembin

🎯
Focusing
  • Seattle, WA
View GitHub Profile
@gembin
gembin / pyenv.md
Created October 26, 2017 13:58 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@gembin
gembin / ObjectHeader32.txt
Created August 29, 2017 02:41 — forked from arturmkrtchyan/ObjectHeader32.txt
Java Object Header
|----------------------------------------------------------------------------------------|--------------------|
| Object Header (64 bits) | State |
|-------------------------------------------------------|--------------------------------|--------------------|
| Mark Word (32 bits) | Klass Word (32 bits) | |
|-------------------------------------------------------|--------------------------------|--------------------|
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal |
|-------------------------------------------------------|--------------------------------|--------------------|
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased |
|-------------------------------------------------------|--------------------------------|--------------------|
|
@gembin
gembin / tensorflow_cuda_osx.md
Created August 24, 2017 15:43 — forked from Mistobaan/tensorflow_cuda_osx.md
How to enable cuda support for tensor flow on Mac OS X (Updated on April:2016 Tensorflow 0.8)

These instructions will explain how to install tensorflow on mac with cuda enabled GPU suport. I assume you know what tensorflow is and why you would want to have a deep learning framework running on your computer.

Prerequisites

Make sure to update your homebrew formulas

brew update
@gembin
gembin / ECCKeyAgreement.java
Created July 21, 2017 14:18 — forked from ymnk/ECCKeyAgreement.java
ECC with Java
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 .
import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import javax.crypto.KeyAgreement;
public class ECCKeyAgreement {
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg;
kpg = KeyPairGenerator.getInstance("EC","SunEC");
@gembin
gembin / ESP32_wifi_dns.c
Created July 21, 2017 13:00 — forked from MakerAsia/ESP32_wifi_dns.c
ESP32 (ESP-IDF) WiFi connect and resolve DNS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "lwip/inet.h"
#include "lwip/ip4_addr.h"
#include "lwip/dns.h"
@gembin
gembin / AnnotationTypeInformationMapper.java
Created December 29, 2016 10:34 — forked from athlan/AnnotationTypeInformationMapper.java
Spring Data Mongo custom _class value
package selly.spring.data.convert;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.config.BeanDefinition;
@gembin
gembin / nohup-output-to-file.sh
Created November 28, 2016 05:25 — forked from umidjons/nohup-output-to-file.sh
Redirect nohup output to a file
# redirect output and errors into file output.log:
nohup some_command > output.log 2>&1&
# abbreviated syntax for bash version >= ver.4:
nohup some_command &> output.log
@gembin
gembin / pr.md
Created November 18, 2016 13:52 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@gembin
gembin / rust-robotics-libraries.md
Created November 11, 2016 16:58 — forked from ClintLiddick/rust-robotics-libraries.md
Rust Libraries for Robotics

Motivation

tl;dr I want to use Rust to program robots. Help me find the best core libraries to build on.

Robotic systems require high performance and reliability, but also have enormous complexity in terms of algorithms employed, number of subsystems, embedded hardware control, and other metrics. Development is mostly split between C++ for performance and safety critical components, and MatLab or Python for quick research or task iteration.

@gembin
gembin / README.md
Created March 21, 2016 08:08 — forked from mhausenblas/README.md
Kubernetes debugging session leveraging labels

That's our RC:

$ cat ws-rc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: webserver-rc
spec:
  replicas: 5

selector: