This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Try to close the reader if the io.Closer interface is implemented | |
if closer, ok := src.(io.Closer); ok { | |
closer.Close() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <<EOF >> /etc/security/limits.conf | |
root soft nofile 65536 | |
root hard nofile 65536 | |
root soft stack 16384 | |
root hard stack 32768 | |
root soft nproc 16384 | |
root hard nproc 32768 | |
* soft nofile 65536 | |
* hard nofile 65536 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.codec.digest.HmacUtils; | |
import java.nio.ByteBuffer; | |
public class HotpUtil { | |
private static final int LONG_BYTE_SIZE = Long.SIZE / Byte.SIZE; | |
private static final int MAX_DIGITS = 9; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcregrep -nM '^.+\n(\w+\.)+\w*Exception:.*(\n\s+at .+|\nCaused by: .+(\n### .+)*)+' log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tcpProxy = require('tcp-proxy'); | |
var servers = []; | |
[ | |
{dst: '192.168.33.10:3306', src: 3306}, | |
{dst: '192.168.33.10:6379', src: 6379}, | |
{dst: '192.168.33.10:11211', src: 11211} | |
].forEach(function(config) { | |
var destHost = config.dst.split(':')[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -uroot --opt {database} > {database}.dump | |
mysqladmin -uroot create {database} | |
mysql -uroot {database} < {database}.dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm | |
yum install mysql mysql-community-devel mysql-community-server | |
edit my.cnf | |
mysql_install_db | |
/etc/init.d/mysqld start | |
CREATE DATABASE mydb; | |
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypass' WITH GRANT OPTION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Preference > JavaScript > Libraries | |
* Node.js vXX.XX Core Modules -> check | |
* Node.js Globals -> check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: base-vagrant | |
# Recipe:: nodebrew | |
# | |
# Copyright 2013, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
# install nodebrew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
JENKINS_HOME= | |
BACKUP_LOCAL_DIR=backup | |
RETENTION_DAYS=14 | |
TODAY=`date +'%Y-%m-%d'` |
NewerOlder