Skip to content

Instantly share code, notes, and snippets.

View amitt001's full-sized avatar

Amit Tripathi amitt001

View GitHub Profile
"""
Returns result in the format:
{
"B": {
2401: "1/6 = 2%",
3101: "1/6 = 2%"
},
"C": {
"02": "3/6 = 50%"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/amittripathi/.oh-my-zsh
export EDITOR=vim
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@amitt001
amitt001 / proc_debug.md
Last active November 28, 2019 09:32
Process/Thread debugging

Debug Process/Threads

List threads

ps -e -T

A specific pid

ps -Tp <pid>

package main
import (
"sync"
"fmt"
"time"
"github.com/amitt001/moodb/client"
server "github.com/amitt001/moodb/mdbserver"
)
@amitt001
amitt001 / ttfb.sh
Created May 23, 2019 14:39 — forked from sandeepraju/ttfb.sh
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@amitt001
amitt001 / docker-compose.yaml
Created March 22, 2019 08:25
Kafka Cluster Docker compose
version: '2'
services:
zookeeper-1:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper-1
ports:
- "12181:12181"
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 12181
import sys
import time
from kubernetes import config, client
class KubeControl:
def __init__(self):
# config.load_kube_config(context='staging')
config.load_kube_config()
@amitt001
amitt001 / gist:3b2c3996784d1e32786044a4f15f99eb
Created February 23, 2017 07:44 — forked from drorata/gist:146ce50807d16fd4a6aa
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
OpenSubtitles.org has apparently updated their servers. That uncovered latent bugs in the very dumb HTTP support of the VLSub extension.
To work around the problem (you might need administrator privileges):
Go to the VLC installation directory.
Look for the file named lua/extensions/VLSub.luac.
Open that file in a binary or hexadecimal editor. (DO NOT USE a text editor.)
Look for the character sequence "HTTP/1.1" (without quotes).
Replace the last one by a zero: "HTTP/1.0".
Repeat the procedure; there should be a second occurence in the file.
Save the file.
@amitt001
amitt001 / Devstack
Created September 24, 2016 18:01
Set up devstack
VBox: http://linoxide.com/linux-how-to/setup-centos-7-vagrant-base-box-virtualbox/
OR
Vagrant centos: https://atlas.hashicorp.com/relativkreativ/boxes/centos-7-minimal