Skip to content

Instantly share code, notes, and snippets.

@wavedocs
wavedocs / openssl.cnf.ini
Last active December 22, 2015 06:59 — forked from garethrees/openssl.cnf.ini
OpenSSL + Config
# Generate Private Key
$ openssl genrsa -out server.key 2048
# Generate CSR
$ openssl req -new -out server.csr -key server.key -config openssl.cnf
# => Fill in info
# Check CSR
$ openssl req -text -noout -in server.csr
# Sign Cert
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf
@wavedocs
wavedocs / stash-install.sh
Last active August 29, 2015 14:23 — forked from nkt/stash-install.sh
Atlassian Stash Install
#!/bin/sh
STASH_VERSION='3.8.0'
wget "https://www.atlassian.com/software/stash/downloads/binary/atlassian-stash-${STASH_VERSION}.tar.gz"
tar xvzf "atlassian-stash-${STASH_VERSION}.tar.gz"
sudo adduser --disabled-login --shell /bin/bash --gecos 'Stash' stash
sudo mv "atlassian-stash-${STASH_VERSION}" /home/stash/stash
@wavedocs
wavedocs / README.md
Last active November 21, 2022 12:06 — forked from mashdot/README.md
Bacula concurrent jobs multiple storage devices client labeled pools debian installation configuration.
Time-stamp: <2012-03-30 Fri 16:56 README.md>
Author....: 'Mash (Thomas Herbert)

TOSHINE-BACULA

Bacula concurrent jobs multiple storage devices client labeled pools Debian installation and configuration.
Please see http://toshine.org/etc for full article.

Bacula Debian Installation.

@wavedocs
wavedocs / sysctl.conf
Last active September 12, 2015 19:01 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1
@wavedocs
wavedocs / ansible-create-user-with-password
Created February 25, 2016 09:11 — forked from 13rac1/ansible-create-user-with-password
Create a user in an Ansible playbook with a set, but unknown password so the account is not locked. Makes it possible to log on the account with a public key. This example requires mkpasswd, but that can be replaced with any other password generator.
---
- hosts: all
gather_facts: yes
##
# Create the password then create the user
#
- name: Users | Generate password for new user
shell: makepasswd --chars=20
register: user_password

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@wavedocs
wavedocs / mongodb_3.2.x.md
Created January 25, 2017 10:36 — forked from leommoore/mongodb_3.2.x.md
Mongo 3.2.x

#MongoDB 3.2.x

##Install MongoDB To install MongoDB on ubuntu from precompiled version.

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.2.5.tgz
gzip -d mongodb-linux-x86_64-ubuntu1404-3.2.5.tgz
tar -xvf mongodb-linux-x86_64-ubuntu1404-3.2.5.tar

Then check put what is in the bin directory

@wavedocs
wavedocs / mongodb_3.2.x_sharding.md
Created January 25, 2017 10:37 — forked from leommoore/mongodb_3.2.x_sharding.md
MongoDB 3.2.x Sharding

#MongoDB 3.2.x Sharding Sharding is used when the database is too large to run on a single server and you need to spread the load across multiple servers. The name itself refers to the breaking (sharding) of the data into seperate groups of data which will reside on different servers.

##Configuration Server Start the server on your server (myserver0)

mongod --configsvr --dbpath /data

On myserver1 start the shard giving the configuration server as the --configdb option

@wavedocs
wavedocs / mongodb_3.2.x_security.md
Created January 25, 2017 10:37 — forked from leommoore/mongodb_3.2.x_security.md
MongoDB 3.2.x Security

#MongoDB 3.2.x Security

##Network Ports The standard ports used by mongo are:

ProcessRoleDefault Port

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application