Skip to content

Instantly share code, notes, and snippets.

Avatar

Stuart King stuartrexking

  • Townsville, QLD.
View GitHub Profile
View gist:6eee734610982eb18fdfebde034250f0
curl -v -X POST 'http://192.168.0.100/wifi' -H 'content-type: application/json' -d '{"ssids":"coffey","psk":"password1"}' --trace-ascii /dev/stdout
View gist:65f0abddf846bfc2c24e69e574e8a59b
DEBUG [2016-04-28 14:28:50,833] [15a92464-2e13-4f1a-9cf9-26ed98a09490] org.eclipse.jetty.server.HttpChannel: HttpChannelOverHttp@648cdef0{r=1,c=false,a=DISPATCHED,uri=/application/journeys} content java.nio.HeapByteBufferR[pos=710 lim=1963 cap=8192]
DEBUG [2016-04-28 14:28:50,871] [15a92464-2e13-4f1a-9cf9-26ed98a09490] io.dropwizard.jersey.jackson.JsonProcessingExceptionMapper: Unable to process JSON
! java.time.format.DateTimeParseException: Text '2016-04-28T04:' could not be parsed at index 14
! at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) ~[na:1.8.0_74]
! at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[na:1.8.0_74]
! at java.time.LocalDateTime.parse(LocalDateTime.java:492) ~[na:1.8.0_74]
! at com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer.deserialize(LocalDateTimeDeserializer.java:63) ~[jackson-datatype-jsr310-2.6.1.jar:2.6.1]
! at com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer.deserialize(LocalDat
View gist:9b182a77cd34f83dc70d
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list > /dev/null
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list > /dev/null
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo apt-get update
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections > /dev/null
sudo apt-get install -y oracle-java8-installer
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
@stuartrexking
stuartrexking / Vagrantfile
Created Sep 16, 2015
Vagrantfile to install consul, dnsmasq and Event Store cluster
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo Installing dependencies...
sudo apt-get install -y unzip
echo Fetching Consul...
cd /tmp/
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip -O consul.zip
@stuartrexking
stuartrexking / Vagrantfile
Created Sep 16, 2015
Vagrantfile to install consul, dnsmasq and Event Store cluster
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo Installing dependencies...
sudo apt-get install -y unzip
echo Fetching Consul...
cd /tmp/
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip -O consul.zip
View gist:8bf22720ac81e8a637c7
vagrant@n1:~$ ifconfig eth1 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'
172.20.20.10
vagrant@n1:~$ curl http://172.20.20.11:2113/gossip
{
"members": [
{
"instanceId": "00000000-0000-0000-0000-000000000000",
"timeStamp": "2015-09-16T07:00:10.033572Z",
"state": "Manager",
"isAlive": false,
@stuartrexking
stuartrexking / gist:1ec7fa85bf5293a66564
Created Sep 16, 2015
Event Store with cluster gossip port
View gist:1ec7fa85bf5293a66564
vagrant@n1:~$ sudo eventstored --mem-db -log /var/log/eventstore.log --int-ip 172.20.20.10 --ext-ip 172.20.20.10 --cluster-size=3 --cluster-dns eventstore.service.consul --cluster-gossip-port=2113
[04858,01,06:51:46.994]
ES VERSION: 3.2.1.0 (release-v3.2.1/7994e0fec6b2dc6740dfb54cbf3139e98c3fc592, Wed, 9 Sep 2015 19:11:22 +0200)
OS: Linux (Unix 3.13.0.63)
RUNTIME: 3.12.1 (tarball) (64-bit)
GC: 2 GENERATIONS
LOGS: /var/log/eventstore.log
MODIFIED OPTIONS:
View gist:e23d9bd96b1f457c4be9
vagrant@n1:~$ eventstored --mem-db -log /var/log/eventstore.log --int-ip 172.20.20.10 --ext-ip 172.20.20.10 --cluster-size=3 --cluster-dns eventstore.service.consul
[04273,01,06:05:28.629]
ES VERSION: 3.2.1.0 (release-v3.2.1/7994e0fec6b2dc6740dfb54cbf3139e98c3fc592, Wed, 9 Sep 2015 19:11:22 +0200)
OS: Linux (Unix 3.13.0.63)
RUNTIME: 3.12.1 (tarball) (64-bit)
GC: 2 GENERATIONS
LOGS: /var/log/eventstore.log
MODIFIED OPTIONS:
View gist:ea4ba8f56533508ac38f
vagrant@n1:~$ dig @localhost –t SRV eventstore.service.consul
; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> @localhost –t SRV eventstore.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 10149
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
View QuestionList.md
  1. New questions by interest /interests/:interestId/questions/new?limit=10&offset=10
  2. Following questions by interest /interests/:interestId/questions/following?limit=10&offset=10
  3. Top questions by interest /interests/:interestId/questions/top?limit=10&offset=10
  4. New questions for all interests /questions/new?limit=10&offset=10
  5. Following questions for all interests /questions/following?limit=10&offset=10
  6. Top questions for all interests /questions/top?limit=10&offset=10