Skip to content

Instantly share code, notes, and snippets.

View wallentx's full-sized avatar
:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡

William Allen wallentx

:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡
View GitHub Profile
@wallentx
wallentx / slack.sh
Created October 5, 2018 16:43 — forked from andkirby/slack.sh
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@wallentx
wallentx / sysv.init.script.to.systemd.unit.file.md
Created June 19, 2018 19:31 — forked from frostytear/sysv.init.script.to.systemd.unit.file.md
Convert SysV Init scripts to Systemd Unit File

Let's say you have a SysV Init Script named foo

  1. Copy the file to /etc/init.d/foo

  2. Enable the SysV service: chkconfig --add foo

  3. Enable the SysV service: chkconfig foo on

  4. Start the service: service foo start. After this, systemd-sysv-generator will generate this file /run/systemd/generator.late/foo.service, copy this file to /etc/systemd/system by running: cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service

  5. Edit /etc/systemd/system/foo.service by running systemctl edit foo.service, add in the following line to foo.servie (this makes the service installable)

[Install]

# INCIDENT DATE - INCIDENT TYPE
## Meeting
#### Waiving meetings
In some cases the IC might determine that a PM meeting for the incident isn't needed.
If the IC decides to waive the meeting please replace the `Meeting` section with a
note indicating the meeting has been waived (example: `Meeting waived: Paul Mooring`)
@wallentx
wallentx / lang.map.diff
Created January 10, 2018 01:46 — forked from tkfm-yamaguchi/lang.map.diff
source-highlight's language definition file for YAML
---/usr/share/source-highlight/lang.map.old
+++/usr/share/source-highlight/lang.map
@@ -169,3 +169,5 @@
groovy = groovy.lang
json = json.lang
feature = feature.lang
+yaml = yaml.lang
+yml = yaml.lang
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level
@wallentx
wallentx / ask.sh
Created November 7, 2017 23:11
Bash General-Purpose Yes/No Prompt Function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://djm.me/ask
local prompt default reply
while true; do
@wallentx
wallentx / encrypt-centos.org-6-ami.json
Created October 23, 2017 15:54 — forked from razorsedge/encrypt-centos.org-6-ami.json
Packer templates to copy and encrypt a Marketplace AMI.
{
"description": "Copy the centos.org CentOS 6 AMI into our account so that we can add boot volume encryption.",
"min_packer_version": "0.11.0",
"variables": {
"aws_region": "us-east-1",
"aws_vpc": null,
"aws_subnet": null,
"ssh_username": "centos"
},
"builders": [
@wallentx
wallentx / remote-ssh-kube-commands.sh
Created July 25, 2017 21:17 — forked from cmcconnell1/remote-ssh-kube-commands.sh
Run remote command_list on all of the specified kubernetes clusters in AWS EC2: controllers, etcd, or workers
#!/usr/bin/env bash
#
# Author: Chris McConnell
#
# Summary:
# Run remote command_list on all of the specified kubernetes clusters: controllers, etcd, or workers.
#
# Why:
# We have kubernetes and want to run CM jobs / commands on the kube nodes, but CoreOS doesnt have python etc. on it so we can't use CM tools here unless we hack 'em up (which shouldn't), so shell always works.
# Plan to continue to build tools on this and we can take output of this script and slurp up into database, feed to graylog, etc.
@wallentx
wallentx / Jenkinsfile
Created June 17, 2016 22:49 — forked from chinshr/Jenkinsfile
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}