Skip to content

Instantly share code, notes, and snippets.

View 04n0's full-sized avatar

04n0 04n0

  • BA, SK
View GitHub Profile
@04n0
04n0 / ansible-workshop.service
Last active March 12, 2018 20:14
pyconsk-ansible-workshop - ansible-workshop.service
[Unit]
Description=ansible-workshop
After=network.target
[Service]
ExecStart=/bin/sh -c '/usr/bin/python3 /opt/ansible-workshop/pycon.py >> /opt/ansible-workshop/pycon.log 2>&1'
Restart=on-abort
WorkingDirectory=/opt/ansible-workshop/
User=workshop
RemainAfterExit=yes
@04n0
04n0 / nginx.conf.j2
Last active March 12, 2018 20:14
pyconsk-ansible-workshop - nginx.conf.j2
user nginx;
pid /var/run/nginx.pid;
worker_processes {{ ansible_processor_vcpus }};
worker_rlimit_nofile 409600;
events {
worker_connections {{ nginx_max_conns }};
multi_accept on;
}
#!/bin/sh
date > /etc/box_build_time
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
# Set computer/hostname
COMPNAME=vagrant-macos
scutil --set ComputerName "${COMPNAME}"
scutil --set HostName "${COMPNAME}"
# Packer passes boolean user variables through as '1', but this might change in
#!/bin/sh
# This script adds a Mac OS Launch Daemon, which runs every time the
# machine is booted. The daemon will re-detect the attached network
# interfaces. If this is not done, network devices may not work.
PLIST=/Library/LaunchDaemons/com.github.04n0.osx-vm-templates.detectnewhardware.plist
cat <<EOF > "${PLIST}"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@04n0
04n0 / keybase.md
Created August 12, 2017 12:25
keybase.io

Keybase proof

I hereby claim:

  • I am 04n0 on github.
  • I am 04n0 (https://keybase.io/04n0) on keybase.
  • I have a public key ASDOHtLIOe-Z8jpW_7VR2wkyAL3g367wCfkp3DbJBA7d0go

To claim this, I am signing this object:

@04n0
04n0 / sed1line.txt
Created June 11, 2017 19:19
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor)
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
@04n0
04n0 / zsh_to_fish.py
Created June 3, 2017 17:44 — forked from dvdbng/zsh_to_fish.py
Migrate zsh history to fish
import os
import re
def zsh_to_fish(cmd):
return (cmd.replace('&&', '; and ')
.replace('||', '; or '))
def is_valid_fish(cmd):
@04n0
04n0 / dockerers.md
Last active March 12, 2018 20:15
unsorted stuff and comments

There are many types of Dockerfile practices

common dude

RUN apt-get update && \
    apt-get install -y nodejs npm && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
@04n0
04n0 / ansible_loops.markdown
Last active April 8, 2017 21:04
ansible notes

loop - create multiple files from list (file_id) in vars

vars/ file with defined variable as list

file_id:
  - test1
  - test2
  - test3
 - test4
@04n0
04n0 / tmux-cheatsheet.markdown
Created March 5, 2017 09:19 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname