Skip to content

Instantly share code, notes, and snippets.

View spara's full-sized avatar

Sophia Parafina spara

View GitHub Profile
@spara
spara / Llama2ColorAgent.ipynb
Created January 21, 2024 16:37 — forked from aaronblondeau/Llama2ColorAgent.ipynb
Demos a Llama 2 agent
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spara
spara / elastic_beanstalk_external_sessions.md
Created July 13, 2017 16:52 — forked from mlconnor/elastic_beanstalk_external_sessions.md
Analaysis and recommendation for externalizing session in Elastic Beanstalk using Tomcat and memcached.

Session Management in an Autoscaling Environment

Problem Statement

User sessions in J2EE and LAMP stacks have traditionally been handled in memory by the application server handling the user request. Because of that, load balancers have been configured to use sticky sessions. By sticky sessions we mean that once the user has visited the site, they will be assigned an app server and will return to that server for subsequent requests. The load balancers typically handle that by referencing the users session cookie.

Elastic cloud environments differ from traditional server configurations in that they have a variable number of servers based on traffic loads whereas traditional configurations had a fixed number of servers. When traffic volumes decline it is necessary to vaporize servers. In doing so, we would lose user sessions (essentially forcing a logout) unless we come up with a new strategy for session management.

A new approach

After much research, it is clear that the best

@spara
spara / Makefile
Created July 19, 2016 15:34 — forked from yanofsky/Makefile
This is workflow for downloading, processing, and mosaicing Landsat scenes, as a Makefile
# lansatutil directory
LANDSAT = ~/landsat
# scenes to target
LANDSAT_IDS = \
LC81220442016038LGN00 \
LC81220452016038LGN00 \
LC81210442014281LGN00 \
LC81210452014281LGN00
@spara
spara / Landsat 8 gdal processing
Last active March 28, 2017 17:26 — forked from andymason/Landsat 8 gdal processing
Added projection wrap correction
#! /bin/bash
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
#
# Reference info:
# http://www.mapbox.com/blog/putting-landsat-8-bands-to-work/
#! /bin/bash
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
#
# Reference info:
# http://www.mapbox.com/blog/putting-landsat-8-bands-to-work/
#!/usr/bin/env ruby
require 'csv'
require 'json'
if ARGV.size != 2
puts 'Usage: csv_to_json input_file.csv output_file.json'
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects'
exit(1)
end
@spara
spara / README.md
Created March 3, 2014 18:32 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

@spara
spara / README.md
Created March 2, 2014 05:54 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

@spara
spara / mysql2sqlite.sh
Created August 22, 2011 21:16 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
[
{
"category":"Administrative",
"category_id":"10100100",
"type":"Region",
"subcategory":"Consolidated City"
},
{
"category":"Administrative",
"category_id":"10100101",