Skip to content

Instantly share code, notes, and snippets.


Balman Rawat BalmanRawat

  • Coudfactory
  • Bhainsipati, Laltipur
View GitHub Profile
BalmanRawat /
Created Aug 14, 2020
Get AWS SQS queue attributes of multiple queues
if [ -z ${AWS_PROFILE} ]
echo "AWS_PROFILE is not set"
if [ -z ${AWS_REGION} ]
BalmanRawat /
Created Aug 13, 2020
Sorting Challenge


We have a list containing 25 numbers, that we need to sort and figure out the greatest three numbers. However, the catch is that you can only sort 5 numbers in a single operation. So, basically imagine a function that will sort your numbers but can only take in 5 at a time. Using this function we need to be able to sort the 25 numbers to get top 3. Also, make a note of how many times the sorting function is called.

BalmanRawat /
Last active Oct 6, 2020
Delete all the CloudFormation stacks with given search-pattern recursively until every stack is deleted. Make sure to provide DELETE_PATTERN, AWS_PROFILE, AWS_REGION mandatory variables. Dependencies: JQ
if [ -z "${DELETE_PATTERN}" ]
echo "please set DELETE_PATTERN environment variable with pattern to delete"
if [ -z "${AWS_PROFILE}" ]
BalmanRawat /
Last active Apr 27, 2019
created for the ROR training

Ruby on Rails Setup in Windows Machine 💻

Install gitbash

Download ⬇️

Verify 🚥

press Win(key) + R shortcut
BalmanRawat /
Last active Mar 14, 2019
Test the Org mode

Kopila Api Org

Kopila API

Here are the lists of API that are exposed by this api backed. Document is categorized based on the REST API request type



curl -X GET http://localhost:3000/users
View alfa.tex
% Created 2019-01-24 Thu 13:31
% Intended LaTeX compiler: pdflatex
BalmanRawat / factorial.go
Last active Jan 7, 2019
go example for factorial
View factorial.go
package main
import (
func factorial(n uint) uint {
if n < 0 || n > 100 {
BalmanRawat / dump_memcache.rb
Last active Aug 2, 2019
Dumping and restoring the memcache key values using telnet & dalli gem
View dump_memcache.rb
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
require 'csv'
headings = %w(id expires bytes key)
rows = []
BalmanRawat / drawing_competition_at_duckuchap.html
Last active Mar 3, 2017
drawing competition roles and responsibilities cloudfactory CSP
View drawing_competition_at_duckuchap.html
<!doctype html>
<html lang="en">
<title>Drawing Competition for Primary School</title>
<!-- 2017-03-03 Fri 11:29 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Org-mode">
<meta name="author" content="Balman Rawat">
BalmanRawat /
Created Feb 3, 2017
firmware issue on Ubuntu 16.04 while upgrading kernel 4.9