Skip to content

Instantly share code, notes, and snippets.

View geekbass's full-sized avatar

Weston Bassler geekbass

  • Emburse
  • Columbus, Ohio
View GitHub Profile
mkdir -pv mesos-dns && tee mesos-dns/config.json <<'EOF'
{
"zk": "zk://ZK1:2181,ZK2:2181,ZK3:2181/mesos",
"masters": ["MASTER1:5050", "MASTER2:5050", "MASTER3:5050"],
"refreshSeconds": 60,
"ttl": 60,
"domain": "pick.your.domain.com",
"port": 53,
"resolvers": ["dns_ip1", "dns_ip2", "dns_ip3"],
"timeout": 5,
sudo docker run -d --name mesos-dns -p 53:53/udp -p 8123 -v "$PWD/mesos-dns/config.json:/config.json" -v "$PWD/mesos-dns/logs:/tmp" mesosphere/mesos-dns:0.5.2 /usr/bin/mesos-dns -v=2 -config=/config.json
@geekbass
geekbass / mac-bash-profile
Created October 19, 2016 17:59
bash profile for macbook (prompt, python, spark and alias). Copy and paste to .bash_profile
# Add userspace python binaries to path - 2016.07.12
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/wb/Library/Python/2.7/bin
# java home
export JAVA_HOME=`/usr/libexec/java_home`
# Alias List
alias ll='ls -l'
# Bash prompt
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:CreateTags",
"ec2:DescribeInstances",
"ec2:CreateVolume",
"ec2:DeleteVolume",
"ec2:AttachVolume",
@geekbass
geekbass / check-user-exist.sh
Created October 12, 2017 13:31
Check to see if a User exists. If so break with the check on move on.
#!/bin/bash
COUNTER=0
USER='blah'
while [ $COUNTER -lt 10 ]; do
if [ `id -u $USER 2>/dev/null || echo -1` -ge 0 ]; then
echo 'User Found... Moving on...'
break
else
@geekbass
geekbass / get-pub-ip.sh
Last active March 19, 2018 14:27
Get the public facing IP of a node
#!/bin/sh
set -o nounset -o errexit
curl -fsSL https://ipinfo.io/ip
@geekbass
geekbass / dcos_agent_ami
Created May 19, 2018 23:08
Packer DC/OS Agent AMI Provisioners
"provisioners": [
{
"type": "shell",
"remote_path": "/home/centos/agent-setup.sh",
"script": "agent-setup.sh"
},
{
"type": "ansible-local",
"playbook_file": "ansible/aws-packer.yml",
"playbook_dir": "ansible",
@geekbass
geekbass / dcos_setup.sh
Created May 19, 2018 23:23
dcos agent setup first provisioner
#!/bin/bash
set -e
# Install epel-release for later
sudo yum install -y epel-release wget curl
# Setup Python
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
sudo rm -rf get-pip.py
@geekbass
geekbass / default.conf
Last active June 8, 2018 21:00
Spark on DC/OS UI Proxy
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://driverforss-rva-processing.spark-2.2.mesos:4040/jobs/;
sub_filter_types text/html;
sub_filter_once off;
sub_filter '="/' '="/service/spark-jobs/';
@geekbass
geekbass / repo-reset.md
Created June 27, 2018 18:37 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A