Skip to content

Instantly share code, notes, and snippets.

View rounakdatta's full-sized avatar
💭
roses are sunny, noses are runny

Rounak Datta rounakdatta

💭
roses are sunny, noses are runny
View GitHub Profile
@rounakdatta
rounakdatta / boto3_experiments.ipynb
Created June 7, 2019 09:21
List, create and push to buckets in S3 using boto3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rounakdatta
rounakdatta / abracadabra.ipynb
Last active June 6, 2019 16:16
Hey there! I am doing Machine Learning.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rounakdatta
rounakdatta / pyspark_experiments.ipynb
Created June 6, 2019 12:42
My experiments with PySpark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rounakdatta
rounakdatta / aggregator.py
Last active June 5, 2019 06:33
Gather random image files and aggregate image files from two directories
import requests
import random
import os
def randomImageGenerator(width, height, counter):
myRandomNumber = int((random.random()*10000) // 10)
print("https://picsum.photos/id/{}/{}/{}".format(myRandomNumber, width, height))
rawImageRawOriginal = requests.get("https://picsum.photos/id/{}/{}/{}".format(myRandomNumber, width, height))
rawImageRawSmaller = requests.get("https://picsum.photos/id/{}/{}/{}".format(myRandomNumber, width // 10, height // 10))
@rounakdatta
rounakdatta / sshrm.md
Created May 17, 2019 19:18
Connecting through SSH on SRM Network

Remote Machine Configurations

  1. Ensure you're on a non-SRM network. Access the remote machine first as: sudo ssh -i yourkey.pem [email protected]
  2. Execute nano /etc/ssh/sshd_config and change #PORT 22 to PORT 443. This ensures the remote machine has its SSH daemon listening on port 443.
  3. Execute sudo systemctl restart ssh.service to restart the daemon.
  4. Ensure that it is actually listening on port 443: sudo netstat -nupt -l.
  5. Goto your AWS/DO/GCP web console and configure the Inbound ports. You generally would have to create a new Inbound rule (HTTPS-TCP-443-0.0.0.0/0).

Your Machine Configurations

@rounakdatta
rounakdatta / postgresHelper.md
Last active April 18, 2019 20:22
Setting up PostgreSQL on you Arch Linux

Installing postgresql on your Arch Linux

Enter the postgres-located terminal

sudo -iu postgres

Initialize postgres database system

initdb -D /var/lib/postgres/data/

Create an user (go with your UNIX username for a cakewalk)

createuser --interactive

@rounakdatta
rounakdatta / bootstrap-table.js
Last active April 7, 2019 11:00
Custom-paginated Bootstrap table
/**
* @author zhixin wen <[email protected]>
* version: 1.10.0
* https://github.com/wenzhixin/bootstrap-table/
*/
!function ($) {
'use strict';
// TOOLS DEFINITION
@rounakdatta
rounakdatta / keepMyServerAlive.gs
Created March 30, 2019 05:41
Keep hypersomniac sites awake
function keepMyServerAlive() {
var allMySites = ['https://google.com'];
for (var siteIndex in allMySites) {
var currentSite = allMySites[siteIndex];
try {
var response = UrlFetchApp.fetch(currentSite);
Logger.log(response.getContentText());
@rounakdatta
rounakdatta / emailSender.py
Created March 16, 2019 04:21
Programmatically send emails through SMTP using Python (Yandex Mail)
def sendReportMail(emailAddress, passwordText, title, content):
import smtplib
from email.mime.text import MIMEText
smtp_ssl_host = 'smtp.yandex.com' # change to your own SMTP host
smtp_ssl_port = 465
username = emailAddress
password = passwordText
sender = emailAddress
targets = ['[email protected]']
@rounakdatta
rounakdatta / bootstrap-table-export.js
Created March 11, 2019 18:47
Bootstrap Table Export Direct Download as Excel
/**
* @author zhixin wen <[email protected]>
* extensions: https://github.com/kayalshri/tableExport.jquery.plugin
*/
(function ($) {
'use strict';
var TYPE_NAME = {
json: 'JSON',