Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile
@sirhopcount
sirhopcount / aws_hosts_completion
Created December 6, 2018 13:43 — forked from lecoueyl/aws_hosts_completion
AWS ec2 instances hostname ssh completion
#
# Autocomplete a ssh command with AWS instances hostname
# Put this file in /etc/bash_completion.d/ (Ubuntu)
#
# File containing ec2 instances hostname
HOSTS=/tmp/aws_hosts_list
_ssh_hosts()
{
@sirhopcount
sirhopcount / aws_hosts_completion
Created December 4, 2018 16:21
AWS ec2 instances hostname ssh completion
#
# Autocomplete a ssh command with AWS instances hostname
# Put this file in /etc/bash_completion.d/ (Ubuntu)
#
# File containing ec2 instances hostname
HOSTS=/tmp/aws_hosts_list
_ssh_hosts()
{
#!/usr/bin/env ruby
require "aws-sdk-core"
require "json"
ami_list = { "AWSAmazonLinuxAMI" => {} }
aws = Aws::EC2::Client.new(:region => 'us-east-1')
aws.describe_regions.regions.each do |region|
#next unless region.region_name == "ap-northeast-1"
@sirhopcount
sirhopcount / aws.zsh
Created October 12, 2018 05:02 — forked from alexsapran/aws.zsh
AWS CLI bash wrapper dot file
_warning(){
echo -e "\e[31m${@}\e[0m"
}
_info(){
echo -e $@
}
_success(){
echo -e "\e[32m${@}\e[0m"
}
@sirhopcount
sirhopcount / asg-ips.sh
Created October 8, 2018 10:19 — forked from wellsie/asg-ips.sh
Autoscaling group ip addresses
#!/bin/bash
GROUP=worker
IDS=$(aws autoscaling describe-auto-scaling-groups \
--auto-scaling-group-name $GROUP \
--query AutoScalingGroups[].Instances[].InstanceId \
--output text)
aws ec2 describe-instances \
--instance-ids $IDS \
--query Reservations[].Instances[].PrivateIpAddress \
/*
* This document has been created with Marked.app <http://markedapp.com>.
* Copyright 2011 Brett Terpstra
* ---------------------------------------------------------------------------
* Please leave this notice in place, along with any additional credits below.
*
* Byword.css theme is based on Byword.app <http://bywordapp.com>
* Authors: @brunodecarvalho, @jpedroso, @rcabaco
* Copyright 2011 Metaclassy, Lda. <http://metaclassy.com>
*/
@sirhopcount
sirhopcount / puppetstrings_output_markdown.md
Created February 22, 2018 09:02
Puppet strings markdown output error

I'm using the following versions of yard and puppet strings:

$ puppet resource package yard provider=puppet_gem
package { 'yard':
  ensure => ['0.9.12'],
}

$ puppet resource package puppet-strings provider=puppet_gem
package { 'puppet-strings':
@sirhopcount
sirhopcount / _README.md
Created January 26, 2018 12:07 — forked from robinsmidsrod/_README.md
Embedded iPXE menu to choose which network adapter to boot from (autodetects up to 10 adapters)

Go into your git checkout folder of ipxe.

Save the below file as nic-menu.ipxe.

Build iPXE like this:

cd src && make EMBED=../nic-menu.ipxe && cd ..

Requirements: current iPXE as of 2013-08-01 (for proper behavior of autoboot with a network device specified, netX feature, PCI vendor/device ID display and inc command)

@sirhopcount
sirhopcount / ubuntu-install.ipxe
Created January 26, 2018 11:13 — forked from robinsmidsrod/ubuntu-install.ipxe
iPXE installer script for Ubuntu Server x64
#!ipxe
echo
echo Starting Ubuntu 10.04.4 x64 installer for ${hostname}
# Hook SAN disk
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.ubuntu
sanhook ${root-path} ||
# Start debian-installer
set base-url http://boot.smidsrod.lan/ubuntu-10.04.4-amd64-server
@sirhopcount
sirhopcount / ubuntu-amd64-installer.ipxe
Created January 26, 2018 11:12 — forked from robinsmidsrod/ubuntu-amd64-installer.ipxe
Boot Ubuntu x64 installer directly from the network. Only iPXE needed
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot ||
# If everything failed, give the user some options
echo Boot from ${base-url} failed