Manage SSH Keys

Generate SSH Key

$ ssh-keygen -t rsa -C "[email protected]"

Add Key

$ ssh-add ~/.ssh/id_rsa

Check Saved Keys

ssh-add -l

Delete All Keys

ssh-add -D

Start ssh agent

If you get the error : “Could not open a connection to your authentication agent.”

eval `ssh-agent -s`

VAO VBO VEO Template

GLfloat vertices[] = {
     0.5f,  0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f,
     0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f,
    -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
    -0.5f,  0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
};

GLuint indices[] = {
    0, 1, 3,
    1, 2, 3
};

GLfloat texCoords[] = {
    0.0f, 0.0f,
    1.0f, 0.0f,
    0.5f, 1.0f
};

GLuint VBO;
GLuint VAO;
GLuint EBO;

glGenBuffers(1, &VBO);
glGenVertexArrays(1, &VAO);
glGenBuffers(1, &EBO);

glBindVertexArray(VAO);
    glBindBuffer(GL_ARRAY_BUFFER, VBO);
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)0);
    glEnableVertexAttribArray(0);
    glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)(3 * sizeof(GLfloat)));
    glEnableVertexAttribArray(1);
    glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid*)(6 * sizeof(GLfloat)));
    glEnableVertexAttribArray(2);

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);


    glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);

Alt none

ref: http://www.learnopengl.com/#!Getting-started/Hello-Triangle

Android在64位平台上使用32位库

Set abi filters in gradle file:

android {
    ....
    defaultConfig {
        ....
        ndk {
            moduleName "module_name"

            abiFilters "armeabi", "armeabi-v7a"
        }
    }
}

If getting NDK integration deprecated error, add one line to file named gradle.properties:

android.useDeprecatedNdk=true

MP4Box 常用命令

Dump Atom Infomation

MP4Box   -diso  some.mp4

Build SOIL on MacOS

cd projects/makefile
mv makefile Makefile
mkdir obj
make