Skip to content

Instantly share code, notes, and snippets.

Rueben Ramirez ruebenramirez

View GitHub Profile
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
ruebenramirez /
Created May 5, 2016
magento create orders programmatically
View object-usage.php
// create a class `foo` with a member function `do_foo`
class foo
function do_foo()
echo "Doing foo.";
View gist:8c288d6fa58424b3ac3d
hostname: coreos0

#The ObjectRocket Customer Support Story We had an RTG customer using Redis as a cache for their web-app. They were receiving write errors from Redis in their application as writes were attempted. Usually this is due to running out of available memory in Redis. After diagnosing the issue, we were able to quickly update their maxmemory policy to resolve the problem. How, and why, did this solve their problem? There are a few things to know about key eviction and the various maxmemory policies available in Redis.

Redis can be configured to behave differently when the database gets full. There are various options to recycle memory used by less important keys (through eviction) to allow for continued writes. Key eviction operations are the same as key deletions: the key is no longer accessible and the memory it occupied is marked as available for overwriting. What does it mean for the Redis db to be "full" though?

If we do not specify a maxmemory value in the Redis configuration, Redis will continue to a



$ pacmd list-sinks

 * index: 1
        name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
        driver: <module-alsa-card.c>
View gist:673c13f279a845c3750d
>> i = Instance.find_by_id 324769
Instance Load (3.0ms) SELECT `redis_instances`.* FROM `redis_instances` WHERE `redis_instances`.`id` = 324769 LIMIT 1
=> #<Instance id: 324769, user_id: 26524, server_id: 101, port: 9025, version: "2.8.17", encrypted_password: "Ffj8yl5NIadXGM6Z2fZdmLwdqokaLO2wf17sI/ytm9ufg/DZ9PS...", memory: 20971520, hash_max_zipmap_entries: 64, hash_max_zipmap_value: 512, activerehashing: true, appendfsync: "everysec", created_at: "2014-12-16 16:16:36", updated_at: "2015-01-14 02:32:06", status: "running", last_bgrewriteaof_at: nil, timeout: 150, plan: "mini", databases: 1, connections: 50, last_backup_at: "2015-01-14 02:32:05", slave: false, master_host: nil, master_port: nil, encrypted_master_password: nil, persistence: "aof", snapshots: ["900 1", "300 10", "60 10000"], label: "greeneye-9025", vm_enabled: false, vm_max_memory: 0, vm_page_size: 32, vm_max_threads: 4, vm_size: 0, config_command: "890df345366e5addcf11cac5f4861ae5", slave_serve_stale_data: true, maxmemory_policy: "volatile
ruebenramirez /
Last active Aug 29, 2015
# Modified for Arch Linux from ChrUbuntu's
set -e
# Create a temp directory for our work
tempbuild=`mktemp -d`
cd $tempbuild
curl -LO
tar -xzvf 4-string-manipulation.git.tgz
cd 4-string-manipulation.git/
python test*
ruebenramirez /
Last active Jan 2, 2016
My friend John shared this diet plan as a scanned image. It was was a bit scary to look at and had a couple of typos, so here it is as markdown. I'm not a doctor, dietitian or any other type of health professional, so please consult one before following this diet!

Weight-loss Diet Plan

Your weight should drop 20 pounds in two weeks. The basis of this diet is chemical, and it maintains your energy while reducing. Quantities are not very important except where indicated.

Some Rules

  1. No substitutes.
  2. Diet for 14 Days only and not one day longer.
  3. No alcoholic beverages or diet drinks. (Only water, coffee, and/or tea).
  4. Abstain from eating anything not included in this diet, but be sure to eat what is assigned rather than do without.
  5. Do not eat between meals
You can’t perform that action at this time.