Skip to content

Instantly share code, notes, and snippets.

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-mysql-dir=/usr/local/mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-mysql-dir=/usr/local/mysql
checking for mysql_ssl_set()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
<?php
$client = <create thrift connection>;
$batch_size = 2048; // approximate number of keys per split
$token_ranges = $client->describe_ring('MyKeyspace');
// instead of foreach, each host would find themselves in the ring and only
// query that range. this is for testing
foreach ($token_ranges as $token_range) {
$start_token = $token_range->start_token;
@afex
afex / gist:8949557
Created February 12, 2014 03:23
drone vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "shell",
inline: "apt-get -y install curl; curl -s https://get.docker.io/ubuntu/ | sudo sh; usermod -a -G docker vagrant"
config.vm.provision "shell",
request:
POST /v1.9/containers/e26bd5903bb7/copy HTTP/1.1
Host: localhost:4243
User-Agent: Docker-Client/0.8.1
Content-Length: 75
Content-Type: application/json
response:
drwxr-xr-x. 2 root root 4096 Dec 20 2013 anaconda
drwxr-x---. 2 root root 4096 Dec 20 2013 audit
-rw-r--r-- 1 root root 6588 Aug 6 22:13 boot.log
-rw-------. 1 root utmp 0 Dec 20 2013 btmp
drwxr-sr-x+ 3 root systemd-journal 4096 Dec 20 2013 journal
-rw-r--r--. 1 root root 292000 Aug 6 22:35 lastlog
drwx------ 2 nginx nginx 4096 Aug 6 22:20 nginx
drwx------. 2 root root 4096 Aug 1 2013 ppp
-rw-r--r--. 1 root root 1040 Dec 5 2013 README
drwx------ 2 root root 4096 Aug 6 22:15 salt
Aug 06 23:42:13 kubernetes-master systemd[1]: Starting etcd...
Aug 06 23:42:13 kubernetes-master systemd[1]: Started etcd.
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.820 INFO | kubernetes-master is starting a new cluster
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.823 INFO | etcd server [name kubernetes-master, listen on 0.0.0.0:4001, advertised url http://127.0.0.1:4001]
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.823 INFO | peer server [name kubernetes-master, listen on :7001, advertised url http://kubernetes-master:7001]
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.823 INFO | kubernetes-master starting in peer mode
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.824 INFO | kubernetes-master: state changed from 'initialized' to 'follower'.
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.824 INFO | kubernetes-master: state changed from 'fo
Aug 06 23:42:44 kubernetes-master systemd[1]: Starting Kubernetes API Server...
Aug 06 23:42:44 kubernetes-master systemd[1]: Started Kubernetes API Server.
Aug 06 23:42:44 kubernetes-master apiserver[12831]: I0806 23:42:44.924674 12831 apiserver.go:85] No cloud provider specified.
Aug 06 23:44:52 kubernetes-master apiserver[12831]: E0806 23:44:52.194717 12831 healthy_minion_registry.go:54] 10.245.2.2 failed health check with error: Get http://10.245.2.2:10250/healthz: dial tcp 10.245.2.2:10250: connection timed out
Aug 06 23:46:59 kubernetes-master apiserver[12831]: E0806 23:46:59.416683 12831 healthy_minion_registry.go:54] 10.245.2.3 failed health check with error: Get http://10.245.2.3:10250/healthz: dial tcp 10.245.2.3:10250: connection timed out
Aug 06 23:47:13 kubernetes-master apiserver[12831]: I0806 23:47:13.066554 12831 log.go:135] GET /api/v1beta1/replicationControllers?labels=: (33.892519ms) 200
Aug 06 23:47:22 kubernetes-master apiserver[12831]: I0806 23:47:22.169477 12831 log.go:135] GET /api/v1b
@afex
afex / gist:676e5811ab54f203cfee
Created August 7, 2014 00:45
from minion VM
# localhost
[root@kubernetes-minion-1 ~]# curl --verbose -X PUT 127.0.0.1:4001/v2/keys/afex -d value=Hi
* About to connect() to 127.0.0.1 port 4001 (#0)
* Trying 127.0.0.1...
* Adding handle: conn: 0xe4fd60
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xe4fd60) send_pipe: 1, recv_pipe: 0
@afex
afex / gist:dcc5b1019f019e41b2f7
Created August 8, 2014 20:52
vagrant provision
Keiths-iMac:kubernetes kthornhill$ vagrant provision
==> master: Running provisioner: shell...
master: Running: inline script
==> master: Building release
==> master: /vagrant /home/vagrant
==> master: Building release tree
==> master: /vagrant /vagrant
==> master: /vagrant
==> master: Packaging release
==> master: /home/vagrant