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
1. Trim terminal path: | |
PS1='\u:\W\$ ' | |
OR | |
PS1='\W\$ ' | |
2. Go to previous directory: | |
cd - | |
3. Kill Port process and free it: | |
sudo lsof -i :3000 |
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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<StyledLayerDescriptor version="1.0.0" | |
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" | |
xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" | |
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<NamedLayer> | |
<Name>point_bank</Name> | |
<UserStyle> | |
<Title>bank point style</Title> |
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
-- The following should be OK | |
select pgr_labelGraph('ways'); | |
select pgr_labelGraph('Ways'); | |
select pgr_labelGraph('ways', 'id'); | |
select pgr_labelGraph('ways', 'id', 'source'); | |
select pgr_labelGraph('ways', 'id', 'source', 'target'); | |
select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph'); | |
select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<100'); |
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
"======== Custom Mapping ======== | |
"general mapping | |
nmap <C-Tab> :tabnext<CR> | |
nmap <C-S-Tab> :tabprevious<CR> | |
map <C-S-Tab> :tabprevious<CR> | |
map <C-Tab> :tabnext<CR> | |
imap <C-S-Tab> <ESC> : tabprevious<CR> | |
imap <C-Tab> <ESC> : tabnext<CR> | |
noremap <F7> :set expandtab!<CR> |
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 osgeo.ogr | |
shapefile = osgeo.ogr.Open("/Users/zia/Documents/journals/My_WriteUp/pgr_TPP_5Algos/data/citySelection/majorCountriesCityShapefile/selectedworldcityshapes.shp") | |
layer = shapefile.GetLayer(0) | |
f = open("/Users/zia/Documents/journals/My_WriteUp/pgr_TPP_5Algos/data/citySelection/testCode/osmCityDownloadLinks.txt", 'w') | |
for i in range(layer.GetFeatureCount()): | |
feature = layer.GetFeature(i) |
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 os | |
from xml.dom import minidom | |
proj_dir = "/Users/zia/Documents/journals/My_WriteUp/Terrain_Routing_New/osm_data_downloaded/singaporeMalaysia/numberOfNodesPerRoad" | |
rel_file_path = "osm.osm"; | |
abs_file_path = os.path.join(proj_dir, rel_file_path) | |
result_rel_file_path = "numberOfNodesPerRoad.csv" | |
result_abs_file_path = os.path.join(proj_dir, result_rel_file_path) |
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 csv, psycopg2, operator | |
connection = psycopg2.connect("host='localhost' dbname='tpp_la_gridAAA' user='postgres' password='zia123'") | |
cursor1 = connection.cursor() | |
cursor2 = connection.cursor() | |
analysis = [{1:0},{2:0},{3:0},{4:0},{5:0},{6:0}] | |
sql = "select id from ways_vertices_pgr" | |
cursor1.execute(sql) |
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 os, time, csv, json | |
modisc6GlobalUrl = "modis c6 global csv url" | |
basePath = 'modis c6 basepath to 194 server' | |
baseFileName = 'modis c6 data base filename' | |
def createElemGeojson(latitude,longitude,brightness,scan,track,acq_date,acq_time,satellite,confidence,version,bright_t31,frp,daynight): | |
propValue = {} | |
propValue['BRIGHTNESS'] = float(brightness) | |
propValue['SCAN'] = float(scan) |
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
from ftplib import FTP | |
import datetime, os, h5py, json | |
import matplotlib.pyplot as plt | |
import numpy as np | |
ftpUrl = 'ftp url' | |
user = 'username' | |
passwd = 'password' | |
basePath = 'seviri lsa path in 194 server' | |
baseFileName = 'name of seviri list product' |
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
1. # Open cron command | |
sudo crontab -e | |
2. # Paste the following line at the very end to execute above script after every 5 min. | |
# More details about this at http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/ | |
*/5 * * * * /usr/bin/python2.7 /var/www/html/maps/firemap/realdata-geojson/viirs/pullViirsData.py | |
3. # That's it. It will even run on system reboot. |