Skip to content

Instantly share code, notes, and snippets.

View nealian's full-sized avatar

Ian Neal nealian

View GitHub Profile
@nealian
nealian / sensu.repo
Created March 2, 2019 00:46
Sensu yum repo
[sensu]
name=sensu
baseurl=https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch/
gpgkey=https://repositories.sensuapp.org/yum/pubkey.gpg
gpgcheck=1
enabled=1
@nealian
nealian / kubernetes.repo
Created February 7, 2019 23:10
Kubernetes EL7 x86_64 yum repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kube*
@nealian
nealian / vbox.buttemplate
Created April 19, 2017 23:55
A but.sh template for .vbox files for specific windows guests
<?xml version=\"1.0\"?>
<VirtualBox xmlns=\"http://www.innotek.de/VirtualBox-settings\" version=\"1.14-linux\">
<Machine uuid=\"{${vbox_uuid}}\" name=\"${vbox_name}\" OSType=\"${vbox_OSType}\" snapshotFolder=\"${vbox_snapshotFolder}\">
<Description>${vbox_Description}</Description>
<MediaRegistry>
<HardDisks>
<HardDisk uuid=\"{${vbox_vmdk_uuid}}\" location=\"${vbox_vmdk_location}\" format=\"VMDK\" type=\"Normal\"/>
</HardDisks>
</MediaRegistry>
<ExtraData>
@nealian
nealian / vmdk_raw.buttemplate
Created April 19, 2017 23:52
A but.sh template for .vmdk files for raw disks
# Disk DescriptorFile
version=1
CID=${vmdk_cid}
parentCID=ffffffff
createType="fullDevice"
# Extent description
RW ${vmdk_sectors} FLAT "${vmdk_dev}" ${vmdk_skip:-0}
# The disk Data Base
@nealian
nealian / README.md
Last active March 15, 2018 09:14
A but.sh template to generate a systemd unit file (such as .service)

systemd-unit file buttemplate

This is a but.sh template for creating a systemd unit file (.automount, .device, .mount, .path, .scope, .service, .slice, .socket, .swap, .timer, ...)

Prerequisites

This, of course, requires but.sh The template itself requires only bash and gnu-coreutils.

Variables

The valid section names are:

@nealian
nealian / README.md
Last active April 5, 2017 18:33
A but.sh template to generate a .desktop file

.desktop file buttemplate

This is a but.sh template for creating .desktop files, which are used for menu entries and links in most Linux desktop environments. Built against the specification

Prerequisites

This, of course, requires but.sh The template itself requires only bash and gnu-coreutils.

Variables

Required:

  • ENTRY_TYPE -- one of Application, Link, or Directory
@nealian
nealian / README.md
Last active April 4, 2017 18:11
A but.sh template to generate a SysV init script

sysvinit buttemplate

This is a but.sh template for creating /etc/rc.d/init.d scripts. (Slightly based on the EPEL init-script template, and intended for an el6 machine, though I'm sure it would work with many, many more systems.)

This is actually a modification of a different gist, for jar init scripts on el6, but I soon realized that it could be used for any forking daemon just fine.

Prerequisites

This, of course, requires but.sh The template itself requires only bash and gnu-coreutils.

@nealian
nealian / README.md
Last active March 2, 2019 19:10
A but.sh template to generate a SysV init script for running a .jar as a daemon

sysvinit-jar buttemplate

This is a but.sh template for creating /etc/rc.d/init.d scripts for Java jar files. (Slightly based on the EPEL init-script template, and intended for an el6 machine, though I'm sure it would work with many, many more systems.)

Other daemons?

After making this template, of course I realized that this could very easily be modified to do any other daemon, so I did just that, though it was honestly pretty trivial.

Prerequisites

This, of course, requires but.sh.

@nealian
nealian / NetworkingProject1.cpp
Created October 25, 2016 00:15
Networking Project 1
// based on work from http://cs.baylor.edu/~donahoo/practical/CSockets/practical/
/*
* C++ sockets on Unix and Windows
* Copyright (C) 2002
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@nealian
nealian / Makefile
Created October 24, 2016 19:54
My old generic C Makefile
EXCL =
#Include every .c file that will become an object in EXCL, as well as any other .c files to not make in this dir
C_FILES = $(filter-out $(EXCL),$(wildcard *.c))
PROGRAMS = $(C_FILES:.c=)
# For each main program named <main>.c, make a variable <main>_OBJS with .o files to add,
# and <main>_LIBS with libraries to link with -l
# Everything after this is generic