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 /usr/local/graphite/storage/whisper/ -name "*.wsp" | xargs -I {} whisper-info.py {} 2>&1 | grep "whisper.CorruptWhisperFile:" | sed -e "s/^.*(//" -e "s/).*$//" |
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
In response to http://askubuntu.com/questions/80244/how-do-i-sort-by-human-readable-sizes-numerically/552976?noredirect=1#answer-552976 | |
mark:~/dutest $ touch "a'b" | |
mark:~/dutest $ du -s * | sort -n | cut -f2 | |
a'b | |
mark:~/dutest $ du -s * | sort -n | cut -f2 | xargs du -sh | |
xargs: unterminated quote |
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
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 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 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def archive_to_bytes(archive): | |
def to_seconds(s): | |
SECONDS_IN_A = { | |
's': 1, | |
'm': 1 * 60, | |
'h': 1 * 60 * 60, |
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
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 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 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 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
import java.util.Map; | |
public abstract class ImmutableMap { | |
private ImmutableMap() {} | |
public static <K, V> Map<K, V> mapOf(K k1, V v1) { | |
return com.google.common.collect.ImmutableMap.of(k1, v1); | |
} | |
public static <K, V> Map<K, V> mapOf(K k1, V v1, K k2, V v2) { |
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
S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT | |
271360.0 268800.0 0.0 215492.3 5035520.0 1933309.9 11184640.0 2746005.2 524288.0 126285.0 11511 1654.373 181 185.540 1839.913 | |
271360.0 268800.0 0.0 215492.3 5035520.0 2185976.4 11184640.0 2746005.2 524288.0 126285.0 11511 1654.373 181 185.540 1839.913 | |
271360.0 268800.0 0.0 215492.3 5035520.0 2304618.9 11184640.0 2746005.2 524288.0 126285.0 11511 1654.373 181 185.540 1839.913 | |
271360.0 268800.0 0.0 215492.3 5035520.0 2366035.2 11184640.0 2746005.2 524288.0 126285.0 11511 1654.373 181 185.540 1839.913 | |
271360.0 268800.0 0.0 215492.3 5035520.0 2488908.0 11184640.0 2746005.2 524288.0 126285.0 11511 1654.373 181 185.540 1839.913 | |
271360.0 268800.0 0.0 215492.3 5035520.0 2644544.6 11184640.0 2746005.2 524288.0 126285.0 11511 1654.373 181 185.540 1839.913 | |
271360.0 268800.0 0.0 215492.3 5035520.0 2746552.0 11184640.0 2746005.2 524288.0 126285.0 115 |
OlderNewer