Skip to content

Instantly share code, notes, and snippets.

@karteek
karteek / Dockerfile
Last active October 29, 2016 09:29
Gecho
FROM busybox
ADD gecho /
ENTRYPOINT ["/gecho"]
@karteek
karteek / doodle.rb
Created April 19, 2011 12:02
Just a Gist for replacing an image using Squid
#!/usr/local/bin/ruby
def is_logo(url)
url =~ /logo1w.png$/
end
while true
input_url = ARGF.readline.strip().split(' ').first
new_url = input_url
if is_logo(input_url)
new_url = "http://path.to.localserver/images/ashok.png"
@karteek
karteek / doodle.py
Created April 19, 2011 11:18
Gist for replacing an image using Squid
#!/usr/bin/env python
import sys
def is_logo(url):
# This logo1w.png can change each day
if url.endswith('logo1w.png'):
return True
else:
return False
@karteek
karteek / Enabled-Imports.patch
Created January 10, 2010 22:39
Enable Imports on my fork of Etherpad
From c0ab5598975c4e9d092ea5793d99c8b7e229e384 Mon Sep 17 00:00:00 2001
From: Karteek E <nospam@karteek.net>
Date: Mon, 11 Jan 2010 03:26:55 +0530
Subject: [PATCH] Enabled Imports
---
infrastructure/net.appjet.oui/execution.scala | 6 +++---
infrastructure/net.appjet.oui/main.scala | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
@karteek
karteek / etherpad_apache_reverse_proxy
Created January 10, 2010 22:06
vhost entry for Etherpad installation behind a reverse proxy
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
ServerAdmin admin@example.com
ErrorLog /var/log/apache2/etherpad.error.log
LogLevel warn
CustomLog /var/log/apache2/etherpad.access.log combined
ServerSignature Off
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
@karteek
karteek / importexport.scala
Created December 28, 2009 21:42
Etherpad Oo.org converter
/**
* Copyright 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@karteek
karteek / custom_404_for_tumblr.js.htm
Created December 19, 2009 18:49
A way to enable custom 404 for Tumblr. Well, it 'kinda' works
<script type="text/javascript">
/* Works for me */
var text_posts = document.getElementsByClassName("regular");
var text_404 = "The URL you requested could not be found.";
var title_404 = "Not Found";
if(text_posts.length == 1){
var bodyNode = text_posts[0].lastChild;
if(bodyNode.previousSibling.textContent == text_404) {
// titleNode.innerHTML = "<a href='/'>Not Found</a>";
var blog_loc = "http://" + document.domain + "/";