This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create an index for your tables, this will create a rtree | |
CREATE INDEX idx_ny_fires ON NYC_FireAccidents USING GIST(geom); | |
CREATE INDEX idx_ny_building ON mappluto_13v2 USING GIST(wkb_geometry); | |
-- check if one single association is fast | |
EXPLAIN ANALYZE SELECT f.unique_key, b.ogc_fid | |
FROM NYC_fireaccidents f, mappluto_13v2 b | |
WHERE ST_Distance_Sphere( ST_Transform(f.geom,4269), ST_Transform(b.wkb_geometry,4269)) < 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GeomJsonSerializer extends JsonSerializer[T <: Geometry] { | |
def serialize[T <: Geometry](geom: T, json: JsonGenerator, provider: SerializerProvider) { | |
json.writeString(jtsToGeoJson(geom)) | |
} | |
} | |
[error] /Users/vallette/projects/safesignal/util-core/src/main/scala/net/snips/util/StringUtils.scala:63: ']' expected but '<:' found. | |
[error] class GeomJsonSerializer extends JsonSerializer[T <: Geometry] { | |
[error] ^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install VirtualBox https://www.virtualbox.org/wiki/Downloads | |
# create your home bin dir & add it to your PATH | |
mkdir -p ~/bin | |
curl -o ~/bin/boot2docker -k "https://raw.github.com/boot2docker/boot2docker/master/boot2docker" | |
export PATH=$HOME/bin:$PATH | |
mkdir -p ~/.boot2docker | |
# create the vm in ~/VirtualBox VMs and the disk in ~/.boot2docker | |
boot2docker init | |
# load the VM in the background, call `boot2docker down` when done, password is "tcuser" | |
boot2docker up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# connect to the db | |
psql -d idf -U postgres | |
# get first few nodes having tags | |
select * from nodes where array_length(akeys(tags),1) >0 limit 5; | |
# get nodes having tag key "highway" | |
select * from nodes where tags ? 'highway' limit 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conf = new BaseConfiguration() | |
conf.setProperty('storage.backend', 'persistit') | |
conf.setProperty('storage.directory', '/tmp/titangraph') | |
g=TitanFactory.open(conf) | |
g.V.count() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://s3.thinkaurelius.com/downloads/titan/titan-all-0.4.2.zip | |
unzip titan-all-0.4.2.zip | |
cd titan-all-0.4.2 | |
bin/gremlin.sh | |
conf = new BaseConfiguration() | |
conf.setProperty('storage.backend', 'persistit') | |
conf.setProperty('storage.directory', '/tmp/titangraph') | |
g=TitanFactory.open(conf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## wifi config | |
sudo iwconfig wlan0 essid freebox_vallem key s:xxxx | |
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf | |
sudo apt-get install python-pip | |
sudo apt-get install screen | |
pip install rpi.gpio ipython | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[info] Starting scala interpreter... | |
[info] | |
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import spray.json._ | |
import spray.json._ | |
scala> import DefaultJsonProtocol._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# on my laptop: | |
scp ~/.ssh/id_rsa.pub vallette@server_ip | |
# in ~/.ssh/config | |
Host linode | |
User vallette | |
Hostname server_ip | |
ServerAliveCountMax 3 | |
ServerAliveInterval 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
# basics | |
apt-get -y install git git-flow curl unzip zsh | |
# zsh | |
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.zshrc ~/.zshrc.orig | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc | |
chsh -s /bin/zsh |
OlderNewer