Skip to content

Instantly share code, notes, and snippets.

View roramirez's full-sized avatar

Rodrigo Ramírez Norambuena roramirez

View GitHub Profile
@roramirez
roramirez / freeze_vm_xen.sh
Created June 27, 2013 17:34
freeze virtual machine Xen on Debian Lenny
#Freeze virtual machine on Debian Lenny
PATH_VM=/home/vm/domains/XenSqueeze
SED=/bin/sed
#Go to domain and mount partition
cd $PATH_VM
mkdir tmp
mount disk.img tmp -o loop
#Change respawn
@roramirez
roramirez / pg_backup.sh
Last active December 25, 2015 19:19 — forked from spiderr/pg_backup.sh
#!/bin/sh
#
# Postgresql backup script
# http://www.bitweaver.org/wiki/pg_backup+PostgreSQL+backup+script
#
# Author
# |
# +-- speedboy (speedboy_420 at hotmail dot com)
# +-- spiderr (spiderr at bitweaver dot org)
# +-- flexiondotorg (code at flexion dot org)
@roramirez
roramirez / creoletype_longchar.patch
Created October 27, 2014 16:16
Longvarchar PHP 5.3 Symfony
--- CreoleTypes.php 2014-01-27 10:28:12.000000000 -0300
+++ symfony/lib/vendor/creole/CreoleTypes.php 2014-01-27 17:55:45.000000000 -0300
@@ -46,7 +46,7 @@
const NUMERIC = 14;
const BLOB = 15;
const CLOB = 16;
- const LONGVARCHAR = 17;
+ const LONGVARCHAR = 30; //php 5.3.0 fix, using an unused int
const DECIMAL = 18;
const REAL = 19;
#!/bin/sh
VERSION=2.7.10
cd /tmp/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
tar -xzf Python-$VERSION.tgz
cd Python-$VERSION
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev
@roramirez
roramirez / autosuport-ast-wo-files.sh
Last active August 29, 2015 14:24
AutoSupport Without files backups
#!/bin/sh
#
# Autosupport Version 2.0.18
# Collect support information
#
# Copyright (C) 2005-2011, Digium, Inc.
#
# Written by John Bigelow (support@digium.com)
# Charles Moye (cmoye@digium.com)
# Trey Blancher (trey@digium.com)
@roramirez
roramirez / file.patch
Created October 24, 2015 20:45
Debug search filehelper file.c
diff --git a/main/file.c b/main/file.c
index bfad6e0..972e180 100644
--- a/main/file.c
+++ b/main/file.c
@@ -525,6 +525,8 @@ static int filehelper(const char *filename, const void *arg2, const char *fmt, c
struct stat st;
char *fn = build_filename(filename, ext);
+ ast_log(LOG_DEBUG, "Search file %s \n", fn);
+
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 862988b..0a2726b 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5400,9 +5400,13 @@ static int update_queue(struct call_queue *q, struct member *member, int callcom
if (callcompletedinsl) {
q->callscompletedinsl++;
}
- /* Calculate talktime using the same exponential average as holdtime code*/
- oldtalktime = q->talktime;
#!/bin/sh
### BEGIN INIT INFO
# Provides: init_firewall
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall for init.d
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d. This example start a
<?php
include "wp-config.php";
backup_tables(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
/* backup the db OR just a table */
function backup_tables($host,$user,$pass,$name,$tables = '*') {
$filename = "backup-" . date("d-m-Y") . ".sql";
#!/bin/bash
# uwsgi - Use uwsgi to run python and wsgi web apps.
#
# chkconfig: - 85 15
# description: Use uwsgi to run python and wsgi web apps.
# processname: uwsgi
# idea: https://www.linode.com/docs/websites/nginx/wsgi-using-uwsgi-and-nginx-on-centos-5