Skip to content

Instantly share code, notes, and snippets.

View shaunthomas999's full-sized avatar

Shaun Thomas shaunthomas999

View GitHub Profile
@shaunthomas999
shaunthomas999 / npm-log
Created June 29, 2015 15:26
Error during npm install with node-gyp rebuild when trying to build from Dockerfile
npm info install node-pre-gyp@0.6.7
npm info postinstall node-pre-gyp@0.6.7
npm info install sqlite3@3.0.8
npm info libxmljs@0.13.0 Failed to exec install script
> ref@1.0.2 install /tmp/hub_node_modules/node_modules/exec-sync/node_modules/ffi/node_modules/ref
> node-gyp rebuild
gyp info it worked if it ends with ok
gyp verb cli [ 'node',
@shaunthomas999
shaunthomas999 / npm-log2
Created June 30, 2015 21:13
sqlite3 install error
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/examples/extracter.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/examples/packer.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/examples/reader.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/lib/buffer-entry.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/lib/entry-writer.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/lib/entry.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/lib/extended-header-writer.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/tar/lib/extended-header.js
npm sill gunzTarPerm extractEntry node_modules/node-pre-gyp/node_m
@shaunthomas999
shaunthomas999 / gencert.sh
Last active March 29, 2016 13:13 — forked from bradland/gencert.sh
Generate a self-signed SSL cert. This script has to be used with openssl that comes with Nginx installation. Note: Run the script with `sudo`.
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@shaunthomas999
shaunthomas999 / passwordGenerator.js
Last active July 14, 2016 18:08
Javascript code sample. Disclaimer: This algorithem is not the best and optimised.
/*
* Password Generator
*
* @author Shaun Thomas
*
* Objective
* --
* \_ Generate 12 character length password from domain name
* \_ Re-creatable by hand without much complexity
* \_ Password has decent level of randomness
@shaunthomas999
shaunthomas999 / basics.java
Last active September 1, 2017 10:20
Java Basics
// int Array initialization
int[] intArray = {1,2,3};
// String Array initialization
String[] stringArray = {"a","b","c"};
// Load resources class
File file = new File(getClass().getClassLoader().getResource(jobFileName).getFile());
// Best datatype for saving date & time - Java 8
@shaunthomas999
shaunthomas999 / mockitoReference.md
Last active November 4, 2019 14:54
Mockito Reference

Usage of Mockito API

// If want to use chain method calls then use 'RETURNS_DEEP_STUBS' property
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
Foo foo = mock(Foo.class, RETURNS_DEEP_STUBS);

@Mock (answer = Answers.RETURNS_DEEP_STUBS)
private Foo foo;
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class

AWS - Jenkins - Ubuntu - Conventional Setup

Instructions

  • Start a AWS EC2 instance and connect to that using SSH
  • Execute the following commands
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
@shaunthomas999
shaunthomas999 / spring-boot_notes.md
Last active December 7, 2017 11:13
Spring-Boot Notes

Spring-Boot Notes

Properties

  • Option 01 - Using @Value
@Value( "${jdbc.url:aDefaultUrl}" )
@shaunthomas999
shaunthomas999 / api-gateway.log
Created November 28, 2017 16:46
api-gateway.log
2017-11-28 16:05:53.010 INFO [api-gateway,,,] 1 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8090 (http)
2017-11-28 16:05:53.011 INFO [api-gateway,,,] 1 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8090
2017-11-28 16:05:53.015 INFO [api-gateway,,,] 1 --- [ main] n.i.s.gateway.GatewayApplication : Started GatewayApplication in 154.872 seconds (JVM running for 155.846)
2017-11-28 16:09:42.305 INFO [api-gateway,,,] 1 --- [nio-8090-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-11-28 16:09:42.306 INFO [api-gateway,,,] 1 --- [nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2017-11-28 16:09:42.412 INFO [api-gateway,,,] 1 --- [nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 106 ms
2017-11-28 16:09