Skip to content

Instantly share code, notes, and snippets.

@yodeski
yodeski / README.md
Created April 27, 2012 23:43 — forked from firejune/README.md
Secure with HTTP Authentication for Cloud9 IDE

Add Secure with HTTP Authentication for Cloud9 IDE.

git clone https://github.com/ajaxorg/cloud9.git
git submodule update --init --recursive
git apply cloud9.patch
git clone git://github.com/semu/connect-basic-auth.git support/connect-basic-auth
node bin/cloud9.js -c config.js 

Open the url http://127.0.0.1:3000/ when prompt the authorization,username is "username" and password is "password".

# Mapnik2 on Ubuntu 11.10 installation
## Dependencies
~~~
sudo apt-get install -y g++ cpp \
python-dev libxml2 libxml2-dev \
libfreetype6 libfreetype6-dev \
libjpeg62 libjpeg62-dev \
libltdl7 libltdl-dev \
@yodeski
yodeski / hexcolor_to_mapserver.sql
Created November 14, 2012 04:15 — forked from nmandery/hexcolor_to_mapserver.sql
convert hex colors to mapserver format in postgresql
create or replace function public.hexcolor_to_mapserver(hexcolor text) returns text as
$body$
declare
thexcolor text;
color_r int;
color_g int;
color_b int;
begin
thexcolor := trim(both ' ' from hexcolor);
if not thexcolor ~ '^#[0-9a-fA-F]{6}$' then
@yodeski
yodeski / mapserver_nginx
Created November 15, 2012 00:00
Install Mapserver to run as FastCGI over Nginx
sudo apt-get install libgd2-xpm-dev
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install cgi-mapserver mapserver-bin
sudo apt-get install spawn-fcgi
@yodeski
yodeski / gist:5197036
Created March 19, 2013 15:25 — forked from ivanvanderbyl/gist:4222308
upgrade postgresql
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
@yodeski
yodeski / broker.js
Created June 16, 2016 19:40 — forked from jedi4ever/broker.js
xsub , xpub example in nodejs
var pubListener = 'tcp://127.0.0.1:5555';
var subListener = 'tcp://127.0.0.1:5556';
var hwm = 1000;
var verbose = 0;
// The xsub listener is where pubs connect to
var subSock = zmq.socket('xsub');
subSock.identity = 'subscriber' + process.pid;
subSock.bindSync(subListener);
@yodeski
yodeski / mapnik_render_static_map.py
Created January 17, 2018 20:13 — forked from andrewharvey/mapnik_render_static_map.py
Render a static map using Mapnik given centre, zoom and image width/height.
#!/usr/bin/env python
# This script is like generate_image.py from the OSM Mapnik code,
# but it renders based on a given centre point, zoom and final image pixel size
# Author: Andrew Harvey <andrew.harvey4@gmail.com>
# License: CC0 http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring