$ sudo su
$ apt-get update
$ apt-get install s3cmd automysqlbackup
$ s3cmd --configure
# enter access key and secret and other details
$ vim /etc/default/automysqlbackup
# Set these variables
# USERNAME
# PASSWORD
This file contains hidden or 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
description "Tomcat Server" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 10 5 | |
setuid tomcat | |
setgid tomcat |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
This file contains hidden or 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
#!/usr/bin/env bash | |
sudo locale-gen en_US.UTF-8 | |
sudo update-locale LANG=en_US.UTF-8 | |
sudo update-locale LC_ALL=en_US.UTF-8 | |
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - | |
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev nodejs | |
ln -s /usr/bin/nodejs /usr/bin/node |
This file contains hidden or 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
-server | |
-Xms2048m | |
-Xmx2048m | |
-XX:NewSize=512m | |
-XX:MaxNewSize=512m | |
-XX:PermSize=512m | |
-XX:MaxPermSize=512m | |
-XX:+UseParNewGC | |
-XX:ParallelGCThreads=4 | |
-XX:MaxTenuringThreshold=1 |
This file contains hidden or 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
-server | |
-Xms2g | |
-Xmx2g | |
-Xss16m | |
-XX:+UseConcMarkSweepGC | |
-XX:+CMSParallelRemarkEnabled | |
-XX:ConcGCThreads=4 | |
-XX:ReservedCodeCacheSize=128m | |
-XX:+AlwaysPreTouch | |
-XX:+TieredCompilation |
This file contains hidden or 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 | |
# | |
# USAGE: wait_until_done PID | |
# | |
# wait_until_done watches a process passed in as the first argument waits until | |
# it finishes | |
# | |
# Print the header comment from this file, ducking the shebang line, and stopping a the first line that doesn't start with a hash | |
function print_header_comment { |
This file contains hidden or 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
def my_fun | |
vals = [] | |
(1..5).each do |i| | |
puts "my_fun i=#{i}" | |
begin | |
handle_catchable_errors do | |
vals << unsafe_fun(i) | |
end | |
rescue KnownError => e |
This file contains hidden or 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
// find a game object in the active scene | |
using System.Linq; | |
GameObject worldGameObject = | |
GameObject.FindGameObjectsWithTag("World").ToList().Find(o => o.scene == activeScene); | |
if (worldGameObject != null) | |
{ | |
Debug.Log("SetTrigger: SceneExit" + worldGameObject.name); | |
worldGameObject.GetComponent<Animator>().SetTrigger("SceneExit"); | |
} | |
else |
This file contains hidden or 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
# find them in a queue | |
queue = Sidekiq::Queue.new("default") | |
jobs = queue.map do |job| | |
if job.klass == '[JOB_CLASS]' | |
{job_id: job.jid, job_klass: job.klass, arguments: job.args} | |
end | |
end.compact | |
# the retry queue | |
retries = Sidekiq::RetrySet.new.select |