Skip to content

Instantly share code, notes, and snippets.

View gwthm-in's full-sized avatar
💭
I may be slow to respond.

Gowtham Sai gwthm-in

💭
I may be slow to respond.
View GitHub Profile
@gwthm-in
gwthm-in / postgres_queries_and_commands.sql
Created August 16, 2019 21:56 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@gwthm-in
gwthm-in / Dockerfile
Last active March 19, 2019 18:08
Docker file to build price estimator
FROM golang:1.11.5-alpine
RUN mkdir /estimate
ADD . /estimate
WORKDIR /estimate
RUN go build main.go
FROM alpine:latest
COPY --from=base /estimate/main /usr/local/bin/estimator
@gwthm-in
gwthm-in / price_estimator.go
Created February 17, 2019 11:28
Simple Service to Estimate Pricing
package main
import (
"encoding/json"
"fmt"
"log"
"math"
"math/rand"
"net/http"
"os"
@gwthm-in
gwthm-in / local_kubernetes_weaver.bash
Last active March 20, 2019 22:14
Deploying Weaver to Kubernetes
$ minikube start
There is a newer version of minikube available (v0.34.1). Download it here:
https://github.com/kubernetes/minikube/releases/tag/v0.34.1
To disable this notification, run the following:
minikube config set WantUpdateNotification false
Starting local Kubernetes v1.13.2 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
@gwthm-in
gwthm-in / sketch-never-ending.md
Created March 27, 2018 06:55 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@gwthm-in
gwthm-in / nginx.conf
Created February 2, 2017 18:51 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
"""
Simple calendar using ttk Treeview together with calendar and datetime
classes.
"""
import calendar
import tkinter
import tkinter.font
from tkinter import ttk
def get_calendar(locale, fwday):
@gwthm-in
gwthm-in / monitrc
Created December 14, 2016 00:47 — forked from franck/monitrc
monit config file (nginx, mysql, redis, tomcat)
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.