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
#!/usr/bin/env ruby | |
# by Helder Ribeiro 2009 | |
# | |
# Plugin to monitor delayed_jobs' queue size | |
# Gives updates with number of jobs that haven't been started yet | |
# plus the ones that failed and are still rescheduled for another run | |
# | |
# Parameters supported: | |
# | |
# config |
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
apply plugin: 'com.android.model.application' | |
def MSB = ['AutoCor', 'BitonicSort', 'BitonicSortRecursive', 'FFT2', 'FFT3', 'FIR', 'FIRcoarse', 'FMRadio'] | |
MSB << 'MatrixMult' << 'MatrixMultBlock' << 'MergeSort' << 'Repeater' | |
MSB << 'BeepBeep' << 'MFCC' << 'Crowd' | |
model { | |
compileOptions.with { | |
sourceCompatibility = JavaVersion.VERSION_1_7 | |
targetCompatibility = JavaVersion.VERSION_1_7 |
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
# Name: EXIFmover.py | |
# Author: Brian Klug (@nerdtalker / brian@brianklug.org) | |
# Purpose: | |
# Move Files into directory based on EXIF data make and model | |
# Designed to un-clusterfuck the Dropbox camera upload directory which is a mess of every | |
# JPEG and PNG ever if you use it like I do on a bunch of phones, and thus totally unwieldy | |
# and full of images sorted by date or else nothing sometimes, dropbox seems nondeterminstic | |
# Moves files into /[Image Make]+[Image Model]/ eg /Camera Uploads/LGE Nexus 4/ |
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
# (create oauth2 tokens from Google Console) | |
client_id = "" | |
client_secret = "" | |
# (paste the scope of the service you want here) | |
# e.g.: https://www.googleapis.com/auth/gan | |
scope = "" | |
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 sys | |
import subprocess | |
import multiprocessing | |
# use htop to see the utilization rates spread across cores | |
# use locust --help to see all the options | |
# the cmd launches 500 concurrent users on each core, hatch 5 per second, issue 10k requests then stops | |
# logs to results.txt, prints the summary in the terminal |
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
# your Gemfile should look something like... | |
gem 'fog-aws', require: false # or require: 'fog/aws' | |
# avoid having carrierwave loading during bundler | |
# setup. We need to get ./lib in the load_path first. | |
gem 'carrierwave', require: false |
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
source :rubygems | |
gem "puma" | |
gem "sinatra" |
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
function smart_pwd { | |
local pwdmaxlen=25 | |
local trunc_symbol=".." | |
local dir=${PWD##*/} | |
local tmp="" | |
pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen )) | |
NEW_PWD=${PWD/#$HOME/\~} | |
local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen )) | |
if [ ${pwdoffset} -gt "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
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# gwillem@gmail.com | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
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
# Symlink the shared protected folder | |
run "ln -nfs #{shared_path}/protected #{latest_release}/protected" |
OlderNewer