Skip to content

Instantly share code, notes, and snippets.

@zsiddiqi
zsiddiqi / AuthServiceApplication.java
Created December 10, 2017 00:54 — forked from joshlong/AuthServiceApplication.java
An OAuth authorization service built using Java
// org.springframework.cloud:spring-cloud-starter-oauth2
// org.springframework.boot:spring-boot-starter-data-jpa
// com.h2database:h2
// redefine: spring-security.version == 4.1.0.RELEASE
package com.example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@zsiddiqi
zsiddiqi / KotlinAuthenticationServiceApplication.kt
Created December 10, 2017 00:54 — forked from joshlong/KotlinAuthenticationServiceApplication.kt
An OAuth authorization service built using Kotlin
// org.springframework.cloud:spring-cloud-starter-oauth2
// org.springframework.boot:spring-boot-starter-data-jpa
// com.h2database:h2
// redefine: spring-security.version == 4.1.0.RELEASE
package com.example
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.SpringApplication
@zsiddiqi
zsiddiqi / save-load-docker-images.sh
Last active December 15, 2017 02:14 — forked from mmrko/save-load-docker-images.sh
Script to (selectively) save/load multiple Docker images
#!/usr/bin/env bash
# Script to (selectively) save/load multiple Docker images to/from a directory.
# Run ./save-load-docker-images.sh for help.
set -e
set -u
directory=$PWD
filter=""
@zsiddiqi
zsiddiqi / save-all-images.sh
Created December 15, 2017 00:57 — forked from lalyos/save-all-images.sh
script to save all docker image, and load them back
reload() {
source ${BASH_SOURCE[0]}
}
alias r=reload
get-image-field() {
local imageId=$1
local field=$2
: ${imageId:? reuired}
@zsiddiqi
zsiddiqi / node-npm-install.md
Created February 25, 2018 06:22 — forked from rcugut/node-npm-install.md
Install node & npm on Mac OS X with Homebrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@zsiddiqi
zsiddiqi / git.migrate
Created July 17, 2018 22:08 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@zsiddiqi
zsiddiqi / api.js
Created August 3, 2018 15:32 — forked from fwielstra/api.js
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@zsiddiqi
zsiddiqi / README.md
Created September 21, 2018 16:01 — forked from simenbrekken/README.md
Super simple Backbone + Express + MongoDB REST backend application

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage:

@zsiddiqi
zsiddiqi / tmux-cheatsheet.markdown
Created May 29, 2019 12:55 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname