This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<_locDefinition xmlns="urn:locstudio"> | |
<_locDefault _loc="locNone" /> | |
<_locTag _loc="locData">Title</_locTag> | |
<_locTag _loc="locData">Description</_locTag> | |
<_locTag _loc="locData">Author</_locTag> | |
<_locTag _loc="locData">ToolTip</_locTag> | |
<_locTag _loc="locData">Default</_locTag> | |
</_locDefinition> |
This file contains 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
USE database; | |
GO | |
SELECT t.name AS t_name, | |
SCHEMA_NAME(schema_id) AS s_name, | |
c.name AS column_name | |
FROM sys.tables AS t | |
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID | |
--WHERE c.name LIKE '%ID' | |
ORDER BY s_name, t_name; |
This file contains 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
find . | xargs head -n1 | strings | grep :// > squid-urls.txt #list of urls in squid cache | |
#purge pattern from cache | |
for x in `cat squid-urls.txt | grep foo`; do | |
squidclient -m PURGE $x ; | |
done | |
#format the dates | |
perl -p -e 's/^([0-9\.]*)/"[".localtime($1)."]"/e' *.log |
This file contains 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/slurp | |
# modeline and info {{{1 # | |
# vim: set ft=sh foldmethod=marker foldmarker={{{,}}} foldenable | |
####################################################################### | |
# build script for vim. # | |
# see http://vim.wikia.com/wiki/Building_Vim # | |
####################################################################### | |
# 1}}} # | |
# remove vim first {{{ # |
This file contains 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
#print occurrance off ;,|[:TAB:] | |
#this might be the delim | |
awk -vFS="" '{for(i=1;i<=NF;i++){ if($i~/[,;| ]/) { w[tolower($i)]++} } }END{for(i in w) print i,w[i]}' file.csv |sort -n|head -1|cut -f1 -d" " | |
#find longest line | |
awk -F"$DELIM" '{ if ( length > L ) { L=length} }END{ print L}' $1 | |
#fix commas after quotes, good for cleaning csv files | |
awk -F'"' -v OFS='' '{ for (i=2; i<=NF; i+=2) gsub(",", "", $i) } 1' $1 |
This file contains 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/sh | |
sed -re 's/[%]([[:xdigit:]]{,2})/\\\x\1/g' "$1"| xargs -0 printf '%b' |
This file contains 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/sh | |
sed -re ' | |
s/^.*$/<tr>\n<td>&<\/td>\n<\/tr>/g | |
s/[,]/<\/td>\n<td>/g | |
1i <table style="width:100%"> | |
$a\<\/table>' "$1" |
This file contains 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
# Dates YYYY-MM-DD HH:MM:SS | |
grep -oP '[1-2][90][0-9]{2,2}([-/ ])[0-2][0-9]\1[0-2][0-9] [0-2][0-9]([:])[0-6][0-9]\2[0-6][0-9]' | |
# | |
perl -pe 's/[^[:ascii:]]//g' |
This file contains 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
#nix date conversion | |
# time2unixStamp | |
date -d "2016/03/01 01:00:00" "+%s" | |
#readline | |
while read line ; do echo $line\;$(date -d "$t" "+%s") ; done < $1 | |
#unixTime2human | |
date -d @1458636426 | |
awk '{ print strftime("%c", $0); }' $1 |