Skip to content

Instantly share code, notes, and snippets.

@hp9390
hp9390 / git+clone+ssh+agent+forward+sudo
Created February 6, 2018 22:35 — forked from scottjacobsen/git+clone+ssh+agent+forward+sudo
Git clone using ssh agent forwarding and sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like:
@hp9390
hp9390 / onchange.sh
Created July 15, 2017 21:35 — forked from senko/onchange.sh
Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@hp9390
hp9390 / pacaur_install.sh
Last active February 23, 2017 19:02 — forked from tadly/pacaur_install.sh
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
# reading and understanding it :)
#
# This scripts purpose is purly to save you a few seconds on your new installation.
#
# Enjoy your time on an awesome system. Arch FTW!

Keybase proof

I hereby claim:

  • I am hp9390 on github.
  • I am noropheos (https://keybase.io/noropheos) on keybase.
  • I have a public key ASDh0Shj_sqrOb_WG5t6CJDJOeH8Dr1vPGKcGS0afKCxZwo

To claim this, I am signing this object:

@hp9390
hp9390 / docker-compose-install.sh
Created June 25, 2016 15:48 — forked from marszall87/docker-compose-install.sh
Simple script for installing latest Docker Compose on CoreOS >= 717.0.0
#!/bin/bash
mkdir -p /opt/bin
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
#!/usr/bin/env bash
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
casks=( $(brew cask list) )
for cask in ${casks[@]}
do
## Other apps:
## Free Download Manager.app
## Irfanview.app
## Video Container Switcher.app
## Snapseed.app
brew install fish
brew install git
brew install htop
brew install jenv
@hp9390
hp9390 / cask_upgrade.sh
Created June 24, 2016 07:20
Script upgrading outdated brew casks
#!/usr/bin/env bash
(set -x; brew update;)
(set -x; brew cask update;)
(set -x; brew cleanup;)
(set -x; brew cask cleanup;)
red=`tput setaf 1`
green=`tput setaf 2`
@hp9390
hp9390 / docker-cleanup
Last active June 6, 2016 18:31 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@hp9390
hp9390 / install.sh
Last active June 6, 2016 18:23 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
#!/usr/bin/env bash
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version