Skip to content

Instantly share code, notes, and snippets.

View necrose99's full-sized avatar

Michael L. necrose99

View GitHub Profile
@necrose99
necrose99 / vup
Last active August 29, 2015 14:18 — forked from alexander-bauer/vup
#!/bin/bash
# This script bumps the version number of a Go project. The variable "Version"
# should be declared as a constant in the file that matches the name of the
# project. For example, a project contained in example/ should declare Version
# in example.go.
#
# To use: vup <level>
#
# <level> is the depth of the bump, determined by number of periods
# to the left of the number. For example, bumping v1 to v2 is a level
# 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() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@necrose99
necrose99 / archroot.sh
Created May 18, 2016 02:37 — forked from prurigro/archroot.sh
An overlayfs-based chroot management script for deployable arch build environments
#!/usr/bin/env bash
#
# archroot
# An overlayfs chroot management script for deployable arch build environments
#
# Version 1.18
#
# Written by Kevin MacMartin
# Released under the MIT license
#!/bin/bash
# Created Fri Mar 21 2014
# This is a fork of https://gist.github.com/SeonghoonKim/4378896
# This script will download, install and start
# the following items on CentOS 6.5:
# MongoDB
# OpenJDK 1.7.0
# ElasticSearch 0.90.1
# Graylog2 server 0.20.1
# Graylog2 web interface 0.20.1
@necrose99
necrose99 / gzip-demo.py
Created July 5, 2017 18:10 — forked from dreikanter/gzip-demo.py
Create tar.gz archive with Python, unpack files back and check the result
# Python gzip demo: create and unpack archive
import os
import random
import string
import glob
import tarfile
import shutil
import filecmp
#/bin/python3
#https://www.pythonconverter.com/
# -*- coding: utf-8 -*-
import re
import distutils.sysconfig as sysconfig
import os
__doc__ = '''set-me-up.
Usage:
set-me-up <projectdir>
@necrose99
necrose99 / caddy
Created May 4, 2018 03:04 — forked from sebastianmarkow/caddy
caddy web server openrc startup script
#!/sbin/openrc-run
description="Caddy web server"
description_reload="Reload configuration"
extra_started_commands="reload"
: ${CADDY_CONF:=/etc/caddy/Caddyfile}
: ${CADDY_PIDFILE:=/var/run/caddy.pid}
: ${CADDY_USER:=caddy}
@necrose99
necrose99 / README.md
Created February 26, 2020 05:10 — forked from kwk/README.md
Forgot to sign-off commits?

No problem,

run

git filter-branch --msg-filter "cat - && echo && echo 'Signed-off-by: Your Name <Your.Name@example.com>'" HEAD~2..HEAD

To sign-off the last two commits.

Then force to push them to the remote repo with the -f option:

@necrose99
necrose99 / 00-gentoo-installation-partitioning.bash
Last active September 30, 2022 01:40 — forked from renich/00-gentoo-installation-partitioning.bash
Install Gentoo on BtrFS subvolumes + UEFI
#!/usr/bin/env bash
# WARNING!!
# This will obliterate all the data in your partition!! (not actually true, but act as if it was)
# Do NOT execute this script if you don't fully understand it!
# a few vars
amount_of_swap=$( free --si -g | grep Mem: | gawk '{ print $2 + 1}' )
# create directories