This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# List most recently modified files (will take time) | |
find $1 -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head -20 | |
# get file permissions for a file | |
perl -e 'printf "%o\n", (stat shift)[2]&07777' SOME-FILE | |
# Convert INT to IPv4 | |
perl -MSocket=inet_ntoa -le "print inet_ntoa(pack(\"N\", shift))" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# process list info | |
select id, user, db, host, command, state, time from INFORMATION_SCHEMA.PROCESSLIST; | |
# ALL Tables in ALL DBs | |
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add git branch to prompt | |
parse_git_branch () { | |
git branch 2> /dev/null | grep '\*' | sed 's#\* \(.*\)# (git::\1)#' | |
} | |
parse_svn_branch() { | |
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk '{print " (svn::"$1")" }' | |
} | |
parse_svn_url() { | |
svn info 2>/dev/null | sed -ne 's#^URL: ##p' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################# programming questions below ##################### | |
1. convert this string | |
string = "{key:[[value_1, value_2],[value_3, value4]], 5:10:00AM]}" | |
to this Ruby hash: | |
h = {"key" => [["value_1", "value_2"],["value_3", "value4"]], 5=>"10:00AM"} | |
then convert h to json. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ALL Tables in ALL DBs | |
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length + index_length DESC | |
LIMIT 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -i ipad uas_head.log | sed 's/^/"/g' | sed 's/$/"/g' | tr '\n' ' ' | xargs /Users/derek.smith/dev/ds/scripts/parse.pl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disper -d auto -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
perl -MFile::Find=find -MFile::Spec::Functions -lw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ig.module( | |
'plugins.color-picker' | |
) | |
.requires( | |
) | |
.defines(function(){ | |
/* | |
Initialize object with a default 10 color array fading from | |
White to Red and with a Tri-Color array from Green to Yellow |
NewerOlder