Skip to content

Instantly share code, notes, and snippets.

View rr0hit's full-sized avatar

Rohit rr0hit

  • facets.cloud
  • Bangalore
View GitHub Profile
@rr0hit
rr0hit / test.tf
Created May 5, 2022 11:41
test.tf
locals {
a = {for i in fileset(".", "*.txt"): i => file(i)}
}
resource "local_file" "test1" {
for_each = local.a
filename = "test1out/${each.key}"
content = "Who are you? ${each.value}"
}
@rr0hit
rr0hit / reproduce_deadlock.py
Last active November 5, 2019 13:03
Script to reproduce a deadlock scenario in mysql 5.7.26+
import docker
import mysql.connector
import time
from multiprocessing import Pool
import sys
import random
create_table_statement = '''
CREATE TABLE test.`data` (
`id` int(10) NOT NULL AUTO_INCREMENT,
@rr0hit
rr0hit / install.ps1
Created November 27, 2018 10:53
chocolatey install mirror
# =====================================================================
# Copyright 2017 - Present Chocolatey Software, Inc, and the
# original authors/contributors from ChocolateyGallery
# Copyright 2011 - 2017 RealDimensions Software, LLC, and the
# original authors/contributors from ChocolateyGallery
# at https://github.com/chocolatey/chocolatey.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@rr0hit
rr0hit / tarang-viewer.py
Created May 23, 2013 06:36
A hacked up visualizer for Tarang. To be placed in same directory as the tarangMPI executive, along with with in out folders. Only modes to be output must be W101, W011 and W111 in that order.
#!/usr/bin/env python
from __future__ import unicode_literals
import sys, os, random
from PyQt4 import QtGui, QtCore
from time import sleep
from numpy import arange, sin, pi, array, append, loadtxt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.patches import Rectangle
@rr0hit
rr0hit / sources.list
Created May 22, 2012 07:48
IIT KGP sources.list for Ubuntu 12.04
deb http://10.5.19.220/ubuntu/ precise main restricted
deb http://10.5.19.220/ubuntu/ precise-updates main restricted
deb http://10.5.19.220/ubuntu/ precise universe
deb http://10.5.19.220/ubuntu/ precise-updates universe
deb http://10.5.19.220/ubuntu/ precise multiverse
deb http://10.5.19.220/ubuntu/ precise-updates multiverse
deb http://10.5.19.220/ubuntu/ precise-backports main restricted universe multiverse
deb http://10.5.19.220/ubuntu precise-security main restricted
deb http://10.5.19.220/ubuntu precise-security universe
deb http://10.5.19.220/ubuntu precise-security multiverse