Skip to content

Instantly share code, notes, and snippets.

View xlab's full-sized avatar
:octocat:
Hacking

Max Kupriianov xlab

:octocat:
Hacking
View GitHub Profile
@xlab
xlab / parser.rb
Created September 17, 2012 10:47
Habrahabr comments analyzer
#!/usr/bin/env ruby
# encoding: utf-8
require 'nokogiri'
require 'open-uri'
require 'yaml'
###################################################
# ♥ http://habrahabr.ru/users/bupycnet/comments/
NICK = unless ARGV.empty? then "#{ARGV.pop}" else
@xlab
xlab / ren.c
Created October 22, 2012 01:51
Symbols replacer in da ELF
/* Rename symbols in an ELF object file, for use with ocamlopt -pack.
Written by John F. Carr <[email protected]>, September 24 2002.
Do whatever you want with this program.
This program takes two arguments: the name of a file to modify,
and the prefix to prepend to external symbols. A symbol already
beginning with the prefix, or the prefix without a trailng "__",
@xlab
xlab / parser.rb
Created October 25, 2012 16:40
Habra comments parser
#!/usr/bin/env ruby
# encoding: utf-8
require 'nokogiri'
require 'open-uri'
require 'yaml'
###################################################
# ♥ http://habrahabr.ru/users/bupycnet/comments/
NICK = unless ARGV.empty? then "#{ARGV.pop}" else
@xlab
xlab / domain.conf
Created December 10, 2012 21:23
Nginx + Thin config
upstream thin {
server unix:/tmp/thin.0.sock;
server unix:/tmp/thin.1.sock;
}
server {
listen 80;
server_name domain.ru;
root /var/www/domain/public;
@xlab
xlab / pcf_gen.rb
Created April 6, 2013 18:39
Generate PRODUCT_COPY_FILES for the Android.mk files
#!/usr/bin/env ruby
# Generate PRODUCT_COPY_FILES for the Android.mk files
# Usage: ./pcf_gen.rb <local_folder> <device_folder>
# (c) 2013 ROSA Lab
# Author: [email protected]
def show_help
puts "Usage:"
puts "./pcf_gen.rb <local_folder> <device_folder>"
@xlab
xlab / gist:5331001
Created April 7, 2013 15:47
Allwinner A10 - initlogo.rle - ARGB8888 (simply RGB32)
ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 1024x768 -i initlogo.rle -vcodec png logo.png
ffmpeg -vcodec png -i logo.png -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 initlogo.rle
gisyangli
I build the qt 3.0.2- x11 free on ubuntu 12.04, and get some error: ....
peppe
are you aware that Qt 3.0.2 was released 11 years ago?
gisyangli
yes, I know
gisyangli
@xlab
xlab / nginx.sh
Created July 16, 2013 21:27
/etc/init.d/nginx from nginx-1.1.9
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
John Carmack on shadow volumes...
I recieved this in email from John on May 23rd, 2000.
- Mark Kilgard
I solved this in a way that is so elegant you just won't believe it. Here
is a description that I posted to a private mailing list:
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
// @KarlHillesland, @rexguo, @tom_forsyth, @bkaradzic, @MikeNicolella
// and myself.