Skip to content

Instantly share code, notes, and snippets.

View kamerk22's full-sized avatar
🔄
Lazy Loading

Kashyap Merai kamerk22

🔄
Lazy Loading
View GitHub Profile
@superseb
superseb / README.md
Last active March 17, 2022 00:14
Move rancher/server with volumes to other host + DNS name change

Move rancher/server container with volumes to other host + change of DNS name (Host Registration URL/CATTLE_URL/API URL) for Rancher 1.6

This applies to Rancher 1.6 only

Variables used in this guide:

@kamerk22
kamerk22 / validate.php
Last active August 25, 2017 11:17
Validation for Singapore NRIC and FIN number in PHP
public static function validIdentification($number)
{
if (strlen($number) !== 9) {
return false;
}
$newNumber = strtoupper($number);
$icArray = [];
for ($i = 0; $i < 9; $i++) {
$icArray[$i] = $newNumber{$i};
@kamerk22
kamerk22 / default.conf
Created June 25, 2017 06:15
Nginx Configuration running PHP7.0-FPM Fast CGI with phpmyadmin and MySQL, Reverse proxy with NodeJS application
server {
listen 80 default_server;
server_name dev ipv6only=on;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location ~ \.php$ {
@kamerk22
kamerk22 / pm2_deploy.sh
Last active July 4, 2017 05:56
Automatic pm2 deploy bash script run on production server as well as development server.
#!/bin/bash
#Author: Kashyap Merai | kashyapk62@gmail.com
# Variables
ch_1="pm2 Production Setup."
ch_2="pm2 Production Update."
ch_3="pm2 Production."
ch_4="pm2 Development Setup."
ch_5="pm2 Development."
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'testing_geojsonPoint';