Skip to content

Instantly share code, notes, and snippets.

View ycombinator's full-sized avatar

Shaunak Kashyap ycombinator

  • Elastic
  • San Jose, CA
View GitHub Profile
@ycombinator
ycombinator / pseudo-folders-within-container.php
Last active August 29, 2015 13:57
Pseudo-folders within container
<?php
require 'vendor/autoload.php';
use OpenCloud\Rackspace;
use OpenCloud\ObjectStore\Resource\DataObject;
// Create a client object to communicate with various Rackspace Cloud services.
$client = new Rackspace(Rackspace::UK_IDENTITY_ENDPOINT, array(
'username' => '<YOUR RACKSPACE CLOUD USERNAME HERE>',
@ycombinator
ycombinator / cloudfiles-skip-if-exists.php
Created March 6, 2014 17:33
How to check if a file exists in a Rackspace Cloud Files container
<?php
// Assumption: $container is an instance of OpenCloud\ObjectStore\Resource\Container
$filename = 'mugshot2.png';
try {
// Try to retrieve the file, but only its headers to save
// bandwidth and time.

New developer.rackspace.com - what’s left?

Infrastructure

  • Setup infrastructure - min: 1 lb, 2+2 servers, 1 Jenkins
  • Setup/copy jenkins job to build site and push
  • Setup SSL cert on LB
  • Dev Vagrant VM: install jekyll

General (across the site)

heat_template_version: 2013-05-23
description: |
This is a Heat template to deploy a Rackspace database instance
parameters:
# Database settings
db_instance_flavor:
description: Rackspace Cloud Database Flavor to determine amount of RAM
<?php
require_once "cloudfiles.php";
// Authenticate.
$cfAuth = new CF_Authentication("username", "api key");
$cfAuth->authenticate();
// Get connection.
$cfConn = new CF_Connection($cfAuth);
#!/bin/bash
#
# This script builds the various parts of the site (Getting Started guides,
# blog, etc.) and combines them into a single directory, `site_html`.
#
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BUILD_DIR=/tmp/developer.rackspace.com
WORK_DIR=$BUILD_DIR/_work
TARGET_DIR=$PROJECT_ROOT/_site
#!/bin/bash
#
# This script builds the various parts of the site (Getting Started guides,
# blog, etc.) and combines them into a single directory, `site_html`.
#
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BUILD_DIR=/tmp/developer.rackspace.com
WORK_DIR=$BUILD_DIR/_work
TARGET_DIR=$PROJECT_ROOT/_site
### Keybase proof
I hereby claim:
* I am ycombinator on github.
* I am ycombinator (https://keybase.io/ycombinator) on keybase.
* I have a public key whose fingerprint is F27E EE58 3A6C 47F7 71C7 6C67 1A20 FA2E 1800 7828
To claim this, I am signing this object:
#cloud-config
users:
- name: admin
shell: /bin/bash
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLBKi3czWfLcWHx/HSv4ySf2Ity9McaEXcy0MnreT45MH++2+XU6xoyymH7T0bNoZ/yceQxisDml8EbG9YB2ppqHjwZzG2LbJgnre9ZtB6Srok2IfmKQv24nVp7oHKU8nESd8jdTkojpXZhkj0X4sCYDa3QTACWlimzaOjNi4cCihKT/MUMXTPLuvVyP3m0IwwbT23BRPeLwla+tJaN8spBU41QqiU0WQsfJei0cnZxDlzqSeLptfdg+QxasT4ZGUc5jOJxvz3b27J62UeAR4BF8lTKxPLdPdYPGt/G2PhkbwkQxCpCU/BAx5molMeGBz/Me2c4njnx1XBn2sLabjJ
<?php
/*
* Copyright 2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0