This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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
| locations = filter(lambda line: line.split("|")[-1] == "loc-bg\r\n", open("log.csv")) | |
| def extract(line): | |
| items = line.split(",") | |
| timestamp = items[0].split("|")[0] | |
| lon = items[1] | |
| lat = items[2] | |
| return ";".join([timestamp, lon, lat]) | |
| locations = map(extract, locations) |
This file contains hidden or 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
| import psycopg2 | |
| import pandas | |
| from collections import defaultdict | |
| data = pandas.read_csv("learning_dataset.csv", sep=";", names="gid,borough,block,lot,zipcode,firecomp,policeprct,ltdheight,bldgclass,landuse,easements,ownertype,lotarea,bldgarea,comarea,resarea,officearea,retailarea,garagearea,strgearea,factryarea,otherarea,areasource,numbldgs,numfloors,unitsres,unitstotal,lotfront,lotdepth,bldgfront,bldgdepth,ext,proxcode,irrlotcode,lottype,bsmtcode,assessland,assesstot,exemptland,exempttot,yearbuilt,builtcode,yearalter1,yearalter2,histdist,landmark,builtfar,residfar,commfar,facilfar".split(",")) | |
| # Connect to an existing database | |
| conn = psycopg2.connect("dbname=tahar user=vallette") | |
| # Open a cursor to perform database operations | |
| cur = conn.cursor() |
This file contains hidden or 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
| # useful | |
| sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas | |
| # check if camera is enable and connected | |
| vcgencmd get_camera | |
| # if not use sudo raspi-config | |
| # install picamera modules | |
| sudo apt-get update |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import SimpleHTTPServer | |
| import SocketServer | |
| PORT = 8003 | |
| class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| def end_headers(self): | |
| self.send_my_headers() |