Skip to content

Instantly share code, notes, and snippets.

View nanduzira's full-sized avatar
🔥
Coffee Break

ANAND KRISHNA SUNIL nanduzira

🔥
Coffee Break
View GitHub Profile
@nanduzira
nanduzira / image_combine.py
Created February 13, 2020 16:25
Script to combine multiple images into a single one.
import sys
from PIL import Image
from itertools import islice
n_factors = list()
def factors(n, i):
if i==0:
return
elif n%i == 0:
#! /usr/bin/env bash
UPTIME_DAYS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 / 86400)
UPTIME_HOURS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 / 3600)
UPTIME_MINUTES=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 % 3600 / 60)
# Basic info
USERNAME=`whoami`
HOSTNAME=`uname -n`
ROOT=`df -Ph | grep -w nbd0p1 | awk '{print $4}' | tr -d '\n'`
@nanduzira
nanduzira / nginxproxy.md
Created April 3, 2019 09:42 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

if [ $UID -ne 0 ]; then
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
fi
alias sqlarchitect='function _blah(){ java -jar ~/Downloads/architect-1.0.8/architect.jar $1 & };_blah'
alias '.'='function _cdandls(){ cd $1 ; ls ; };_cdandls'
alias '..'='cd .. && l'
alias iping='ifconfig | grep "inet.*Mask:255.255.255.0" && ping 8.8.8.8'
@nanduzira
nanduzira / JS.Done.Right.2.md
Created October 29, 2018 10:22 — forked from arvindpdmn/JS.Done.Right.2.md
JavaScript Done Right! (DOM, Events, Best Practices)

JavaScript Done Right!
Devopedia, Oct 2018

0. Introduction

In this meetup, we'll talk about DOM access and manipulation. This can be done in plain JavaScript using the new APIs introduced in ES6. It can also be done using jQuery. We will look at both approaches. We leave it to developers to choose what suits them.

As a study reference, look at the following cheat sheets:

@nanduzira
nanduzira / JS.Done.Right.md
Created October 29, 2018 10:22 — forked from arvindpdmn/JS.Done.Right.md
JavaScript Done Right! (Basics, Functions, Inheritance, Async)

JavaScript Done Right!
Devopedia, Sept 2018

0. Introduction

JavaScript is one of the top programming languages today. It can also be confusing for developers coming from C, Java or PHP backgrounds. Worse still are the numerous frameworks (such as Angular and React) that make it difficult to decide what to learn and how to use the language.

In this short talk/demo, we'll look at the best practices in JavaScript programming. We'll explain using simple examples. This is for beginners and intermediate JS programmers. You must be familiar with JS syntax. We'll not cover DOM access, jQuery, Node.js or JS frameworks.

The recommendations here assume that you use a transpiler such as Babel so that code can work on older browsers. Therefore we freely use syntax from recent ECMAScript standards.

@nanduzira
nanduzira / Indian_Names_(Kerala)_with_Gender.csv
Last active October 27, 2018 09:00
A CSV file of 20,535+ people details and another 2 separate of Male's & Female's almost cleaned data. Only Names & corresponding Gender. Can be used for ML, Analysis or other Dataset Training purposes.
Name : Gender:
Jishan.P.J Male
Jose.P.C Male
Lusy Female
Veronica Female
Annie Female
Francis.P.C Male
Rinju Female
Sijo Male
Aswathy Female
import java.util.Scanner;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.List;
@nanduzira
nanduzira / ingress-passcode.js
Last active May 30, 2018 06:35 — forked from idealhack/ingress-passcode.js
ingress passcode auto run
// disable iitc plugin if it's on
// go to https://www.ingress.com/intel
// open console and paste in the code below, press enter
// join https://t.me/passcodes for more passcodes
// add jquery
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);