Skip to content

Instantly share code, notes, and snippets.

@dqduc
dqduc / BackuptoS3_Snapshots
Created October 28, 2015 03:53 — forked from allenk1/BackuptoS3_Snapshots
Powershell script to backup flat files to S3 and then create EBS snapshots
# +---------------------------------------------------------------------------
# | File : BackuptoS3_Snapshots.ps1
# | Version : 1.0
# | Purpose : Backs up to S3 & creates EBS snapshots
# | Synopsis:
# | Usage : .\BackuptoS3_Snapshots.ps1
# +----------------------------------------------------------------------------
# |
# | File Requirements:
# | Must have AWS S3 CLI installed & Powershell tools
@dqduc
dqduc / ask.sh
Created October 3, 2015 04:09
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@dqduc
dqduc / gist:a3ca06695284ae60ebd8
Created September 30, 2015 08:37 — forked from jprante/gist:10666960
Elasticsearch configuration for high sustainable bulk feed

Elasticsearch configuration for high sustainable bulk feed

Test on single node, MacBook Pro, 16 GB RAM, 1TB SSD, OS X Maverick

ES 1.1.0 with Java 8, G1 GC, 12 GB heap

/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -Xms12g -Xmx12g -Djava.awt.headless=true -XX:+UseG1GC -Delasticsearch -Des.foreground=yes -Des.path.home=/Users/es/elasticsearch-1.1.0 -cp :/Users/es/elasticsearch-1.1.0/lib/elasticsearch-1.1.0.jar:/Users/es/elasticsearch-1.1.0/lib/:/Users/es/elasticsearch-1.1.0/lib/sigar/ org.elasticsearch.bootstrap.Elasticsearch

Node

##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing

##TUNING##

Configuration

System: set file descriptors to 32K or 64K

vim /etc/security/limit.conf

@dqduc
dqduc / watch.sh
Last active August 29, 2015 14:22 — forked from mikesmullin/watch.sh
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
#! /bin/bash
#
# backup_redmine.sh
# modified by ronan@lespolypodes.com
# Inspiration: https://gist.github.com/gabrielkfr/6432185
#
# Distributed under terms of the MIT license.
# -- VARS
DAY=`date +"%Y%m%d"`
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
<VirtualHost *:80>
ServerName projects.littlestreamsoftware.com
RewriteEngine On
# Redirect any non HTTPS requests to the HTTPS server
RewriteCond %{HTTP_HOST} ^projects.littlestreamsoftware.com$ [NC]
RewriteRule ^(.*)$ https://projects.littlestreamsoftware.com$1 [R=301,L]
Include /etc/apache2/common/hide-svn
@dqduc
dqduc / Customer.cs
Last active August 29, 2015 14:16 — forked from ThomasArdal/Customer.cs
namespace ConsoleApplication1
{
public class Customer
{
public int Zipcode { get; set; }
}
}