Skip to content

Instantly share code, notes, and snippets.

View c0psrul3's full-sized avatar

Mike c0psrul3

View GitHub Profile
@c0psrul3
c0psrul3 / cisco_config__switchport_mode_access.Example.log
Created October 11, 2016 23:19
Cisco configuration example for VLAN and Switchport Access Mode
CAT1#
09:59:20: %SYS-5-CONFIG_I: Configured from console by console
CAT1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
CAT1(config)#
CAT1(config)# vlan 5
CAT1(config-vlan)# name marketing
CAT1(config-vlan)# exit
CAT1(config)# vlan 10
CAT1(config-vlan)# name humanresources
@c0psrul3
c0psrul3 / linux_proc_fs_files.list.txt
Created October 13, 2016 11:54
Linux "/proc" filesystem files list
/proc/fb
/proc/fs/aufs/plink_maint
/proc/fs/ext4/sda1/options
/proc/fs/ext4/sda1/mb_groups
/proc/fs/ext4/sda1/es_shrinker_info
/proc/fs/jbd2/sda1-8/info
/proc/bus/pci/00/00.0
/proc/bus/pci/00/02.0
/proc/bus/pci/00/14.0
@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"
@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 / 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 <[email protected]>
# Author: Mike N. <[email protected]>
# $FreeBSD$
#
# PROVIDE: unifi
# REQUIRE: LOGIN
# KEYWORD: shutdown
@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 / setrpath.c
Last active January 11, 2017 20:51
setrpath to change RPATH of Solaris ELF binaries
/************************************************************************/
/* setrpath */
/* */
/* By Davin Milun ([email protected]) */
/* 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 / do_cloud-config.init.yaml
Last active October 30, 2024 14:09
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 / 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