Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Malkit Singh malkitsingh

🎯
Focusing
Block or report user

Report or block malkitsingh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@malkitsingh
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 domainOne.com domainTwo.com file in
/etc/nginx/sites-available
Contents of domainOne.com will look like this once done
server {
server_name domainOne.com www.domainOne.com;
@malkitsingh
malkitsingh / info.txt
Last active Jun 11, 2019
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.
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 / 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
malkitsingh / info.txt
Last active Apr 14, 2019
Setting Node.JS on Ubuntu
View info.txt
**Install Node.js**
cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
sudo apt-get install build-essential
**Install Nginx**
sudo apt-get update
@malkitsingh
malkitsingh / ajenti installation on ubuntu
Created Jun 29, 2017
Installation guide to install ajenti on ubuntu
View ajenti installation on ubuntu
1. wget http://repo.ajenti.org/debian/key -O- | sudo apt-key add -
2. echo "deb http://repo.ajenti.org/ng/debian 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
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
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
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
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
@malkitsingh
malkitsingh / .htaccess
Created Dec 22, 2016
Running node app with proxy from any port and map to port 80
View .htaccess
<VirtualHost IP:80>
ServerName xyz.com
ServerAlias www.xyz.com
DocumentRoot /var/www/xyz/data/www/xyz.com
ServerAdmin webmaster@xyz.com
DirectoryIndex index.html index.php
<!--------------- stuff which is placed in this file
ProxyRequests off
<Proxy *>
@malkitsingh
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.