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
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAAObklEQVRo3r1aa2wcVZb+zq1XVz9sx3bHr3ZiYidxnIkDIZBkwSQQCIlmmCEwCAmkFdrdH/BjJdjfaFestBLSSmj4sT+Y3dXsrjQz2mgYBCKgmQDZyImzyGuCH0lMguMMcdyO3R33w13dXY979kdVOx0nTmwec6VSucvVdc93vu/cc86tJmZ+Cn/mwYD0TwABwj99u6H+8LYC8A0GAHgAyidPbgpNTj6Ajo5h7Np1nnRdBiBWDeSHAFAxGlJK9jwvRkQtRBQjIteyrLT88sunwrncYzwz82NMTByXu3Ydpe7uJBFhtSDoe5IQA2AGmJmJy2XNLpUiwjT/QlXVx4QQCQAGACmZc3J83FA//7wGMzMAEcMwpri9/UPq6zuBpqb8amT1XQEwA9IrlXROJpswN9cl8vlOx/NasG3bWqO5uZ2ItNtSlMkAn3wCXLwIIgITuYhExri7+z166KFhmKZLK5DVSgFwEHiVoIMEpJtOxzAxsV1cv/6wKJe3EPMaz/MUd9MmGFu3goS480Pn54EPPwSmp/0ZAECIAurrT/L9939A27f/KXjGsg9aCQD2CgWVjh/fQ0J42L//fx3XVeTZszvVubmfKI7TDWadADAzrEgERl8f1HD47l4BgEuXgFOngOvXgVIJxOxf17Rr3Nr6MT388Cdob59fTlZ3C2KWgHQ//XSXPj7+tyBybGaTNK1bt6x9gjnku8F/rud5kPE4lCXGMzOklBBCIAhUBGyCm5qApibANIFMxmfF80CO04RvvvlLvPfebu7qeg99ff9HsZi9FMRdAdjnzzepExM/JylNBkLa5OTL1Nqqk2/NTTe7zKCamptmmJ+fx/vvv4+xsTG0trbimWeeQUdHx40bDA |
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
I've been irritated with the hundreds of label tags in our sites with no 'for' attribute. This leads to forms where clicking the label does not put focus into that field. So I've written these operations to bulk fix this problem. | |
There are two steps, because if you've not used 'for' attributes, you probably don't have 'id' attributes on your form fields. So I've extracted the 'name' attribute from the form field and name-spaced it. Caution: if you have more than one form on the page you might end up with two elements with the same 'id' attribute, which would be improper. | |
So this: | |
<label>Forename</label> | |
<input name="forename"> | |
becomes: | |
<label for="auto-generated-id-forename">Forename</label> |
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
netstat -n -A inet | grep -v "127\.0\.0\.1" | egrep -v "\w\s*\w\s*\w\s*[0-9.]*:(80|8080)" | awk '/tcp/ {statuses[$6]++; hosts[$5]++} END{for (status in statuses) {print status,statuses[status]}; for (host in hosts) {if(hosts[host] > max_per_host_port) {max_per_host_port = hosts[host]}}; print "max_per_host",max_per_host_port}' |
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
function safeGetDataAttribute(element, dataName){ | |
if (element.dataset){ | |
return element.dataset[dataName]; | |
} | |
return element.getAttribute('data-' + dataName); | |
} |
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/gawk -f | |
/Cmnd_Alias/ { | |
value = substr($0, index($0, "=")+1,length($0)) | |
for (command in commands) gsub(command,commands[command],value) | |
sub(/^ */,"",value) | |
commands[$2]=value | |
print $0 | |
} |
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
<exec command="/bin/bash" args="-c 'commandwhichusesvars'" /> |
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
find ~/Library/Application\ Support/MobileSync/Backup/ -name ca3bc056d4da0bbf88b5fb3be254f3b7147e639c -exec sqlite3 {} "select zcontent from znotebody where zcontent like '%Music%';" \; | sed -e "s/<div>/\\ | |
/g" -e "s/<[^>]*>//g" "-e s/ / /g" |
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
<NotepadPlus> | |
<UserLang name="Excel" ext="" udlVersion="2.0"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments" id="0"></Keywords> | |
<Keywords name="Numbers, additional" id="1"></Keywords> | |
<Keywords name="Numbers, prefixes" id="2"></Keywords> |
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
ls /usr/local/graphite/storage/whisper/carbon/agents/*/metricsReceived.wsp | xargs -I {} whisper-dump.py {} | sed -e "s/,//" | awk '$1 ~ /^[0-9]/ && $3 > 0 {day=strftime("%Y-%m-%d", $2); if ($3 > sizes[day]) {sizes[day]=int($3)}} END {for(day in sizes) {print day " " sizes[day]}}' | sort |
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
Taken from http://hints.macworld.com/article.php?story=20080317085050719 | |
Put the below line in your .profile, .bash_profile or .bashrc file (whichever you use). | |
If you don't know which file to put it in, read this explanation: | |
http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environment#answer-415444 | |
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh |
OlderNewer