Skip to content

Instantly share code, notes, and snippets.

View baldwinsung's full-sized avatar

Baldwin Sung baldwinsung

View GitHub Profile
@baldwinsung
baldwinsung / gist:b8bf5bd3fa7152ece2cbd77eb41cf91b
Created October 22, 2024 18:29
sed get rid of whitespace
cat foo | sed 's/^[[:space:]]*//g'
@baldwinsung
baldwinsung / gist:0660ded205ef2e8663cf2e1c0754886e
Created October 21, 2024 22:12
just need the ip network. not the entire ip address
#!/usr/bin/env python3
import re
import sys
foo = "192.168.1.1"
bar = re.sub (r'\b(\d+\.\d+\.\d+)\.\d+\b', r'\1.0', foo )
print (bar)
@baldwinsung
baldwinsung / simple-install-config-puppet.bash
Created March 31, 2017 04:36
Simple Installation & Configuration of Puppet
ansible digitalocean-all -m yum -a “name=https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm state=present”
ansible droplet1-west -m yum -a "name=puppetserver state=latest"
ansible digitalocean-all -m yum -a "name=puppet state=latest"
ansible droplet1-west -m service -a "name=puppetserver enabled=yes state=restarted"
ansible digitalocean-all -m yum -a "name=puppet state=latest"
ansible digitalocean-all -m service -a "name=puppet enabled=yes state=restarted"
ansible droplet1-west -m shell -a "/opt/puppetlabs/bin/puppet cert list --all"
ansible droplet1-west -m shell -a "/opt/puppetlabs/bin/puppet cert sign --all"
#!/bin/bash
printf "test\n"