Skip to content

Instantly share code, notes, and snippets.

View jayadevn's full-sized avatar

Jayadev N jayadevn

View GitHub Profile
@jayadevn
jayadevn / git-backup-to-AWS-S3.sh
Created October 24, 2018 10:25 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to AWS S3
#!/bin/bash
# Script to backup git repo to S3
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
bucket=$GITHUB_BACKUP_BUCKET
dir=$GITHUB_BACKUP_DIR
password=$GITHUB_BACKUP_PASSWORD
account=$GITHUB_ACCOUNT

Keybase proof

I hereby claim:

  • I am jayadevn on github.
  • I am jayadevn (https://keybase.io/jayadevn) on keybase.
  • I have a public key ASABtt03BRL_O458OzBDCvSkFRzU6sraea5E-kn0x-ClCwo

To claim this, I am signing this object:

@jayadevn
jayadevn / WhatsApp-BackUp.js
Created August 20, 2018 09:11 — forked from NrI3/WhatsApp-BackUp.js
Create a whatsapp backup from an specific chat
var oa = document.createElement('a');
oa.href="";oa.type="application/octet-stream";oa.download="named";
document.body.append(oa);
var imageList = document.getElementsByClassName('image-thumb-body');
/* Donwload Images */
for ( x in imageList ) {
if (typeof imageList[x] == 'number') break;
var o = imageList[x];
oa.href = o.src;
@jayadevn
jayadevn / README.md
Created August 20, 2018 09:10
WhatsApp Web Hebrew Aligner

How to install

  1. Install a user scripts extension for your browser:
  2. Install this user script: http://goo.gl/H3RKQA - ignore the "invalid header" error - it's because I'm using the RAW output from the gist, without using the revision (so that it stays current)
  3. ???
@jayadevn
jayadevn / index.html
Created July 8, 2018 15:56 — forked from dixitchoksi/index.html
indiaState
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.state{
fill: none;
stroke: #a9a9a9;
stroke-width: 1;
}
.state:hover{
fill-opacity:0.5;
function calculate_median($arr) {
$count = count($arr); //total numbers in array
$middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value
if($count % 2) { // odd number, middle is the median
$median = $arr[$middleval];
} else { // even number, calculate avg of 2 medians
$low = $arr[$middleval];
$high = $arr[$middleval+1];
$median = (($low+$high)/2);
}
@jayadevn
jayadevn / README.md
Created June 12, 2018 16:18 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@jayadevn
jayadevn / WinUSBFromLinux.md
Created November 10, 2017 18:41
How to make Windows 7 USB flash install media from Linux?

How to make Windows 7 USB flash install media from Linux?

StackOverflow

  • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
  • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
# cfdisk /dev/sdb
or fdisk /dev/sdb (partition type 7, and bootable flag)
@jayadevn
jayadevn / vdi-file-compacting.md
Created November 10, 2017 18:29
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
@jayadevn
jayadevn / batchEntoKn.php
Created May 2, 2017 11:12 — forked from thejeshgn/batchEntoKn.php
Transliterating english to Kannada
<?php
/**
Trasliterate method takes 5 , seaparated english words and transliterates them into Kannada,
The result is an array of words in the same order. This uses Non public Google online transliteration API for this.
When you run this method give a 10ms seconds gap between each call to be on the safer side.
By : Thejesh GN http://thejeshgn.com
More: http://thejeshgn.com/2011/02/04/batch-transliterating-names-into-kannada-using-google-api/