Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/bash
yum install -y yum-utils
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast
yum update -y
yum install docker-ce -y
@donilan
donilan / jail.local
Created August 4, 2016 16:30
/etc/fail2ban/jail.local
[DEFAULT]
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
# ban a host which matches an address in this list. Several addresses can be
# defined using space separator.
ignoreip = 127.0.0.1
# "bantime" is the number of seconds that a host is banned.
bantime = 3600
# A host is banned if it has generated "maxretry" during the last "findtime"
@donilan
donilan / TraceKitSupplement.js
Created July 19, 2016 05:08 — forked from devinrhode2/TraceKitSupplement.js
Stuff I've added to my error reporting/handling stuff in addition to TraceKit.js, ideally in a few months I don't write any of this code
function exceptionalException(message) {
'use strict';
if (exceptionalException.emailErrors !== false) {
exceptionalException.emailErrors = confirm('We had an error reporting an error! Please email us so we can fix it?');
}
}
//test
//exceptionalException('try 1!');
//exceptionalException('try 2!');
FROM richarvey/nginx-php-fpm
RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data
WORKDIR /usr/share/nginx/html
@donilan
donilan / Dockerfile
Last active June 27, 2018 08:05
Mina deploy.rb with Docker-passenger, Pull this docker at registry.aliyuncs.com/doni/passenger if you are work from China.
FROM phusion/passenger-full
# Set correct environment variables.
ENV HOME /root
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
EXPOSE 80
@donilan
donilan / my_csv.rb
Created December 24, 2015 06:38
A ruby CSV class that extends build-in CSV and add ability that keeping original line
require 'csv'
class MyCsv < CSV
# The line of the last row read from this file.
attr_reader :line
def shift
if @_before_lineno != @lineno
@_before_pos = pos
@_before_lineno = @lineno
end
#!/bin/bash
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel mysql-devel libxml2-devel libxslt-devel unixODBC-devel sqlite sqlite-devel -y
# Alias shasum to == sha1sum (will prevent some people's scripts from breaking)