Skip to content

Instantly share code, notes, and snippets.

View Harshakvarma's full-sized avatar
🎯
Focusing

Harshavardhan Kalidindi Harshakvarma

🎯
Focusing
View GitHub Profile
@Harshakvarma
Harshakvarma / README.md
Created May 8, 2018 19:29 — forked from twolfson/README.md
Quick and dirty database dump to S3 via Node.js

We are implementing database dumping which is straightforward but can be tedious to setup. Here's our setup:

  1. Create AWS user for db backups (e.g. db-backups-{{app}})
    • Save credentials in a secure location
    • If adding db scrubbing, use a separate user (e.g db-scrubs-{{app}})
  2. Create bucket for S3 access logging (e.g. s3-access-log-{{app}})
  3. Create consistently named bucket for db dumps (e.g. db-backups-{{app}})
    • Enable logging to s3-access-log-{{app}} with prefix of db-backups-{{app}}
  4. Add IAM policy for bucket access
  • Select user -> Choose "Add inline policy"
@Harshakvarma
Harshakvarma / MixPanelExport.py
Last active June 19, 2018 06:42 — forked from trentniemeyer/MixPanelExport.py
MixPanel Export API in Python 3
I got it working
```python
import base64
import urllib.request
import ssl
try:
import json
except ImportError:
import simplejson as json
@Harshakvarma
Harshakvarma / testing.py
Created June 20, 2018 05:13
Python sample loop
import os
import time
import logging
from datetime import datetime
#logs
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# create a file handler
@Harshakvarma
Harshakvarma / testing.py
Created June 20, 2018 05:14
Python sample loop to test background running
import os
import time
import logging
from datetime import datetime
#logs
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# create a file handler
@Harshakvarma
Harshakvarma / README.md
Created July 2, 2018 01:18
Crontab simplest test

Sample crontab

https://crontab.guru/ - online crontab generator

  1. Empty temp folder every Friday at 5pm
# β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ minute (0 - 59)
# β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ hour (0 - 23)
# β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of month (1 - 31)
# β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ month (1 - 12)
# β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of week (0 - 6) (Sunday to Saturday;
@Harshakvarma
Harshakvarma / ical.md
Created September 5, 2018 18:15 — forked from meskarune/ical.md
parsing ical file with python icalendar

Archwomen.ics file

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20170220T182458Z
LAST-MODIFIED:20170220T182458Z
DTSTAMP:20170220T182458Z
const USER = require("../../src/db/userDB");
const moment = require("moment");
const Sequelize = require('sequelize');
const config = require("config");
const plaid = require('plaid');
const util = require('util');
const pe = require('parse-error');
var PLAID_CLIENT_ID = config.get("plaidCred.PLAID_CLIENT_ID");
var PLAID_SECRET = config.get("plaidCred.PLAID_SECRET");
const USER = require("../../src/db/userDB");
const moment = require("moment");
const Sequelize = require('sequelize');
const config = require("config");
const plaid = require('plaid');
const util = require('util');
const pe = require('parse-error');
var PLAID_CLIENT_ID = config.get("plaidCred.PLAID_CLIENT_ID");
var PLAID_SECRET = config.get("plaidCred.PLAID_SECRET");
@Harshakvarma
Harshakvarma / plaidRemoveAllItem.js
Created September 5, 2019 04:52
Script to delete/remove all item in plaid https://plaid.com/docs/#remove-an-item
const USER = require("../../src/db/userDB");
const moment = require("moment");
const Sequelize = require('sequelize');
const config = require("config");
const plaid = require('plaid');
const util = require('util');
const pe = require('parse-error');
var PLAID_CLIENT_ID = config.get("plaidCred.PLAID_CLIENT_ID");
var PLAID_SECRET = config.get("plaidCred.PLAID_SECRET");
@Harshakvarma
Harshakvarma / settings.json
Created October 10, 2019 17:54
Vscode mac
{
"editor.fontFamily": "FiraCode-Retina",
"editor.fontLigatures": true,
"terminal.integrated.shell.osx": "/bin/zsh",
"workbench.activityBar.visible": true,
"window.zoomLevel": 0,
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"workbench.editor.showTabs": true,