Skip to content

Instantly share code, notes, and snippets.

View newbamboo's full-sized avatar

New Bamboo newbamboo

View GitHub Profile
diff -Naur nginx_uploadprogress_module/ngx_http_uploadprogress_module.c nginx_uploadprogress_module_safari_fix/ngx_http_uploadprogress_module.c
--- nginx_uploadprogress_module/ngx_http_uploadprogress_module.c 2007-10-10 11:42:17.000000000 +0000
+++ nginx_uploadprogress_module_safari_fix/ngx_http_uploadprogress_module.c 2008-02-29 14:24:49.000000000 +0000
@@ -7,6 +7,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ctype.h>
#define TIMER_FREQUENCY 15 * 1000
---
FFMPEG
---
Compile ffmpeg with h264 support (debian doesn't include it)
http://www.jbkempf.com/blog/post/2007/10/04/Build-vlc-under-a-fresh-sid
./configure --enable-libx264 --enable-gpl --enable-libfaad
--enable-libfaac --enable-swscaler --enable-pp --enable-libmp3lame
--enable-libamr-nb --enable-libamr-wb --enable-liba52
--enable-libtheora --enable-libvorbis --enable-libxvid
(
cat <<'EOF'
nameserver 192.168.1.10
EOF
) > /etc/resolv.conf
echo "Setting up newbamboo user and home dir...."
echo "newbamboo:password:1000:1000:New Bamboo,,,:/home/newbamboo:/bin/bash" > /etc/newusers
newusers /etc/newusers
@newbamboo
newbamboo / s3_db_backup.rake
Created January 19, 2009 17:29
S3 database backup adapted for Merb
# S3 Backup Task for MySQL
# Assumes InnoDB tables
# Database User needs the "reload" permission on the database (for --flush-logs in mysqldump)
#
# Stores files in Amazon S3 using the excellent AWS Gem: http://amazon.rubyforge.org/
# For information about Amazon S3: http://aws.amazon.com/s3
#
# Installation
# 1) Install AWS Gem
# 2) Enter your S3 Bucket, access_key_id and secret_access_key in this file
# Copyright 2009 Michael Ivey, released to public domain
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master
# I wanted it to run from MySQL and command line, instead of a Sinatra app
require 'rubygems'
require 'rest_client'
require 'json'
require 'sequel'
disqus_url = 'http://disqus.com/api'
articles = Article.find(:all)
articles.each do |article|
published_at = "#{published_at.year}-#{published_at.month}-#{published_at.day}"
author = article.user.login
permalink = article.permalink
title = article.title
excerpt = article.excerpt
body = article.body
fp = File.open("_posts/#{'draft-' if article.published_at.nil?}#{published_at}-#{permalink}.markdown", 'w')
@newbamboo
newbamboo / check_google_site_links.rb
Created February 16, 2009 22:29
Check if the links Google has indexed on your actually work
set :user, "deploy"
set :deploy_to, "/usr/local/www/nb_blog_jekyll"
set :jekyll_command, "/usr/local/jekyll/bin/jekyll --lsi"
role :web, "blog.new-bamboo.co.uk"
task :deploy do
run "cd #{deploy_to}; git pull; #{jekyll_command}; exit 0"
end
server {
listen 80;
server_name blog.new-bamboo.co.uk;
client_max_body_size 10M;
root /usr/local/www/nb_blog_jekyll/_site;
rewrite ^/archives/.* /archive permanent;
@newbamboo
newbamboo / index.html
Created February 19, 2009 22:43
Index page template for our Jekyll blog
---
layout: default
title: Ruby on Rails development
---
{% for post in site.latest_posts %}
<div class="entry">
<div class="entrytitle">
<h2><a href="{{ post.url }}">{{ post.title }}</a> <span class="author">{{ post.author }}</span></h2>
<h3>{{ post.date | date_to_string }} | <a href="{{ post.url }}#disqus_thread" class="commentslink">View comments</a></h3>