This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION CODIGO_BARRAS_GENERAR_DV(P_CODIGO IN VARCHAR2, P_TIPO VARCHAR2 DEFAULT 'EAN13') RETURN VARCHAR2 IS | |
L_SUM NUMBER; | |
L_MULTIPLE NUMBER; | |
V_CODIGO_EAN13 VARCHAR2(13) DEFAULT NULL; | |
BEGIN | |
IF (P_TIPO = 'EAN13') THEN | |
V_CODIGO_EAN13 := SUBSTR(LPAD(P_CODIGO,12,'0'),1,12); | |
FOR I IN 1..12 LOOP | |
IF (MOD(I,2) = 0) THEN | |
L_MULTIPLE := 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# -- Declaracion de variables. | |
FTP_SERVER=ip_servidor | |
FTP_USER=nombre_usuario | |
FTP_PASS=contraseña_usuario | |
FTP_LOCAL_CD=/tmp | |
BACKUP_NAME=backup_opt.tar.gz | |
# -- Realizando backup de /opt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -- Respaldo de archivos wtmp y wtmpx | |
# Las copias de seguridad se depositan | |
# en el directorio /var/log. | |
DIA=`date +"%Y%m%d"` | |
HORA=`date +"%H%M"` | |
ARCHIVO_WTMP=wtmp_$DIA-$HORA | |
ARCHIVO_WTMPX=wtmpx_$DIA-$HORA | |
# -- Copia y compacta los archivos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author: Gabriel K | |
# | |
# /etc/init.d/iperfd | |
# | |
### BEGIN INIT INFO | |
# Provides: iperf | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 3 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# SCRIPT PARA REVOCAR LLAVES DE CLIENTES. | |
# | |
# -- Se verifica que se haya pasado el common name | |
# del cliente como argumento. | |
if [ -z "$1" ]; then | |
echo "Debe Especificar el nombre del cliente!" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# -- Definicion de variables globales | |
PWD_ACTUAL=`pwd` | |
source $PWD_ACTUAL/vars > /dev/null | |
CLIENT="" | |
CA_CRT=$KEY_DIR/ca.crt | |
TA_KEY=$KEY_DIR/ta.key | |
DEFAULT_SERVER_IP="ip_o_dominio_servidor" | |
DEFAULT_SERVER_PORT="1194" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Realiza una copia de seguridad completa de la herramienta Redmine. | |
DIA=`date +"%Y%m%d"` | |
HORA=`date +"%H%M"` | |
BACKUP_PATH=/backups | |
# -- REDMINE | |
REDMINE_HOME=/opt/redmine | |
REDMINE_DB_TYPE=pg #[pg|mysql] | |
REDMINE_DB_NAME=redmine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# SCRIPT DE PRUEBA - LEER CONTRASENIAS | |
# ==================================== | |
# | |
# -- Se libera la variable. | |
unset SECRET_PASSWD | |
# -- Se solicita la introduccion del password y | |
# se despliega un asterisco por cada character |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# SCRIPT DE PRUEBA - LEER CONTRASENIAS | |
# ==================================== | |
# | |
# -- Se guarda la configuracion de la sesion | |
# stty actual. | |
STTY_SAVE=`stty -g` | |
stty -echo | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -- CONFIGURACIÓN DE VARIABLES GLOBALES | |
APP_HOME="." | |
APP_OUTPUT="import.log" | |
MYSQL_DBUSER_ADM="root" | |
MYSQL_DBUSER="admin" | |
MYSQL_DBPASS="admin" | |
MYSQL_DBNAME="mi_db" |
NewerOlder