Skip to content

Instantly share code, notes, and snippets.

View raprasad's full-sized avatar

Raman Prasad raprasad

View GitHub Profile
@raprasad
raprasad / url_change.md
Last active December 7, 2016 20:18
home page to list plants
  • File to change: greenhousedb/plants/urls.py

1. Make home page the plant listing page

Change 'apps.greenhousedb.views.home' to 'apps.greenhousedb.views.view_plants'

Current lines

 # Examples:
@raprasad
raprasad / hba_note.md
Last active January 24, 2025 23:34
Postgres: Update pg_hba.conf for Static IP

Find pg_hba.conf file location

bash-4.1$ psql
psql (8.4.20)
Type "help" for help.

postgres=# SHOW hba_file;
            hba_file             
@raprasad
raprasad / dataset_json.json
Last active December 16, 2016 18:21
Dataset JSON cleaned up
{
"status": "OK",
"info": {
"generation_time": "2016-12-16T13:10:25",
"cache_time_seconds": 900,
"params": {
"persistentId": "doi:10.7910/DVN/26935",
"pretty": "true",
"key": "10350864-ff48-4ebd-a2d9-80a07a35f911 "
}
@raprasad
raprasad / json_split.py
Created January 4, 2017 21:55
split gps JSON file
import json
from os.path import isfile, isdir, join
import os
import sys
def msg(s): print (s)
def dashes(): msg(40*'-')
def msgt(s): dashes(); msg(s); dashes()
@raprasad
raprasad / UpdateFileMetadataHelper.java
Created January 9, 2017 16:22
hacked, non-compiling file to use as starting point months from now
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.harvard.iq.dataverse.datasetutility;
import edu.harvard.iq.dataverse.DataFile;
import edu.harvard.iq.dataverse.DataFileServiceBean;
import edu.harvard.iq.dataverse.Dataset;
@raprasad
raprasad / Files.java
Created January 9, 2017 16:24
Endpoint to update a single file's metadata (non-working start point)
@PUT
@Path("{id}/metadata")
public Response updateFileMetadata(
@PathParam("id") Long fileToUpdateId,
String jsonData
){
// -------------------------------------
// (1) Get the user from the API key
@raprasad
raprasad / oil_refineries.csv
Created January 18, 2017 03:48
oil_refineries.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 21 columns, instead of 11 in line 4.
FID,province,city,plant,latDMS,capacityBb,latitude,country,employees,longitude,wikipediaP,operator,owner,longDMS,oilTank,refUnits,geoLat,geoLong,founded,capacity,mainContra
wikipedia_oil_refineries_vd7.1,,,Arpechim Refinery,,,44.79999924,,,24.93000031,http://en.wikipedia.org/wiki/Arpechim_Refinery,,Petrom,,,,44.79999924,24.93000031,,,
wikipedia_oil_refineries_vd7.2,,,Refinaria do Planalto Paulista,,,-22.72833252,,,-47.13166809,http://en.wikipedia.org/wiki/Refinaria_do_Planalto_Paulista,,,,,,-22.72833252,-47.13166809,,,
wikipedia_oil_refineries_vd7.3,,Cartagena; Colombia,Cartagena Refinery,10.315,75000,10.315,Colombia,,-75.49722222,http://en.wikipedia.org/wiki/Cartagena_Refinery,Refineria de Cartagena S.A.,Ecopetrol,-75.49722222,,crude units; visbreaking units; fluid catalytic cracker; light products plants; polymerization plants; amine plants; sulfur plants; impurities treatment plants,,,,,
wikipedia_oil_refineries_vd7.4,,Aspropyrgos,Aspropyrgos Refinery,,135000,38.03229904,Greece,,23.59840012,http://en.wikip
@raprasad
raprasad / postres_restart.md
Last active January 19, 2017 18:15
local postgres restart / can't connect to local postgres
@raprasad
raprasad / update_link.md
Last active April 6, 2017 17:45
geoconnect update mapitlink
@raprasad
raprasad / wm_install_notes.md
Last active February 21, 2017 21:13
worldmap install notes