Skip to content

Instantly share code, notes, and snippets.

@Gundars
Gundars / cherrypickrelease.sh
Last active September 8, 2015 15:19
add new feature with PRs + cherry pick into patch to old release
git checkout master
git pull origin master
git checkout -b <feature branch>
# make changes
git add <file>
# this will create commit with hash <ABC>
git commit -m"Message"
git push origin <feature branch>
# make PRs to test and master, then:
git fetch --all --prune
@Gundars
Gundars / ApacheBlockNastyBots
Last active December 19, 2015 12:59
Add to .htaccess file to block annoying crawlers and bots ignoring robots.txt files
# BEGIN ApacheBlockNastyBots
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^(Aqua_Products|asterias|b2w/0\.1|BackDoorBot/1\.0|Black\ Hole|BlowFish/1\.0|Bookmark\ search\ tool|BotALot|BuiltBotTough|Bullseye/1\.0|BunnySlippers|Cegbfeieh|CheeseBot|CherryPicker|CherryPicker\ /1\.0|CherryPickerElite/1\.0|CherryPickerSE/1\.0|CopyRightCheck|cosmos|Crescent|Crescent\ Internet\ ToolPak\ HTTP\ OLE\ Control\ v\.1\.0|DittoSpyder|EmailCollector|EmailSiphon|EmailWolf|EroCrawler|ExtractorPro|FairAd\ Client|Flaming\ AttackBot|Foobot|Gaisbot|GetRight/4\.2|grub|grub-client|Harvest/1\.5|hloader|httplib|humanlinks|ia_archiver|ia_archiver/1\.6|InfoNaviRobot|Iron33/1\.0\.2|JennyBot|Kenjin\ Spider|Keyword\ Density/0\.9|larbin|LexiBot|libWeb/clsHTTP|LinkextractorPro|LinkScan/8\.1a\ Unix|LinkWalker|LNSpiderguy|lwp-trivial|lwp-trivial/1\.34|Mata\ Hari|Microsoft\ URL\ Control|Microsoft\ URL\ Control\ -\ 5\.01\.4511|Microsoft\ URL\ Control\ -\ 6\.00\.8169|MIIxpc|MIIxpc/4\.2|Mister\ PiX|moget|moge
@Gundars
Gundars / latency.txt
Created June 5, 2012 14:38 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD 150,000 ns 0.15 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
@Gundars
Gundars / sudo apt-get update
Created February 1, 2012 09:53
sudo apt-get update
Ign cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty InRelease
Ign cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty Release.gpg
Ign cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty Release
Ign cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty/main TranslationIndex
Ign cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty/restricted TranslationIndex
Err cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty/main amd64 Packages
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Err cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty/restricted amd64 Packages
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Ign cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1) natty/main Trans
@Gundars
Gundars / sources.list
Created February 1, 2012 09:43
source listings
deb cdrom:[Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1)]/ natty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu oneiric main restricted
deb-src http://archive.ubuntu.com/ubuntu oneiric main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu oneiric-updates main restricted