Skip to content

Instantly share code, notes, and snippets.

View karuna's full-sized avatar
🦡
Badger Badger Badger

Karuna Murti karuna

🦡
Badger Badger Badger
View GitHub Profile
@karuna
karuna / gotham
Last active January 8, 2018 07:33
Rails + Rocket Benchmark
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
@karuna
karuna / pre-commit.sh
Created September 22, 2017 02:24
Pre commit hook for rails app. put this inside .git
#!/bin/sh
# this hook is in SCM so that it can be shared
# to install it, create a symbolic link in the projects .git/hooks folder
#
# i.e. - from the .git/hooks directory, run
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit
#
# to skip the tests, run with the --no-verify argument
# i.e. - $ 'git commit --no-verify'
FILES='(js|css|rb)'
@karuna
karuna / cloudSettings
Last active May 17, 2021 05:58
Visual Studio Settings Work
{"lastUpload":"2021-05-17T05:58:50.309Z","extensionVersion":"v3.4.3"}
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
#[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=erasedups:ignorespace
@karuna
karuna / gist:eaf5540f0014e1f184cf2921bed5b45b
Created June 21, 2017 08:34 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
rds-modify-db-parameter-group {param-group-name} \
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=query_cache_type, value=1, method=pending-reboot" \
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \
ALTER TABLE `compathy2_production`.`spots` DROP INDEX `index_spots_on_name`, ADD INDEX `index_spots_on_name` (`name`(10));
@karuna
karuna / policy.json
Created May 25, 2017 02:02
S3 Bucket Policy
{
"Version": "2008-10-17",
"Id": "",
"Statement": [
{
"Sid": "Allow in my domains",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
require "net/http"
require "uri"
proxy_addr = "localhost"
proxy_port = 3128
uri = URI.parse "http://www.ugtop.com/spill.shtml"
Net::HTTP.new(uri.host, uri.port, proxy_addr, proxy_port).start do |http|
request = Net::HTTP::Get.new(uri.request_uri)
@karuna
karuna / steam.sh
Created November 5, 2016 07:43
Steam script
#!/bin/sh
find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete
find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete
LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libgpg-error.so'
exec /usr/bin/steam "$@"
@karuna
karuna / unshift
Last active October 22, 2016 17:48
$:.unshift File.dirname(__FILE__) + '/lib'