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 . | 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 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
<?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 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
-- This will insert X years worth of data into a Date table. All fields are INT apart from DayName and DateTime (NVARCHAR(10) and DATE respectively) | |
-- Update 19/12 now uses ISO Week Number | |
-- Define start (base) and end dates | |
DECLARE @basedate DATETIME = '20111101', @enddate DATETIME = '20150101'; | |
DECLARE @days INT = 0, @date DATETIME = '20110101', @maxdays INT = DATEDIFF(dd, @basedate, @enddate); | |
WHILE @days <= @maxdays | |
BEGIN | |
SET @date = DATEADD(dd, @days, @basedate); |
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
## sed ish | |
$a -replace "([A-z])(23)","$1,$2" | |
##seq 1 10 | |
1..10 | |
##loop | |
for ($i=0;$i -lt 10; $i++) { echo $i } | |
##copy files recursive |