Skip to content

Instantly share code, notes, and snippets.

@cagmz
cagmz / dropbox
Last active April 5, 2016 11:17 — forked from benhedrington/dropbox
Dropbox init.d
#!/bin/sh
# dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"
DAEMON=.dropbox-dist/dropboxd
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
#!/bin/bash
# Edu-related packages
pkgs="$pkgs
debian-reference-en dillo x2x
scratch nuscratch
timidity
smartsim penguinspuzzle
pistore
sonic-pi
@cagmz
cagmz / time_series.html
Last active September 21, 2017 05:03
Time Series graph using moment.js, D3, nvd3, anuglar-nvd3, and Angular.
<html>
<!-- See the pen at https://codepen.io/cagmz/pen/qqRGoY -->
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.16.0/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.4/nv.d3.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.4/nv.d3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-nvd3/1.0.9/angular-nvd3.min.js"></script>
<script>
@cagmz
cagmz / bench_rails_memory_usage.rb
Created September 10, 2019 03:02 — forked from brianhempel/bench_rails_memory_usage.rb
A script to test the memory usage of your Rails application over time. It will run 30 requests against the specified action and report the final RSS. Choose the URL to hit on line 45 and then run with `ruby bench_rails_memory_usage.rb`.
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
XRUBY_GC_HEAP_FREE_SLOTS=4096
XRUBY_GC_HEAP_INIT_SLOTS=10000
XRUBY_GC_HEAP_GROWTH_FACTOR=1.8
XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0