Skip to content

Instantly share code, notes, and snippets.

View stuartrexking's full-sized avatar

Stuart King stuartrexking

  • Townsville, QLD.
View GitHub Profile
curl -v -X POST 'http://192.168.0.100/wifi' -H 'content-type: application/json' -d '{"ssids":"coffey","psk":"password1"}' --trace-ascii /dev/stdout
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
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 September 16, 2015 10:13
Vagrantfile to install consul, dnsmasq and Event Store cluster
# -*- 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 September 16, 2015 10:10
Vagrantfile to install consul, dnsmasq and Event Store cluster
# -*- 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
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 September 16, 2015 06:54
Event Store with cluster gossip port
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:
@stuartrexking
stuartrexking / gist:e23d9bd96b1f457c4be9
Created September 16, 2015 06:31
Event Stored logs
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:
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:
@stuartrexking
stuartrexking / QuestionList.md
Created July 25, 2015 02:42
Question Lists
  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