Skip to content

Instantly share code, notes, and snippets.

View felix-orduz's full-sized avatar

Felix Ernesto Orduz Grimaldo felix-orduz

View GitHub Profile
@felix-orduz
felix-orduz / download.sh
Last active September 18, 2020 15:03
Download files with zenity progress bar
#!/bin/bash
DOWNLOAD() {
rand="$RANDOM `date`"
pipe="/tmp/pipe.`echo '$rand' | md5sum | tr -d ' -'`"
mkfifo $pipe
wget -c $1 2>&1 | while read data;do
if [ "`echo $data | grep '^Length:'`" ]; then
total_size=`echo $data | grep "^Length:" | sed 's/.*\((.*)\).*/\1/' | tr -d '()'`
fi
if [ "`echo $data | grep '[0-9]*%' `" ];then
@felix-orduz
felix-orduz / download
Created December 25, 2014 21:52
wget con barra de progreso
DOWNLOAD() {
rand="$RANDOM `date`"
pipe="/tmp/pipe.`echo '$rand' | md5sum | tr -d ' -'`"
mkfifo $pipe
wget -c $1 2>&1 | while read data;do
if [ "`echo $data | grep '^Length:'`" ]; then
total_size=`echo $data | grep "^Length:" | sed 's/.*\((.*)\).*/\1/' | tr -d '()'`
fi
if [ "`echo $data | grep '[0-9]*%' `" ];then
percent=`echo $data | grep -o "[0-9]*%" | tr -d '%'`
#!/bin/bash
number_files=0;
size_per_file='';
level_log=3;
name_file='log';
###########
# Options #
###########
@felix-orduz
felix-orduz / split.sh
Created October 25, 2013 16:40
"split" de una cadena sin necesidad de cat ni otro programa salida: this “is” a command this “is” a pattern Fuente: http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk
#!/bin/bash
line=’this “is” a command.this “is” a pattern’
COMMAND=${line%.*}
PATTERN=${line#*.}
echo $COMMAND
echo $PATTERN
@felix-orduz
felix-orduz / 1.email_simple.sql
Last active February 12, 2016 22:10
Envio Email Con PL/SQL
CREATE OR REPLACE PROCEDURE CEM.send_mail(
sender IN VARCHAR2,
recipient IN VARCHAR2,
ccrecipient IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2
)IS
crlf VARCHAR2(2):= UTL_TCP.CRLF;
connection utl_smtp.connection;
mailhost VARCHAR2(30) := 'host';
@felix-orduz
felix-orduz / reduceImgs.sh
Last active September 23, 2015 21:28 — forked from fitorec/reduceImgs.sh
Se modifica el script con el fin de conservar al dirección original de la imagen para tal efecto se elimina el segundo valor del resize dejando solo 800x adicionalmente se cambia la calidad a 80
#!/usr/bin/env bash
#file: convImgs.sh
#author: fitorec http://fitorec.wordpress.com
#
#descripcion: Este script lo realize para reducir el tamaño de imgs la
#tecnica es redimencionar y bajar la calidad de 50% en el nivel de compresion
#la imagenes creadas quedaran en una carpeta que se llama mini
#
#Agumentos: recibe como unico argumento la extension de las images a convertir
#