Skip to content

Instantly share code, notes, and snippets.

View fuzzmz's full-sized avatar

Serban Constantin fuzzmz

View GitHub Profile
@fuzzmz
fuzzmz / middle_find
Created March 21, 2013 16:11
grep regex to match string with known beginning and end but whatever characters in between
$ grep ^start.*end$
@fuzzmz
fuzzmz / 2array.ps1
Created December 9, 2012 19:58
powershell display 2 dimensional array
$a=,@(1,2,3)
$a+=,@(4,5,6)
foreach ($b in $a) {"$b"}
@fuzzmz
fuzzmz / replace.ps1
Created December 9, 2012 19:53
PowerShell replace in filename
get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace(" ", "_") }
@fuzzmz
fuzzmz / redirect.html
Created December 4, 2012 11:06
HTML redirect
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com">
</head>
<body>
Optional page text here.
</body>
</html>
@fuzzmz
fuzzmz / update.sh
Created November 23, 2012 09:14
Pelican auto-make and push script
#!/bin/sh
pelican -s /path/to/pelicanconf.py /path/to/content -o /path/to/$username.github.com -t /path/to/yourtheme
cd /path/to/$username.github.com
git add .
git commit -am "update blog"
git push origin master
@fuzzmz
fuzzmz / gist:4111521
Created November 19, 2012 16:11
git revert to specific commit
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code
git reset --soft HEAD@{1} #moves pointer back to previous HEAD
git commit -m "Revert to 56e05fced"
git reset --hard #updates working copy to reflect the new commit
@fuzzmz
fuzzmz / tor-uk
Created November 19, 2012 12:47
Tor Strict UK Exit nodes
ExitNodes 0000000000Marauder,anonion,colinwillsdorkyahoo,gigatux,gerkin,devasdfasdf,Persepolis,ephemer2,000000000000haven,Alice
StrictNodes 1
CircuitBuildTimeout 5
NumEntryGuards 6
KeepalivePeriod 60
NewCircuitPeriod 15
@fuzzmz
fuzzmz / disable_vs2012_caps.ps1
Created August 17, 2012 14:05
Disable Visual Studio 2012 all-caps menus
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\11.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1
@fuzzmz
fuzzmz / extract.bat
Created June 7, 2012 21:52
Recursively extract archives in nested folders with 7-zip
FOR /D /r %%F in ("*") DO (
pushd %CD%
cd %%F
FOR %%X in (*.rar *.zip) DO (
"C:\Program Files\7-zip\7z.exe" x %%X
)
popd
)
@fuzzmz
fuzzmz / pineapple.md
Created April 21, 2012 12:21
Pineapple and Hare State Exam Question

This is a question that recently got published as a NY State Exam for the eight-grade. You can find the full article here but I'm publishing the story itself, plus the questions here for easier reading (that article is a bit of a mess).


In the olden times, animals could speak English, just like you and me. There was a lovely enchanted forest that flourished with a bunch of these magical animals.

One day, a hare was relaxing by a tree. All of a sudden, he noticed a pineapple sitting near him.

The hare, being magical and all, told the pineapple, "Um, hi."