Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View marcolino's full-sized avatar

Marcolino marcolino

View GitHub Profile
@marcolino
marcolino / post-install.sh
Created November 7, 2013 14:09
Post Install for Centos (tested on 6.3)
#!/bin/bash
#
# Post-install script for a Linux Centos Server
#
# N.B.: tested on Centos 6.3
###################################################################################################
_()(set -o pipefail;"$@" 2>&1>&3|sed $'s,.*,\e[31m&\e[m,'>&2)3>&1 # point out errors prefix
err()(echo -e "\e[31m$1\e[m" 1>&2) # point out errors function
IP="`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'`"; # current first network interface IP address
@marcolino
marcolino / comics.pl
Last active December 27, 2015 13:59
Downloads a comics strip image (from "http://www.gocomics.com")
#!/usr/bin/perl
#
# Download a comics strip
use strict;
use warnings;
use CGI qw(:all);
use LWP::UserAgent;
use File::Type;
@marcolino
marcolino / fulldump.sh
Last active March 4, 2019 00:44
Postgres full dump script
#!/bin/bash
# $Id: fulldump.sh,v 1.4 2013/10/31 14:25:36 postgres Exp postgres $
# $Source: /var/lib/postgresql/8.2/RCS/fulldump.sh,v $
# $Log: fulldump.sh,v $
#
# Revision 1.4 2013/10/31 14:25:36 postgres
# Removed pg_dump '-D' option, added $RETVAL
# default value for the initial case - MS.
#
# Revision 1.3 2007/09/28 13:29:07 postgres
@marcolino
marcolino / checkSystemExitCode.pl
Last active December 26, 2015 03:09
check perl system exit code
system(...);
if ($? == -1) {
print "failed to execute: $!\n";
}
elsif ($? & 127) {
printf "child died with signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
}
else {
printf "child exited with value %d\n", $? >> 8;
@marcolino
marcolino / index.php
Last active December 24, 2015 16:48
Contribution to i18next project to auto-translate missing entries
<?php
#
# i18next
#
# This script can be used to auto-translate missing keys when using
# "sendMissing: true" option in i18next.
# It should be placed - renamed as "index.php" - inside each of locales
# subdirs (say: 'locales/it/index.php', 'locales/es/index.php', ...).
# A sample of i18n config options could be: