Skip to content

Instantly share code, notes, and snippets.

View malkitsingh's full-sized avatar
🎯
Focusing

Malkit Singh malkitsingh

🎯
Focusing
View GitHub Profile
@malkitsingh
malkitsingh / info.txt
Last active November 20, 2020 05:51
How to set up GitLab Runner on DigitalOcean
## Create a droplet ##
Fortunately, DigitalOcean has a one-click image with Docker pre-installed on Ubuntu 14.04 use this link to create new droplet.
https://www.digitalocean.com/features/one-click-apps/docker/
# Install the GitLab Runner #
First, login to the new droplet via SSH and verify that Docker is installed with:
`docker info`
@malkitsingh
malkitsingh / backup.bat
Created December 7, 2016 18:06
batch file to run mongodb daily tasks
@echo off
REM move into the backups directory
CD C:\backup
REM Create a file name for the database output which contains the date and time. Replace any characters which might cause an issue.
set filename=database %date% %time%
set filename=%filename:/=-%
set filename=%filename: =__%
set filename=%filename:.=_%
public String ConvertImageURLToBase64(String url)
{
StringBuilder _sb = new StringBuilder();
Byte[] _byte = this.GetImage(url);
_sb.Append(Convert.ToBase64String(_byte, 0, _byte.Length));
return _sb.ToString();
}
@malkitsingh
malkitsingh / instructions.txt
Created February 2, 2017 17:37
Step by step guide to install nominatim server
I followed these two blogs to install server
1. http://koo.fi/blog/2015/03/19/openstreetmap-nominatim-server-for-geocoding/#Compile_Nominatim
This explains ( and is the main blog which I followed) various steps
2. https://www.linuxbabe.com/linux-server/openstreetmap-tile-server-ubuntu-16-04
This explains how to setup swap files and install tiles if needed.
I will use Ubuntu 14.04 LTS as the platform. Just a basic install with ssh server. We will install Apache to serve http requests. Make sure you have enough disk space and RAM to hold the data and serve it efficiently. I used the Finland extract, which was about a 200 MB download. The resulting database was 26 GB after importing, indexing and adding Wikipedia data. The Wikipedia data probably actually took more disk space than the OSM data. My server has 4 GB RAM, which seems to be enough for this small data set.
1. Sofware requirements