Skip to content

Instantly share code, notes, and snippets.

View joekiller's full-sized avatar

Joseph Lawson joekiller

View GitHub Profile
@joekiller
joekiller / README.md
Created September 23, 2016 20:03
Hardware recommendations for Arch Linux Laptop

If you want to run Arch on a Laptop, use pure Intel hardware as much as possible. Especially for WiFi. Next use NVIDIA hardware if you need a discreet video card. AMD support is lacking to say the least.

@joekiller
joekiller / arch-linux-install dell precision 3510
Last active November 7, 2019 14:02 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt, luks, grub-git, nvme
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# This assumes a wifi only system...
wifi-menu
# sync the clock
timedatectl set-ntp true
@joekiller
joekiller / README.md
Created September 15, 2016 21:07
csd-wrapper.sh to help run openconnect against an old cisco anyconnect vpn
VPN=https://vpn.company.com
alias vpntun="sudo ip tuntap add vpn0 mode tun user `whoami`"
alias vpn="openconnect --csd-wrapper ~/.cisco/csd-wrapper.sh ${VPN} --no-cert-check -i vpn0 -s 'sudo -E /etc/vpnc/vpnc-script'"
@joekiller
joekiller / README.md
Last active November 21, 2016 18:43
alias bash profiles based on client names

Say you support multiple clients or multiple projects but don't want everything on your shell at once. This script in your .bashrc file will allow you to automatically create aliases for any directory that has it's own .bashrc file. It starts a new bash shell so no existing variables are overwritten and you can exit when needed.

For example, say you have project or client named superx and another named johndoe. You create a directory superx and johndoe. Within each you pust a custom .bashrc file and optional .superx-secrets and .johndoe-secrets file and then your shell (upon next login) will detect those files and alias them to the parent directory's name. So if I want superx stuff, I just run superx and vice versa for johndoe.

Some references:

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment http://www.linuxjournal.com/content/tech-tip-dereference-variable-names-inside-bash-functions http://stackoverflow.com/questions/3601515/how-to-check-if-a-v

@joekiller
joekiller / flume.conf
Last active May 25, 2016 02:34
Flume With Solr 6
# example.conf: A single-node Flume configuration
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = spooldir
a1.sources.r1.channels = c1
a1.sources.r1.spoolDir = /tmp/messages
@joekiller
joekiller / perf_test_logstash_kafka_input.sh
Last active March 23, 2016 18:50
Test the performance of the logstash-input-kafka plugin.

Old

1 Thread:
2.86MiB 0:00:32 [  91KiB/s] [  91KiB/s]

4 Threads:
2.86MiB 0:00:31 [93.1KiB/s] [93.1KiB/s]

1 Decorated Thread:
@joekiller
joekiller / jenkins.json
Created October 20, 2015 17:23
Jenkins EC2 Centos 6 codepipeline and codecommit
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Jenkins Stack. Using https://aws.amazon.com/marketplace/ordering/ref=dtl_psb_continue?ie=UTF8&productId=74e73035-3435-48d6-88e0-89cc02ad83ee&region=us-east-1 for CentOS 6",
"Parameters" : {
"KeyName": {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription" : "must be the name of an existing EC2 KeyPair."
@joekiller
joekiller / projectalias.sh
Created October 19, 2015 15:09
Dynamically add project specific files, create an alias to access.
#!/usr/env/bash
secrets=$(whoami)
ROOT_DIRS=$(find . -maxdepth 1 ! -path . -type d ! -path './.*' -print | tr '\n' ' ')
for path in $ROOT_DIRS; do
ALIAS=
[[ -f ${path}/.bashrc ]] && ALIAS=". $HOME/${path}/.bashrc;"
[[ -f ${path}/.${secrets}-secrets ]] && ALIAS="${ALIAS}. $HOME/${path}/.${secrets}-secrets;"
[[ ! -z ${ALIAS} ]] && alias $(basename ${path})="${ALIAS}"
done
@joekiller
joekiller / Vagrantfile
Last active October 1, 2015 20:55
Install Solr-4.8.0 on Centos6 with Tomcat7
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
yum install -y java-1.7.0-openjdk
iptables -I INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
service iptables save
copy_or_get () {
if [ -f "$1" ]; then
cp $1 ./
@joekiller
joekiller / gist:1aaa548cc2f6cfca4410
Created July 10, 2015 18:39
sed for ip to ec2 address
sed -r 's/.*(^[0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ec2-\1-\2-\3-\4.compute-1.amazonaws.com/g'