Skip to content

Instantly share code, notes, and snippets.

View adeubank's full-sized avatar
🌳

Allen Eubank adeubank

🌳
View GitHub Profile
@adeubank
adeubank / finding_sidekiq_jobs.rb
Created August 29, 2018 18:21
Deleting Sidekiq Jobs From Queue, Scheduled, and Retry
# 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
// 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
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
@adeubank
adeubank / tomcat.conf
Created December 21, 2015 22:42
Tomcat Upstart service with open JDK 8 for Ubuntu 14.04
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
setuid tomcat
setgid tomcat
@adeubank
adeubank / INSTALL.md
Last active February 3, 2018 19:39
Setting up automysqlbackup for backups everyday at 3AM and then saving with S3. Need to configure s3cmd with credentials and automysqlbackup. Assumes that all the backups are stored in `/backups`
$ 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
#!/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 {
@adeubank
adeubank / idea64.exe.vmoptions
Created June 7, 2017 17:08 — forked from edwardbeckett/idea64.exe.vmoptions
Java 8 Intellij 64 JVM Options
-server
-Xms2g
-Xmx2g
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:ReservedCodeCacheSize=128m
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
@adeubank
adeubank / IntelliJ_IDEA__Perf_Tuning.txt
Last active June 7, 2017 17:07 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@adeubank
adeubank / setup_php70_stack.sh
Last active May 5, 2017 17:06 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@adeubank
adeubank / ruby-vagrant-provision.sh
Last active January 15, 2016 03:54 — forked from johanneswuerbach/rails-vagrant-provision.sh
Provision a vagrant box with ruby stable (using rvm)
#!/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