Skip to content

Instantly share code, notes, and snippets.


Malkit Singh malkitsingh

View GitHub Profile
malkitsingh / info.txt
Created Sep 4, 2019
Managing multiple sites from single server using Nginx
View info.txt
Short note on how to manage multiple sites with SSL from Nginx
make file in
Contents of will look like this once done
server {
malkitsingh / info.txt
Last active Nov 20, 2020
How to set up GitLab Runner on DigitalOcean
View info.txt
## 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.
# Install the GitLab Runner #
First, login to the new droplet via SSH and verify that Docker is installed with:
`docker info`
malkitsingh / notes.js
Created Jan 19, 2018
some of node code snippets
View notes.js
// to upload file to s3 bucket.
var AWS = require('aws-sdk');
AWS.config = new AWS.Config();
AWS.config.accessKeyId = "XXX";
AWS.config.secretAccessKey = "XXXXX";
AWS.config.region = "ap-south-1";
var s3 = new AWS.S3();
malkitsingh / info.txt
Last active Apr 14, 2019
Setting Node.JS on Ubuntu
View info.txt
**Install Node.js**
cd ~
curl -sL -o
sudo bash
sudo apt-get install nodejs
sudo apt-get install build-essential
**Install Nginx**
sudo apt-get update
malkitsingh / ajenti installation on ubuntu
Created Jun 29, 2017
Installation guide to install ajenti on ubuntu
View ajenti installation on ubuntu
1. wget -O- | sudo apt-key add -
2. echo "deb main main ubuntu" | sudo tee -a /etc/apt/sources.list
3. sudo apt-get update && sudo apt-get install ajenti
4. sudo service ajenti restart
5. access using https://your-ip:8000
malkitsingh / info.txt
Created Apr 15, 2017
creating pem file from p12
View info.txt
openssl pkcs12 -in Certificates2.p12 -out pushcert.pem -nodes -clcerts
malkitsingh / info.txt
Created Apr 15, 2017
checking port in use and killing active process
View info.txt
For windows
first, find process id using his port
netstat -a -n -o | find "123456"
then, kill the process by id
taskkill /F /PID 3312
malkitsingh / instructions.txt
Created Feb 2, 2017
Step by step guide to install nominatim server
View instructions.txt
I followed these two blogs to install server
This explains ( and is the main blog which I followed) various steps
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
malkitsingh / .htaccess
Created Dec 22, 2016
Running node app with proxy from any port and map to port 80
View .htaccess
<VirtualHost IP:80>
DocumentRoot /var/www/xyz/data/www/
DirectoryIndex index.html index.php
<!--------------- stuff which is placed in this file
ProxyRequests off
<Proxy *>
malkitsingh / backup.bat
Created Dec 7, 2016
batch file to run mongodb daily tasks
View backup.bat
@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:.=_%
You can’t perform that action at this time.