Skip to content

Instantly share code, notes, and snippets.

@imikh
imikh / zsh.md
Created December 29, 2017 01:22 — forked from uarun/zsh.md
Zsh Tips & Tricks

Zsh Tips and Tricks

Argument History

!*        # ... All parameters of the last command
!$        # ... Last parameter of the last command
!^        # ... First parameter of the last command
!:1       # ... First parameter of the last command

!-2:2 # ... Second parameter from 2 commands ago

@imikh
imikh / README.md
Created June 9, 2017 12:42 — forked from cyb3rd4d/README.md
Init script for Jackrabbit in a Vagrant box (tested on Ubuntu).

JackRabbit Init Script

Init script for Jackrabbit in a Vagrant box (tested on Ubuntu trusty only). I am not an advanced bash developer, so don't hesitate to contribute!

Installation

Copy this script in your /etc/init.d directory:

@imikh
imikh / cmd.sh
Created December 13, 2016 12:13 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@imikh
imikh / gist:ce399e133b94804f64af81e8fb9e08bc
Created October 31, 2016 22:04 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@imikh
imikh / setenv.sh
Created September 25, 2016 23:59 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
#!/bin/bash
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password
# Updated to work with Vagrant 1.3.x
# Stage updated sudoers in a temporary file for syntax checking
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.