Skip to content

Instantly share code, notes, and snippets.

Game is on

Prasanna worldofprasanna

Game is on
View GitHub Profile
# Install postgres plugin
dokku plugin:install postgres
# Create postgres database
dokku postgres:create my-database
# Link the postgres with the app
dokku postgres:link <DB_NAME> <APP_NAME>
# eg: dokku postgres:link my-database getting-started-with-dokku
worldofprasanna /
Created Jun 7, 2020
Adding team mates to dokku application
# SSH into the virtual machine
ssh root@<vm-public-ip-address>
# Add their public keys to the authorized keys
vi ~/.ssh/authorised_keys
# Add their public keys to the dokku application
dokku ssh-keys:add <user> <path-to-public-key>
# eg: dokku ssh-keys:add prasanna /root/pub-keys/
# List the users who have permission
dokku ssh-keys:list
# Push the changes to remote(dokku) origin
git push dokku master
# List the apps in dokku
dokku apps:list
worldofprasanna /
Last active Jun 7, 2020
Create new application in dokku
# Clone the repo
git clone
# cd into the repo
cd getting-started-with-dokku
# Install dokku client locally
brew install dokku/repo/dokku
# Create dokku app
dokku apps:create getting-started-with-dokku
# Add a git remote to point to dokku app
git remote add dokku dokku@<vm-public-ip-address>:getting-started-with-dokku
worldofprasanna /
Last active Jun 7, 2020
Installation of dokku
ssh root@<vm-public-ip-address>
# Inside VM
sudo DOKKU_TAG=v0.20.4 bash
worldofprasanna /
Last active May 3, 2020
Create S3 bucket to hold static assets
resource "aws_s3_bucket" "main" {
policy = data.aws_iam_policy_document.bucket_policy.json
website {
index_document = var.index_document
data "aws_iam_policy_document" "bucket_policy" {
actions = [
worldofprasanna /
Last active May 3, 2020
Terraform script to serve your static assets
module "staticwebsite" {
source = "worldofprasanna/staticwebsite/aws"
version = "1.0.0"
domain = ""
# To create the resource,
terraform apply
# To upload the static assests,
aws s3 sync build/ s3://
worldofprasanna / terraform_issue_aws_s3_object.log
Last active May 2, 2020
Terraform issue when creating aws_s3_object
View terraform_issue_aws_s3_object.log
2020/05/02 19:50:54 [INFO] Terraform version: 0.12.24
2020/05/02 19:50:54 [INFO] Go runtime version: go1.13.8
2020/05/02 19:50:54 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2020/05/02 19:50:54 [DEBUG] Attempting to open CLI config file: /Users/prasanna/.terraformrc
2020/05/02 19:50:54 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/02 19:50:54 [INFO] CLI command args: []string{"apply"}
2020/05/02 19:50:54 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/05/02 19:50:54 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/05/02 19:50:54 [DEBUG] New state was assigned lineage "39f352e1-5d2f-f7a4-b2ff-273d5267b668"
2020/05/02 19:50:54 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
worldofprasanna /
Created Nov 22, 2019
Download APK files from google play store
import sys
import os
from gpapi.googleplay import GooglePlayAPI
def main():
server = GooglePlayAPI('en_US', 'America/New York', 'bacon')
server.login(email="<gmail userid>", password="<gmail password>")
storagepath = '/tmp/'
download ='com.whatsapp', expansion_files=False)
View recursive-queries.sql
- id
- name
- parent
Sample Data:
║ id ║ name ║ parent ║