Skip to content

Instantly share code, notes, and snippets.

@fernandoaleman
fernandoaleman / rpm-digital-signature.sh
Created November 18, 2011 15:18
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@atomsfat
atomsfat / java_linux
Last active June 4, 2018 22:23
Java linux update-alternatives
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_25/bin/java" 2
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_25/bin/java
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_25/bin/javac" 2
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_25/bin/javac
/usr/lib/mozilla/plugins
sudo ln -s /opt/java/jdk1.7.0_25/jre/lib/i386/libnpjp2.so
sudo ln -s /opt/java/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so
@nyergler
nyergler / maildir2mbox.py
Created January 31, 2012 05:39
Convert maildirs (including subfolders) to mbox format
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Frédéric Grosshans, 19 January 2012
Nathan R. Yergler, 6 June 2010
This file does not contain sufficient creative expression to invoke
assertion of copyright. No warranty is expressed or implied; use at
your own risk.
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@ebouchut
ebouchut / LighttpdReverseProxyURLRewriting
Last active January 27, 2021 20:35
Lighttpd reverse-proxy to that matches an URL _and_ does URL rewriting #web #server #lighttpd
#server.modules += ( "mod_rewrite")
# Workaround to have a working reverse-proxy that matches an URL does URL rewriting in Ligghtpd.
#
# Ligtthpd 1.4.28 cannot perform both matching and URL rewriting at the same time.
# Therefore we need to define 2 proxies, one does the matching and bounce the request
# to the other one, in charge of rewriting the URL before proxying the request to the target server.
#
# More about this here:
# http://redmine.lighttpd.net/issues/164#note-9
@riipandi
riipandi / ispconfig3-debian6.sh
Created March 11, 2012 11:04
ISPConfig3 Installer (Debian Squeeze 32bit)
#!/bin/bash
#
# Debian GNU/Linux Installation Script for LAMP + ISPConfig3
# Script written by Aris S Ripandi ([email protected]) 15/01/2012
#
# Referensi:
# - http://www.howtoforge.com/how-to-run-your-own-name-server-with-ispconfig-3-and-fast-hosts
# - http://www.howtoforge.com/perfect-server-debian-squeeze-with-bind-and-courier-ispconfig-3
# - http://www.howtoforge.com/installing-mydns-ng-and-mydnsconfig-on-debian-squeeze
# - http://www.howtoforge.com/how-to-run-your-own-name-server-with-ispconfig-3-and-fast-hosts
@arantius
arantius / simple-rrd-merge.py
Created March 23, 2012 02:43
A very simple script to merge multiple RRD files, since none of those available seem to work.
#!/usr/bin/env python
"""Simple script to merge multiple RRD files together.
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump"
style file on stdout. The last RRD file should have a slot for every possible
record in the resulting merged RRD.
Run something like:
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 19, 2025 20:39
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@wki
wki / multi_pdf.pl
Created April 1, 2012 18:08
create single PDF from many .pod or .pm files
#!/usr/bin/env perl
use Modern::Perl;
BEGIN {
if (@ARGV != 2) {
print STDERR "usage: $0 DIR OUTPUT\n";
exit 1;
}
}