Skip to content

Instantly share code, notes, and snippets.

View simonmulser's full-sized avatar
👨‍🚀

Simon Mulser simonmulser

👨‍🚀
View GitHub Profile
@deverton
deverton / logstash-template.json
Created June 22, 2012 04:49
Logstash Elasticsearch Template
{
"template": "logstash-*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index" : {
"query" : { "default_field" : "@message" },
"store" : { "compress" : { "stored" : true, "tv": true } }
}
},
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@mjul
mjul / rsync.md
Created August 19, 2016 10:06
RSync a local directory to docker-machine to make it available for VOLUME

Docker VOLUME directories are local directories on the docker host. Hence, when using docker-machine with remote hosts they are not available. However, we can rsync files to the remote docker host and MOUNT them from there

Local directory to docker-machine home directory

Assuming rs is a directory, this copies its contents to the home directory of the default user (ubuntu) on the remote docker-machine with the name my-sandbox. : denotes the remote machine, with no path it defaults to the current directory of the shell (the ubuntu user's home directory).

@jasonk000
jasonk000 / nodejs-sample.js
Last active September 13, 2023 20:31
Using x.509 certs with JWS/JWT/JWK
#!/usr/bin/env node
import fs from 'fs'
import jose from 'node-jose'
import pem from 'pem'
async function run () {
try {
// keystore to stick our node-jose keys before we do signing
let keystore = jose.JWK.createKeyStore()
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@glendaviesnz
glendaviesnz / example-test.spec.ts
Created May 16, 2018 23:54
Helper for testing Angular Material Select Menu changes in Unit Tests
import { ComponentFixture, TestBed, async, inject, fakeAsync, flush } from '@angular/core/testing';
import {
MatCheckboxModule,
MatSelectModule
} from '@angular/material';
import { By } from '@angular/platform-browser';
import { SelectMenuTestHelper } from './select-menu-test.helper';
describe('SelectOptionComponent', () => {