Skip to content

Instantly share code, notes, and snippets.

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*
This was mirrored from the snapshot of earthserver.com available on archive.org
--------------------------------------------------------------------------------
Setting up a modern C++ development environment on Linux with Clang and Emacs
I am an independent game developer and this is my personal wiki.
Please feel free to email hello@earthserver.com, and to follow @Earthserver
(Redirected from Setting up a C++11 development environment on Linux with Clang and Emacs)
@dalanlan
dalanlan / sortCsvFile.py
Created June 20, 2016 08:51
sort csv file
import csv
import sys
import operator
reload(sys)
sys.setdefaultencoding('utf-8')
@dalanlan
dalanlan / neo4jClient.java
Created June 20, 2016 07:33
Simple client for neo4j RestFul server
package com.hulu.neo4j;
/**
* Created by simei.he on 6/14/16.
*/
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import sun.misc.BASE64Encoder;
$ neo4j console
Starting Neo4j.
2016-06-06 06:59:25.108+0000 INFO Starting...
2016-06-06 06:59:25.753+0000 INFO Bolt enabled on localhost:7687.
2016-06-06 06:59:28.695+0000 INFO Started.
2016-06-06 06:59:28.855+0000 INFO Mounted unmanaged extension [org.neo4j.examples.server.unmanaged] at [/examples/unmanaged]
2016-06-06 06:59:29.272+0000 ERROR The ResourceConfig instance does not contain any root resource classes.
2016-06-06 06:59:29.272+0000 WARN unavailable The ResourceConfig instance does not contain any root resource classes.
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
@dalanlan
dalanlan / curl.md
Created May 18, 2016 07:21 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@dalanlan
dalanlan / kafka.md
Created April 22, 2016 07:36 — forked from ashrithr/kafka.md
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@dalanlan
dalanlan / kubelet log
Created September 6, 2015 11:46
containerized
I0906 09:11:50.722997 1 plugins.go:70] No cloud provider specified.
I0906 09:11:50.723110 1 server.go:395] Successfully initialized cloud provider: "" from the config file: ""
I0906 09:11:50.723187 1 manager.go:127] cAdvisor running in container: "/docker/05d21f1b0e26fd01a9e77318adefd276d1b7ec18f545c75feb2f495a3440a6aa"
I0906 09:11:50.726696 1 fs.go:93] Filesystem partitions: map[/dev/mapper/ubuntu--vg-root:{mountpoint:/rootfs major:252 minor:0} /dev/sda1:{mountpoint:/rootfs/boot major:8 minor:1}]
I0906 09:11:50.757949 1 manager.go:158] Machine: {NumCores:4 CpuFrequency:2000000 MemoryCapacity:8373030912 MachineID:83a72a8c14fd4d878d0cc535058af25f SystemUUID:564DDDC6-D5F0-72CB-A318-A0BCE9F62632 BootID:05f9e736-903a-47db-a91b-03ee1e912b28 Filesystems:[{Device:/dev/mapper/ubuntu--vg-root Capacity:75664416768} {Device:/dev/sda1 Capacity:246755328}] DiskMap:map[2:0:{Name:fd0 Major:2 Minor:0 Size:0 Scheduler:deadline} 8:0:{Name:sda Major:8 Minor:0 Size:85899345920 Scheduler:deadline} 25
@dalanlan
dalanlan / cleanup-docker-zombies
Last active September 2, 2015 05:49
Cleanup zombie docker directories [See docker issue #6354]
#!/usr/bin/env python
"""
Check all existing Docker containers for their mapped paths, and then purge any
zombie directories in docker's volumes directory which don't correspond to an
existing container.
"""
import logging
import os
import sys
#!/bin/bash
ip="$1"
/usr/bin/expect <<-EOF
set timeout 3
spawn ssh vcap@$ip
expect {
"yes/no" {send "yes\r";exp_continue}
"password" {send "password\r";exp_continue}
"login" {send "sudo mkdir -p /varlog && sudo touch -f /var/log/es-kubelet.log.pos && sudo touch -f /var/log/es-containers.log.pos\r";exp_continue}
eof exit