Skip to content

Instantly share code, notes, and snippets.

View sween's full-sized avatar
💭
Mostly Good Intentions

Ron Sweeney sween

💭
Mostly Good Intentions
View GitHub Profile
#!/usr/bin/env python
# --------------------------------------------------------------------------
# "THE TEA-WARE LICENSE":
# This code was written by David Reid <zathrasorama@gmail.com>
# As long as you retain this notice you can do whatever you want with this
# stuff. If we meet some day, and you think this stuff is worth it, you can
# buy me a cup of tea in return.
# --------------------------------------------------------------------------
WorkflowPurge
s c=0
&sql(DECLARE tieCursor CURSOR FOR
SELECT
ID into :ID
@sween
sween / lifecycle.tf
Created March 18, 2019 17:51
Lifecycle
lifecycle {
ignore_changes = ["ami"]
}
script "install_something" do
interpreter "bash"
user "root"
cwd "/tmp"
code <<-EOH
#insert bash script
EOH
end
@sween
sween / getmavenaws.sh
Created October 26, 2017 14:46
Simple maven install AWS
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
ipcs -m | cut -d' ' -f2 | grep '^[0-9]' | while read $x; do ipcrm -m $x; done
Here's what the individual pieces do:
ipcs -m - This command lists all current shared memory segments. (Using -s would list semaphores, etc.)
cut -d' ' -f2 - This command cuts 2nd column from the ipcs output, using spaces as its delineating mark.
grep '^[0-9]' - This command only allows results which begin with a number to pass through. (We don't want the header output from ipcs to mess with our process.)
while read $x... - This command iterates over the output from the previous commands—which, by this point, will be the identifying number belonging to each shared memory segment—and runs the ipcrm IPC removal command against that output.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Create an EC2 instance, set up Apache, and create Route53 A records",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
#!/bin/bash
AWS_CONFIG_FILE="~/.aws/config"
echo $1
sudo mkfs -t ext4 $1
sudo mkdir /s3-backup-test
sudo chmod -R ugo+rw /s3-backup-test
sudo mount $1 /s3-backup-test
top -c -p $(pgrep -d',' -f cache)