Skip to content

Instantly share code, notes, and snippets.

@jamiekurtz
jamiekurtz / docker-ssh-config-and-run.sh
Created April 10, 2017 19:59
This bash script is used on startup of a Docker container that is intended to simply provide and SSH endpoint within an app environment.
#!/usr/bin/env bash
# This script can add given users as SSH users. Use the following environment variables:
# SSH_USERS="name1 name2 name3"
# SSH_KEY_name1="ssh key for name1"
# SSH_KEY_name2="ssh key for name2"
# SSH_KEY_name3="ssh key for name3"
# You can set MYAPP on line 22 to any arbitrary string
@jamiekurtz
jamiekurtz / ubuntu-mount-ebs-volume.sh
Created October 15, 2016 23:15
Used to mount AWS EBS volume on EC2 Ubuntu
#!/usr/bin/env bash
DEVICE=/dev/xvdf
FOLDER=/data/stuff
sudo mkfs -t ext4 $DEVICE
sudo mkdir -p $FOLDER
echo "$DEVICE $FOLDER ext4 defaults,nofail 0 2" | sudo tee --append /etc/fstab > /dev/null
sudo mount -a
@jamiekurtz
jamiekurtz / ubuntu-new-user-with-ssh.sh
Last active May 16, 2016 18:28
New user (with SSH key) on Ubuntu
sudo adduser --disabled-password newuser
sudo su - newuser
mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
# then copy in public key
# to add new user to sudo group
sudo adduser newuser sudo
@jamiekurtz
jamiekurtz / aws-ec2-ubuntu-trusty-docker.sh
Last active December 5, 2015 01:32
This script is used to install Docker onto a new Ubuntu 14.04 (Trusty) server on AWS EC2
#!/bin/bash
# This script is used to install Docker onto a new Ubuntu 14.04 (Trusty) server on AWS EC2
# (as of 12/4/2015)
# Assumes current user is ubuntu
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
@jamiekurtz
jamiekurtz / log4net.config
Last active August 29, 2015 14:24
log4net rolling log file config
<!-- Don't forget to add the following to app start-up: log4net.Config.XmlConfigurator.Configure(); -->
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="..\\..\\logs\\logfilename.log" />
<appendToFile value="true" />
<maxSizeRollBackups value="-1" />
<countDirection value="1" />
<maximumFileSize value="10MB" />
<rollingStyle value="Composite" />
@jamiekurtz
jamiekurtz / ionic-android-ubuntu
Last active May 10, 2018 17:23
Provisioning script (used primarily for Vagrant) for an Ionic+Android build server on Ubunutu
#!/bin/bash
# some exports needed for this script
# ... don't forget to export these to ~/.bashrc later!
export NPM_PACKAGES=~/.npm_packages
export NODE_PATH=$NPM_PACKAGES/lib/node_modules
export ANDROID_HOME=~/android-sdk-linux
export PATH=$PATH:$NPM_PACKAGES/bin:$NODE_PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
# Install and configure NodeJS
@jamiekurtz
jamiekurtz / install-node-wo-sudo
Last active April 25, 2016 13:08
Configures NPM to allow global package installs without sudo, thereby avoiding the typical permissions issue with updating node packages
# Install NodeJS and related on Ubuntu without requiring sudo on subsequent "npm -g" installs
# Went this direction when certain packages where trying to update global files owned by root...
# ... since the global packages were installed with sudo
# if using Vagrant, recommend to set "privileged: false" on the provisioning script where this code resides
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get -y install git nodejs build-essential
mkdir -p ~/.npm_packages
npm set prefix $HOME/.npm_packages
@jamiekurtz
jamiekurtz / vim-clip-integrate.sh
Created May 15, 2015 01:18
Vim clipboard integration in Debian/Ubuntu
# Vim clipboard integration in Debian/Ubuntu
sudo apt-get remove vim
sudo apt-get install vim-gtk
echo "set clipboard=unnamedplus" >> ~/.vimrc
@jamiekurtz
jamiekurtz / grub.cfg
Last active September 3, 2024 15:38
Grub config for creating my own bootable USB stick
# This grub.cfg file was created by Jamie Kurtz
# Detailed instructions for use will soon be found here: http://www.jamiekurtz.com
# Simplified instructions below
# Sample grub entries... https://wiki.archlinux.org/index.php/Multiboot_USB_drive
# Inspiration from here: http://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/
# Simplified instructions...
# Make sure grub, grub-efi, and xorriso packages are installed and up-to-date
# In your terminal go to directory where want to create the USB image contents
# Run the following to create the necessary folder structure:
@jamiekurtz
jamiekurtz / gist:d325baa979dd3f64f8d1
Created March 6, 2015 03:54
Install Kazam on Fedora
# 1. download zip from https://launchpad.net/kazam
# 2. extract into target folder
# install prerequisites (works on Fedora 21 with Python 3)
sudo yum install python3-distutils-extra python3-dbus intltool
# run the included setup from within the unzipped folder
sudo python3 setup.py install
# Done! Can start with either `kazam` command or find Kazam in the menu