Skip to content

Instantly share code, notes, and snippets.

View coldpour's full-sized avatar

Mike Holm coldpour

View GitHub Profile
@coldpour
coldpour / gist:727fb2d1ef9932ba09e6c9c34c30527b
Created February 13, 2017 17:49
move symlinks from one user to another
repairLinks() { for l in `ls -la | grep '\->' | grep "${1}" | awk '{print $9 "->" $11}'`; do t=`echo ${l%->*}`; o=`echo ${l#*->}`; s=`echo $o | sed "s/${1}/${2}/"`; echo "moving link ${t} from ${o} to ${s}"; rm -f $t; ln -s $s $t; done }
# example usage
# -------------
# repairLinks mholm holmi09
@coldpour
coldpour / git-branch-delete-merged
Last active September 8, 2015 17:39
delete merged branches
#!/bin/bash
echo PRUNING && \
git fetch --prune && \
branches=$(git branch --remotes --merged origin/master | grep -v origin/master | sed 's, origin/, :,' | tr -d '\n') && \
cmd="git push origin ${branches}" && \
echo "RUNNING ${cmd}" && \
${cmd}
@coldpour
coldpour / long_running_oracle.sql
Last active August 29, 2015 14:26
find long running queries on an oracle db
SELECT
a.SID,
a.serial#,
b.spid,
a.username,
a.ecid request_id,
a.client_identifier client_id,
a.sql_id,
a.sql_child_number as child#,
CASE
javascript:(function() {
var e = document.getElementById('pull_request_body');
if (e) {
if (e.value) {
e.value += '\n\n';
}
e.value += '
#### What does this PR do?\n\n
#### Any background context you want to provide?\n\n
#### Where should the reviewer start?\n\n