Skip to content

Instantly share code, notes, and snippets.

View Zia-'s full-sized avatar
🙏
I might be slow in response.

Mohammed Zia Zia-

🙏
I might be slow in response.
View GitHub Profile
import asyncio
import websockets
import json
import time
import os
import ssl
from datetime import datetime, timezone
async def connect_ais_stream():
import _thread
import time
# import os
# import sys
# import base64
# print(os.environ['SSL_CERT_FILE'])
# from kafka.admin import KafkaAdminClient, NewTopic
# from kafka import KafkaProducer
# from datetime import timedelta
@Zia-
Zia- / poilist
Last active June 20, 2022 09:04
POI list with weights and radius of impact, per OSM.
### Table: POI list with weights and radius of impact, per OSM. The key values are based on the OSM specifications. The weights range from 0 to 1 (maximum impact level) and describe their relative importance. The radius of impact describes the maximum distance at which road segments are affected by the presence of a given POI class.
| Activity Group | Key | Value | Maximum Impact Level | Impact Radius in meters |
| ------------- | ------------- | ------------- | ------------- | ------------- |
|work | amenity | conference_centre | 1 | 5000|
|leisure | building | stadium | 1 | 5000|
|work | amenity | bus_station | 0.6 | 1000|
|work | amenity | clinic | 0.8 | 500|
|education | amenity | college | 0.8 | 500|
|education | building | college | 0.8 | 500|
1. Download Anaconda .sh file locally for linux server from https://www.anaconda.com/products/individual and move it to remote server using the following command
ssh -r <path>/Anaconda-latest-Linux-x86_64.sh [email protected]:/root/test
2. Enter to remote server using ssh tunnelling. Make sure that port 8000 is open and not being blocked by copying PID using the following command and subsequently using it to free port. Note: VSCode will not throw any error, not even jupyter notebook server but we won't be able to connect. Very annoying ...
sudo lsof -i :8000
sudo kill -9 14135
var fs = require('fs'),
es = require('event-stream'),
csv = require('csv-parser')
var input = '/Users/zzz/code/gitHub/ground_motion/additional/sample_data/ziya_hoca/levels_new/250m.csv'
var output = '/Users/zzz/code/gitHub/ground_motion/additional/sample_data/ziya_hoca/levels_new/250m.geojson'
var x_inc = 0.00298157703587,
y_inc = 0.00225232613786
const fs = require('fs')
const flat = require('flat')
const l = require('lodash')
const dirTree = require("directory-tree");
var unzippedTurkeyDir = '/Users/zzz/exp/rubbish/gm_test/turkey_regions/TÜRKİYE'
var exportJSONforMongo = '/Users/zzz/exp/rubbish/gm_test/turkey_regions/places.json'
// fs.appendFileSync('/Users/zzz/exp/rubbish/gm_test/osm_turkey/result.json', '[');
@Zia-
Zia- / Cheat Code
Last active April 4, 2022 17:11
Docker commands
// Docker
- Kill/Stop all containers -
docker kill $(docker ps -q)
- Delete all containers -
docker rm $(docker ps -a -q)
- Delete all images -
docker rmi $(docker images -q)
import grequests, requests, time
then = time.time()
urls = [
'https://api.ohsome.org/v0.9/elements/geometry?bboxes=8.625%2C49.3711%2C8.7334%2C49.4397&properties=tags&showMetadata=false&time=2014-01-01%2C2017-01-01&types=way',
'https://api.ohsome.org/v0.9/elements/geometry?bboxes=8.625%2C49.3711%2C8.7334%2C49.4397&properties=tags&showMetadata=false&time=2014-01-01%2C2017-01-01&types=way',
'https://api.ohsome.org/v0.9/elements/geometry?bboxes=8.625%2C49.3711%2C8.7334%2C49.4397&properties=tags&showMetadata=false&time=2014-01-01%2C2017-01-01&types=way'
]
@Zia-
Zia- / downloadOSM.html
Created August 14, 2018 13:41
Download OSM Data from rectangle draw with different baselayers.
<!DOCTYPE html>
<html>
<head>
<title>Download OSM File from rectangle drag</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
import os, time, datetime, sys
##### Usage:
# python script.py A B C D E F
# A = X start
# B = X end
# C = Y start
# D = Y end
# E = traffic Dir parent path
# F = wgetList1.txt, i.e. wget List file name. This will keep on updating in each while loop