Skip to content

Instantly share code, notes, and snippets.

View c0psrul3's full-sized avatar

Mike c0psrul3

View GitHub Profile
@c0psrul3
c0psrul3 / graphite-api.wsgi
Last active August 21, 2017 17:53
Graphite-api config and uWSGI start (for use with Grafana)
[uwsgi]
processes = 2
http-socket = localhost:8001
uid = 165
gid = 165
module = graphite_api.app:app
daemonize2 = /var/log/uwsgi-graphiteapi.log
env = GRAPHITE_API_CONFIG=/usr/local/etc/graphite-api.yaml
@c0psrul3
c0psrul3 / TrueOS_EFI_boot_manual_setup.txt.md
Last active February 6, 2017 16:34
TrueOS EFI boot re-configure, from legacy PCBSD update using GRUB.

These instructions were originally written for use of GELI with EFI on TrueOS. They can also be applied to "upgraded" installs, which are coming from PCBSD.. see: [trueos/trueos-core#114]

This may help you manually setup EFI booting

...as TrueOS does not support GRUB and upgrades using pc-updatemanager will not affect available boot environments in, using a GRUB boot loader.


@c0psrul3
c0psrul3 / dos2unix.sh
Created January 26, 2017 19:25 — forked from jappy/dos2unix.sh
Shell script to convert files with CRLF to LF (Mac/Linux)
#! /bin/sh
for x
do
echo "Converting $x"
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done
@c0psrul3
c0psrul3 / do_cloud-config.init.yaml
Last active May 11, 2024 09:40
Digital Ocean cloud-init / cloud-config / droplet metadata usage
#
#DO droplet metadata intro + for DO-API
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata#how-to-retrieve-droplet-metadata#digitalocean-api]
#
#intro to cloud-config scripting (source of following examples)
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting]
#
#howto
# [https://www.digitalocean.com/community/tutorials/how-to-use-cloud-config-for-your-initial-server-setup]
#
@c0psrul3
c0psrul3 / setrpath.c
Last active January 11, 2017 20:51
setrpath to change RPATH of Solaris ELF binaries
/************************************************************************/
/* setrpath */
/* */
/* By Davin Milun (milun@cs.buffalo.edu) */
/* Last modified: Sun Feb 26 12:21:06 EST 1995 */
/* */
/* Program to set the RPATH in an ELF executable. */
/* However, it cannot set the RPATH longer than the RPATH set at */
/* compile time. */
/* */
@c0psrul3
c0psrul3 / nginx.openrc.sh
Created January 11, 2017 17:04
Nginx init script for TrueOS / OpenRC
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
extra_commands="configtest"
extra_started_commands="upgrade reload"
description="Robust, small and high performance http and reverse proxy server"
description_configtest="Run nginx' internal config check."
description_upgrade="Upgrade the nginx binary without losing connections."
@c0psrul3
c0psrul3 / unifi.openrc.sh
Last active January 18, 2017 00:40
UniFi 5 start/stop script for OpenRC on TrueOS
#!/sbin/openrc-run
#
# Original Author: Mark Felder <feld@FreeBSD.org>
# Author: Mike N. <c0psrul3@gmail.com>
# $FreeBSD$
#
# PROVIDE: unifi
# REQUIRE: LOGIN
# KEYWORD: shutdown
@c0psrul3
c0psrul3 / elasticsearch.openrc.sh
Last active January 20, 2017 14:40
Elasticsearch rc start/stop script for initrc and openrc on TrueOS
#!/usr/bin/env bash
name="elasticsearch"
: ${es_user:=elasticsearch}
: ${es_group:=elasticsearch}
# set config dir (-Epath.conf)
: ${es_pathconf:=/opt/elasticsearch/config}
: ${es_pidfile:=/var/run/elasticsearch/elasticsearch.pid}
: ${es_tmpdir:=/tmp/elasticsearch}
@c0psrul3
c0psrul3 / couchdb-ec2-install.sh
Created December 15, 2016 12:01 — forked from msmith/couchdb-ec2-install.sh
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"