Skip to content

Instantly share code, notes, and snippets.

Avatar

Balman Rawat BalmanRawat

  • Coudfactory
  • Bhainsipati, Laltipur
View GitHub Profile
@BalmanRawat
BalmanRawat / qattrs.sh
Created Aug 14, 2020
Get AWS SQS queue attributes of multiple queues
View qattrs.sh
#!/bin/bash
if [ -z ${AWS_PROFILE} ]
then
echo "AWS_PROFILE is not set"
exit
fi
if [ -z ${AWS_REGION} ]
then
@BalmanRawat
BalmanRawat / Readme.md
Created Aug 13, 2020
Sorting Challenge
View Readme.md

UseCase

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
BalmanRawat / cfn-delete.sh
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
View cfn-delete.sh
#!/bin/bash
if [ -z "${DELETE_PATTERN}" ]
then
echo "please set DELETE_PATTERN environment variable with pattern to delete"
exit
fi
if [ -z "${AWS_PROFILE}" ]
then
@BalmanRawat
BalmanRawat / setup.org
Last active Apr 27, 2019
created for the ROR training
View setup.org

Ruby on Rails Setup in Windows Machine 💻

Install gitbash

Download ⬇️

Verify 🚥

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

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

GET

/users

curl -X GET http://localhost:3000/users
View alfa.tex
% Created 2019-01-24 Thu 13:31
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
@BalmanRawat
BalmanRawat / factorial.go
Last active Jan 7, 2019
go example for factorial
View factorial.go
package main
import (
"fmt"
)
func factorial(n uint) uint {
if n < 0 || n > 100 {
@BalmanRawat
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 http://www.darkcoding.net/software/memcached-list-all-keys/ 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
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">
<head>
<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
BalmanRawat / main.org
Created Feb 3, 2017
firmware issue on Ubuntu 16.04 while upgrading kernel 4.9