Skip to content

Instantly share code, notes, and snippets.

@apetresc
apetresc / gist:2871966
Created June 5, 2012 01:51
OpenStack nova
{"access": {"token": {"expires": "2012-06-06T01:44:34Z", "id": "b023c15935174c2b879b600bb257c2c2", "tenant": {"description": null, "enabled": true, "id": "14d84f8cb42d4ca7b3eaed910f310738", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://localhost:8776/v1/14d84f8cb42d4ca7b3eaed910f310738", "region": "RegionOne", "publicURL": "http://localhost:8776/v1/14d84f8cb42d4ca7b3eaed910f310738", "internalURL": "http://localhost:8776/v1/14d84f8cb42d4ca7b3eaed910f310738"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://localhost:9292/v1", "region": "RegionOne", "publicURL": "http://localhost:9292/v1", "internalURL": "http://localhost:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://localhost:8774/v1.1/14d84f8cb42d4ca7b3eaed910f310738", "region": "RegionOne", "publicURL": "http://localhost:8774/v1.1/14d84f8cb42d4ca7b3eaed910f310738", "internalURL": "http://localhost:8774/v1.1/
@apetresc
apetresc / gist:3183304
Created July 26, 2012 17:21
search_name
nominatim=# \d search_name;
Table "public.search_name"
Column | Type | Modifiers
--------------------+----------------------+-----------
place_id | bigint |
search_rank | integer |
address_rank | integer |
importance | double precision |
country_code | character varying(2) |
name_vector | integer[] |
@apetresc
apetresc / gist:3189756
Created July 27, 2012 18:50
select * from placex where place_id=118271518;
place_id | partition | osm_type | osm_id | class | type | name | admin_level | housenumber | street | isin | postcode | country_code | extratags | geometry | parent_place_id | linked_place_id | rank_address | rank_search | importance | indexed_status | indexed_date | wikipedia | geometry_sector | calculated_country_code | centroid
-----------+-----------+----------+-----------+----------+------+-------------------------------------------------------------------------------------+-------------+-------------+--------+------+----------+--------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@apetresc
apetresc / gist:3208043
Created July 30, 2012 16:04
Nominatim warnings
WARNING: 136227003
NOTICE: IllegalArgumentException: Points of LinearRing do not form a closed linestring
CONTEXT: PL/pgSQL function "placex_update" line 86 at assignment
index_placex: UPDATE failed: ERROR: POSTGIS2GEOS conversion failed
CONTEXT: PL/pgSQL function "placex_update" line 86 at assignment
WARNING: 136227003
NOTICE: IllegalArgumentException: Points of LinearRing do not form a closed linestring
CONTEXT: PL/pgSQL function "placex_update" line 86 at assignment
index_placex: UPDATE failed: ERROR: POSTGIS2GEOS conversion failed
CONTEXT: PL/pgSQL function "placex_update" line 86 at assignment
[DEBUG] 2012-08-07 10:05:30,327 : Connecting, transport org.cometd.websocket.client.WebSocketTransport@8939ec3
[DEBUG] 2012-08-07 10:05:30,327 : [Session-1, SSL_NULL_WITH_NULL_NULL] SslConnection@27f899e9 SSL NOT_HANDSHAKING i/o/u=0/0/0 ishut=false oshut=false {WebSocketClientConnection p=WebSocketParserRFC6455@6df0c3ef state=START buffer= g=WebSocketGeneratorRFC6455@59cfb84c closed=false buffer=-1} NOT_HANDSHAKING filled=0/0 flushed=0/0
[DEBUG] 2012-08-07 10:05:30,327 : Sending messages [{id=1618, connectionType=websocket, channel=/meta/connect, clientId=111ld21v9k3wrw81hmrcgowk7g38}]
[DEBUG] 2012-08-07 10:05:30,327 : Registering WebSocketExchange {id=1618, connectionType=websocket, channel=/meta/connect, clientId=111ld21v9k3wrw81hmrcgowk7g38}
[DEBUG] 2012-08-07 10:05:30,327 : [Session-1, SSL_NULL_WITH_NULL_NULL] SslConnection@27f899e9 SSL NOT_HANDSHAKING i/o/u=0/0/0 ishut=false oshut=false {WebSocketClientConnection p=WebSocketParserRFC6455@6df0c3ef state=OPCODE buffer= g=WebSocketGeneratorRFC6455@59cfb84c
@apetresc
apetresc / MainActivity.java
Created August 9, 2012 20:39
Jackson 1.9.7 tracing
package com.example.jsontest;
import java.io.IOException;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import android.app.Activity;
import android.os.Bundle;
@apetresc
apetresc / boto2.3.0.py
Created August 13, 2012 20:39
Boto comparison
>>> import boto
>>> boto.__version__
'2.3.0'
>>> db = boto.connect_dynamodb()
>>> t = db.get_table("RoutingTable")
>>> t.scan()
<generator object scan at 0x1cedfa0>
@apetresc
apetresc / gist:3901974
Created October 16, 2012 20:56
Loku: Burgers <= $15 in SF
{
"meta": {
"cache-expiry": 3600,
"limit": 100
},
"objects": [
{
"description": "Crispy shallots, avocado, wasabi lime crème fraiche \r",
"id": "c563afbdb7cc20c4a4694db710d217d8b390ac5aa3db73f506c3c6af8a126210",
"name": "Ahi Tuna Burger \r",
{
"meta": {
"cache-expiry": 3600
},
"not_found": [],
"objects": [
{
"categories": [
"restaurant"
],
vagrant@precise64:~$ sudo apt-get upgrade dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
vagrant@precise64:~$ ls /opt
vagrant_ruby VBoxGuestAdditions-4.2.0