Skip to content

Instantly share code, notes, and snippets.

@ruebenramirez
ruebenramirez / installDockerCentos64_64bit.sh
Last active January 2, 2016 00:49
install docker on CentOS6.4 64bit
#! /bin/bash
sudo su -
yum -y update
yum -y install docker-io
yum -y update docker-io
yum -y update --enablerepo=epel-testing docker-io-0.7.2-2.el6
service docker start
chkconfig docker on
@ruebenramirez
ruebenramirez / Weight-loss_diet_plan.md
Last active January 2, 2016 07:59
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
#!/bin/bash
curl -LO https://www.dropbox.com/s/7o2881dkro5sure/4-string-manipulation.git.tgz
tar -xzvf 4-string-manipulation.git.tgz
cd 4-string-manipulation.git/
python test*
@ruebenramirez
ruebenramirez / cros-haswell-modules.sh
Last active August 29, 2015 13:56
cros-haswell-modules.sh
#!/bin/bash
# Modified for Arch Linux from ChrUbuntu's cros-haswell-modules.sh
# https://googledrive.com/host/0B0YvUuHHn3MndlNDbXhPRlB2eFE/cros-haswell-modules.sh
set -e
# Create a temp directory for our work
tempbuild=`mktemp -d`
cd $tempbuild
>> 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

source: http://askubuntu.com/a/14083

$ pacmd list-sinks

 * index: 1
        name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
        driver: <module-alsa-card.c>
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
@ruebenramirez
ruebenramirez / maxmemory-key-eviction.md
Created March 13, 2015 16:15
maxmemory-key-eviction

#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

#cloud-config
hostname: coreos0
ssh_authorized_keys:
coreos:
etcd:
discovery: https://discovery.etcd.io/0a83a3865b073785c3abff511b72a126
addr: 10.10.1.3:4001
peer-addr: 10.10.1.3:7001
<?php
// create a class `foo` with a member function `do_foo`
class foo
{
function do_foo()
{
echo "Doing foo.";
}
}
@ruebenramirez
ruebenramirez / create-orders-programmatically.md
Created May 5, 2016 16:38
magento create orders programmatically