Skip to content

Instantly share code, notes, and snippets.

View jbarciauskas's full-sized avatar

Joel Barciauskas jbarciauskas

View GitHub Profile
This file has been truncated, but you can view the full file.
[4717543427, 4717543428, 4717543429, 4717543430, 4717543431, 4717543432, 4717543433, 4717543434, 4717543435, 4717543436, 4717543437, 4717543438, 4717543439, 4717543440, 4673503252, 4723834904, 4723834905, 4723834906, 4723834907, 4723834908, 4723834909, 4723834910, 4717543462, 4717543463, 4694474792, 4717543465, 4717543466, 4723834923, 4717543468, 4723834925, 4723834926, 4723834927, 4723834928, 4723834929, 4723834930, 4723834931, 4723834932, 4723834933, 4722786358, 4673503287, 4673503288, 4673503289, 4723834941, 4723834943, 4723834944, 4723834945, 4723834946, 4717543491, 4717543494, 4717543495, 4717543496, 4717543497, 4717543498, 4717543499, 4717543500, 4333764685, 4717543502, 4723834960, 4722457058, 3696230491, 4687134813, 4794089566, 4794089567, 4794089568, 4710085553, 4719291067, 4717543524, 4794089573, 4717543526, 4717543527, 4717543528, 4717543529, 4723834996, 4719291070, 4705271435, 4714397830, 4714397831, 4714397832, 4714397834, 4714397836, 4714397837, 4714397838, 4714397839, 4714397840, 4714397841, 471
#!/usr/bin/env bash
# This script will provision all of the services. Each service will be setup in the following manner:
#
# 1. Migrations run,
# 2. Tenants—as in multi-tenancy—setup,
# 3. Service users and OAuth clients setup in LMS,
# 4. Static assets compiled/collected.
courses.edx.org: 6400833, 2083916 ips
localhost:8003: 2917976, 1633 ips
localhost:8031: 2052623, 1561 ips
mx.televisioneducativa.gob.mx: 895651, 320584 ips
courses.prometheus.org.ua: 635127, 164952 ips
university.mongodb.com: 533343, 156873 ips
lagunita.stanford.edu: 517823, 231515 ips
lms.gacco.org: 359490, 144340 ips
openedx.microsoft.com: 324869, 2413 ips
edge.edx.org: 253323, 55680 ips
courses.edx.org: 7069711, 2273815 ips
localhost:8003: 3240540, 1762 ips
localhost:8031: 2256333, 1685 ips
mx.televisioneducativa.gob.mx: 940894, 337005 ips
courses.prometheus.org.ua: 727178, 180075 ips
university.mongodb.com: 578184, 169856 ips
lagunita.stanford.edu: 567218, 251619 ips
lms.gacco.org: 391341, 154351 ips
openedx.microsoft.com: 365213, 2577 ips
edge.edx.org: 282402, 60226 ips
import requests
r = requests.get('https://api.gemnasium.com/v1/projects', auth=('X', 'e05c25f9248015c5aebb26049719ed23'))
data = r.json()
for repo in data['edx-gemnasium']:
print repo['slug']
r = requests.get('https://api.gemnasium.com/v1/projects/' + repo['slug'] + '/dependencies', auth=('X', 'e05c25f9248015c5aebb26049719ed23'))
dependencies = r.json()
require 'fog'
require 'pp'
require 'active_support'
AWS = Fog::Compute.new :provider => 'AWS'
AWS.snapshots.each do |snapshot|
if snapshot.tags['Name'] =~ /pod\d*{3}-\w*-\d*/
if(DateTime.parse(snapshot.created_at.to_iso8601_basic) < (DateTime.now << 1))
@jbarciauskas
jbarciauskas / gist:3298944
Created August 8, 2012 21:30
try to get multiple locks in mysql
mysql> select get_lock('foo', 1200);
+-----------------------+
| get_lock('foo', 1200) |
+-----------------------+
| 1 |
+-----------------------+
1 row in set (0.00 sec)
mysql> select get_lock('bar', 1200);
<?php
require_once("BitArray.php");
$test = new BitArray(128);
$test->setBit(12);
var_dump($test->toIntArray());
$test2 = new BitArray(128);
$test2->setBit(126);
var_dump($test2->toIntArray());
$test3 = BitArray::orFn($test, $test2);
var_dump($test3->toIntArray());
<?php
class BitArray {
//Sacrifice 2x the amount of memory, so we can use pack/unpack easily
const INT_SIZE = 4;
private $bitmapString;
public function __construct($numberOfBits = 64, $bitmapString = null) {
if($bitmapString!= null)
require_once("BitArray.php");
$test = new BitArray(128);
$test->setBit(12);
$test2 = new BitArray(128);
$test2->setBit(126);
$test3 = BitArray::orFn($test, $test2);
var_dump($test3);
var_dump($test);
var_dump($test2);
$test2 = new BitArray(60);