Skip to content

Instantly share code, notes, and snippets.

View H2so4's full-sized avatar

OkezieE H2so4

  • Salesforce
  • Remote
View GitHub Profile

Keybase proof

I hereby claim:

  • I am h2so4 on github.
  • I am okezie (https://keybase.io/okezie) on keybase.
  • I have a public key ASDIn2osCi7P-vOVQAfJZKN9hy54XigPaTnm8FjZ8Z-higo

To claim this, I am signing this object:

source /etc/lsb-release
if [[ "${DISTRIB_CODENAME}" == "xenial" ]]; then
kernel_version="4.4.0-1052"
elif [[ "${DISTRIB_CODENAME}" == "trusty" ]]; then
kernel_version="4.4.0-1016"
else
echo "!!! YOU MUST UPGRADE TO <= TRUSTY"
fi
apt-get -y autoremove ; apt-get update; apt-get -y install linux-aws linux-image-${kernel_version}-aws
@H2so4
H2so4 / docker-compose.yml
Last active January 15, 2016 23:27
docker monitoring compose
influxsrv:
image: tutum/influxdb:0.8.8
name: influxsrv
volumes:
- ./data:/data
ports:
- "8083:8083"
- "8086:8086"
expose:
- "8090"
@H2so4
H2so4 / .vimrc
Last active January 4, 2016 09:09
" Base file borrowed from JOHN KUGELMAN (Thanks much)
" -------This allows you to paste without the auto-indent craziness---
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install the CloudInit.NET service, 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2008 R2 Core x64 and Windows 2008 SP2 x86 AMIs provided
# by Amazon
#
# To run the script, open up a PowerShell prompt as admin
# PS> Set-ExecutionPolicy Unrestricted
# PS> icm $executioncontext.InvokeCommand.NewScriptBlock((New-Object Net.WebClient).DownloadString('https://raw.github.com/gist/1672426/Bootstrap-EC2-Windows-CloudInit.ps1'))
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
<% unless @chef_requires.empty? %>
<%= @chef_requires.inspect %>.each do |lib|
begin
require lib
rescue LoadError
Chef::Log.warn "Failed to load #{lib}. This should be resolved after a chef run."
end
end
<% end %>
#!/usr/bin/env/ruby
require 'socket'
# AWS API Credentials
AWS_ACCESS_KEY_ID = "your-aws-access-key-id"
AWS_SECRET_ACCESS_KEY = "your-aws-secret-access-key"
# Node details
NODE_NAME = "webserver-01.example.com"
@H2so4
H2so4 / lxc_web_panel_install.sh
Last active November 26, 2015 16:10
Installer for LXC-Web-Panel with fix for displaying IP address in UI
#!/bin/bash
echo ' _ __ _______ __ __ _ _____ _ '
echo '| | \ \ / / ____| \ \ / / | | | __ \ | |'
echo '| | \ V / | \ \ /\ / /__| |__ | |__) |_ _ _ __ ___| |'
echo "| | > <| | \ \/ \/ / _ \ '_ \ | ___/ _\` | '_ \ / _ \ |"
echo '| |____ / . \ |____ \ /\ / __/ |_) | | | | (_| | | | | __/ |'
echo '|______/_/ \_\_____| \/ \/ \___|_.__/ |_| \__,_|_| |_|\___|_|'
echo -e '\n\nAutomatic installer\n'
if [[ "$UID" -ne "0" ]];then
@H2so4
H2so4 / preseed-fragment.seed
Created September 29, 2015 20:09 — forked from lorin/preseed-fragment.seed
Automated partitioning with Ubuntu preseed
# Use LVM for partitioning
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. Preseed this away
d-i partman-lvm/device_remove_lvm boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true