Contents
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
As people mentioned this site is an exception to how to do things, in that PG actively does not care about search engine results. However, for the people who are interested, here's a few ways you can handle a situation like this. | |
1. If you add the "max-stale" header to your content you can tell your CDN to hold on to things longer in the event of an outage. What happens is that the CDN will look at the cache time you set and check in as normal when that expires, but if it gets back no response or a 503 code (server maintenance status code- if you work with CDNs this is your friend!) it will continue serving the stale content for as long as you tell it. | |
2. Lets say you're beyond that, or your site is too dynamic. Instead of setting up an error page that responds to everything, setup a redirect with the 302 status code (so crawlers and browsers know it's a temporary thing). Point that redirect at an error page and you're golden. The best part is these types of requests use minimal resources. | |
What I do is kee |
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 is the output of running ec2.py | |
{ | |
"ec2": [ | |
"54.201.98.213" | |
], | |
"i-8bcae5bf": [ | |
"54.201.98.213" | |
], | |
"key_ansible-1": [ | |
"54.201.98.213" |
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
import sbt._ | |
import Keys._ | |
import sbtassembly.Plugin._ | |
//import AssemblyKeys._ // put this at the top of the file | |
import sbtassembly.Plugin.AssemblyKeys | |
import sbtassembly.Plugin.AssemblyKeys._ | |
import sbtassembly.Plugin.assemblySettings | |
import sbtassembly.Plugin.MergeStrategy |
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
name := "foo" | |
version := "1.0-SNAPSHOT" | |
scalaVersion := "2.10.3" | |
scalacOptions in ThisBuild ++= Seq( | |
"-language:_", | |
"-feature", | |
"-unchecked", |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
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
#run it using openvpn –script-security 2 –config azilink.ovpn | |
dev tun | |
remote 127.0.0.1 41927 tcp-client | |
ifconfig 192.168.56.2 192.168.56.1 | |
route 0.0.0.0 128.0.0.0 | |
route 128.0.0.0 128.0.0.0 | |
socket-flags TCP_NODELAY | |
keepalive 10 30 | |
dhcp-option DOMAIN lan |
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
package multi | |
import java.util.concurrent.Callable | |
object Threads { | |
def main(args: Array[String]) : Unit = { | |
implicit def funcToCallable[A](func : () => A): Callable[A] = new Callable[A] { println("creating callable");def call() :A = func() } | |
implicit def funcToRunnable( func : () => Unit ) = new Runnable(){ println("creating runnable");def run() = func()} | |
//bad. cannot be tested properly. plus completely screws up the idea of runnable (viz to have the choice of not using threads with minimum code changes) |
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
# http://nodebox.metaforix.net/articles/debian-on-lenovo-thinkpad-t420 | |
#create new file /usr/share/X11/xorg.conf.d/99-my.conf | |
Section "InputDevice" | |
Identifier "Synaptics Touchpad" | |
Driver "synaptics" | |
Option "SendCoreEvents" "true" | |
Option "Device" "/dev/psaux" | |
Option "Protocol" "auto-dev" |
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
#pre-requisites | |
sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev git libpq-dev libmysqlclient-dev libpq-dev nodejs libcurl4-openssl-dev libffi-dev imagemagick libjpeg-progs pngcrush | |
############optional | |
sudo apt-get install sudo vim zsh | |
######### optional for jruby | |
sudo apt-get install openjdk-7-jdk | |