Skip to content

Instantly share code, notes, and snippets.

View SathyaBhat's full-sized avatar
🎶

Sathyajith Bhat SathyaBhat

🎶
View GitHub Profile
@SathyaBhat
SathyaBhat / analyze_rebuild_index.sql
Created November 10, 2010 21:54
Analyze & Compute Oracle Table Statistics & Rebuild & Move indexes to different tablespace
SET NEWPAGE 0 PAGESIZE 0 FEEDBACK OFF HEADING OFF
spool analyze_rebuild_index.sql
SELECT 'ALTER TABLE '||TABLE_NAME|| ' INITRANS 30;' FROM USER_TABLES;
SELECT 'ALTER INDEX '||INDEX_NAME|| ' INITRANS 50;' FROM USER_INDEXES;
SELECT 'ALTER INDEX '||INDEX_NAME||' REBUILD TABLESPACE INDX ;' FROM USER_INDEXES;
SELECT 'ALTER INDEX '||INDEX_NAME|| ' REBUILD;' FROM USER_INDEXES;
SELECT 'ANALYZE TABLE '||TABLE_NAME ||' COMPUTE STATISTICS;' FROM USER_TABLES;
@SathyaBhat
SathyaBhat / mysql_stored_procs.sh
Created January 25, 2017 07:15
mysql download only stored procedures
mysqldump -n -t -d -R -u <username> -p -h <host name> <database> stored_procs.sql
@SathyaBhat
SathyaBhat / get_git_branches.sh
Created January 11, 2017 13:04
Get a list of all branches from a repository
#! /bin/bash
#Replace {GIT_URL} with your repo
git ls-remote --heads {GIT_URL} | aws -F" " '{print $NF}' | cut -c12- -
@SathyaBhat
SathyaBhat / gist:25a3cd875975fc4403e67bf9c93eef03
Created July 25, 2016 10:51
Rename extensions of multiple files
rename "s/oldExtension/newExtension/" *.txt
via http://unix.stackexchange.com/a/159466/1648

Keybase proof

I hereby claim:

  • I am sathyabhat on github.
  • I am sathyabhat (https://keybase.io/sathyabhat) on keybase.
  • I have a public key whose fingerprint is 5FCB F734 4552 EAD3 AC94 1F9F 153D 7E6D 960C 2D20

To claim this, I am signing this object:

@SathyaBhat
SathyaBhat / superping-close-voters
Created June 25, 2013 04:52
Adds a button for copying superping-ready user names of close voters
// ==UserScript==
// @name Copy User Links
// @author Werner Robitza
// @namespace
// @description Adds a button for copying superping-ready user names of close voters
// @include http://stackoverflow.com/*
// @include http://meta.stackoverflow.com/*
// @include http://superuser.com/*
// @include http://serverfault.com/*
// @include http://meta.superuser.com/*
@SathyaBhat
SathyaBhat / gist:5559816
Last active December 17, 2015 05:39
Custom proforma comments for WebApps
callback(
[
{ "name": "No Product recco", "description": "Sorry, [webapps.se] doesn't do product recommendations."},
{ "name": "Nothing but a URL (and isn't spam)", "description": "Whilst this may theoretically answer the question, <a href=\"http://meta.stackoverflow.com/q/8259\">it would be preferable</a> to include the essential parts of the answer here, and provide the link for reference."},
{ "name": "Requests to OP for further information", "description": "This is really a comment, not an answer. With a bit more rep, <a href=\"http://$SITEURL$/privileges/comment\">you will be able to post comments</a>. For the moment I've added the comment for you, and I'm flagging this post for deletion."},
{ "name": "OP using an answer for further information", "description": "Please use the <em>Post answer</em> button only for actual answers. You should modify your original question to add additional information."},
// ==UserScript==
// @name Stack Exchange Retag helper
// @namespace Rob W
// @author Rob W
// @description Configurable helper to enable a quicker retagging of questions at Stack Overflow
// @include http://*.superuser.com/questions/*
// @include http://*.superuser.com/q/*
// @include http://*.superuser.com/search?*
// @include http://*.superuser.com/*/edit*
// @version 2.2
@SathyaBhat
SathyaBhat / gist:2273068
Created April 1, 2012 08:00
Ruby code to go through home timeline & expand t.co URLs
require 'twitter'
def setup_twitter()
Twitter.configure do |config|
config.consumer_key = ""
config.consumer_secret = ""
config.oauth_token = ""
config.oauth_token_secret = ""
end
twitter = Twitter::Client.new
@SathyaBhat
SathyaBhat / autoreviewcomments.user.js
Created November 24, 2011 09:09 — forked from Benjol/autoreviewcomments.user.js
Add pro-forma comments dialog for reviewing (pre-flag)
// ==UserScript==
// @name AutoReviewComments
// @namespace benjol
// @version 1.1.6
// @description Add pro-forma comments dialog for reviewing (pre-flag)
// @include http://*stackoverflow.com/questions*
// @include http://*stackoverflow.com/review*
// @include http://*stackoverflow.com/admin/dashboard*
// @include http://*serverfault.com/questions*
// @include http://*serverfault.com/review*