Skip to content

Instantly share code, notes, and snippets.

@edgardo001
edgardo001 / QRAndLogo.java
Created August 8, 2016 19:44 — forked from wombat/QRAndLogo.java
QR-Code with embedded logo
// Create new configuration that specifies the error correction
Map<EncodeHintType, ErrorCorrectionLevel> hints = new HashMap<EncodeHintType, ErrorCorrectionLevel>();
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
// Create a qr code with the url as content and a size of 250x250 px
@edgardo001
edgardo001 / Operaciones-Git
Created September 7, 2016 03:45 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@edgardo001
edgardo001 / script-bash-export-mysql-postgresql
Created September 22, 2016 14:08 — forked from gabrielkfr/script-bash-export-mysql-postgresql
Script bash que permite exportar una base de datos MySQL o PostgreSQL.
#!/bin/bash
 
# -- DEFINICIÓN VARIABLES DE FECHA Y HORA.
DIA=`date +"%Y%m%d"`
HORA=`date +"%H%M"`
 
# -- CONFIGURACIÓN DE VARIABLES GLOBALES
DUMP_HOME="."
DUMP_FILE="dump_"$DIA"_"$HORA".sql"
 
@edgardo001
edgardo001 / script-bash-import-mysql-postgresql
Created September 22, 2016 14:08 — forked from gabrielkfr/script-bash-import-mysql-postgresql
Script bash que permite importar una base de datos en MySQL o PostgreSQL a partir de una archivo dump.
#!/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"
@edgardo001
edgardo001 / mongod.cfg
Last active September 21, 2017 12:53
Configuracion Basica para iniciar MongoDB 3.5.2 en Windows como servicio persistente del sistema
#MongoDB 3.2.5
#########NOTAS################
#Este archivo debe ir junto a mongod.exe (en lo posible)
#
#Para crear el servicio, se debe ejecutar lo siguiente como administrador:
#>C:\Program Files\MongoDB\Server\3.2\bin>sc.exe create MongoDB binPath= "C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe --service --config=\"C:\Program Files\MongoDB\Server\3.2\bin\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"
#
#Para este ejemplo, se deben crear manualmente las carpetas (de lo contrario el servicion no inicia, dando un error 1053):
#
@edgardo001
edgardo001 / nacionalidad.sql
Created September 29, 2016 20:08
Insert SQL de nacionalidades, gentilicios e ISO de cada pais
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Afganistán','AFGANA','AFG');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Albania','ALBANESA','ALB');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Alemania','ALEMANA','DEU');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Andorra','ANDORRANA','AND');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Angola','ANGOLEÑA','AGO');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('AntiguayBarbuda','ANTIGUANA','ATG');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('ArabiaSaudita','SAUDÍ','SAU');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Argelia','ARGELINA','DZA');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Argentina','ARGENTINA','ARG');
INSERT INTO`nacionalidad`(`PAIS_NAC`,`GENTILICIO_NAC`,`ISO_NAC`)VALUES('Armenia','ARMENIA','ARM');
@edgardo001
edgardo001 / Linux Static IP
Last active November 8, 2016 12:16 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@edgardo001
edgardo001 / NotepadPlusPlus_Lenguaje_Log.xml
Last active July 5, 2017 14:25
Visualizador de sintaxis Log4Net para notepad++, para cargar, ir a la barra de menu "Lenguaje/definir idioma/importar" y seleccionar el xml descargado, por ultimo reiniciar notepad++, el nuevo lenguaje debe aparecer debajo de "definir idioma"
<NotepadPlus>
<UserLang name="Log4Net" ext="log" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03/* 04*/ 00// 00 01 02</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@edgardo001
edgardo001 / closeAllConexionSqlServer.sql
Created November 15, 2016 18:11
Cerrar todas las conexiones a la base de datos SQL Server
USE master
GO
SET NOCOUNT ON
DECLARE @DBName varchar(50)
DECLARE @spidstr varchar(8000)
DECLARE @ConnKilled smallint
SET @ConnKilled=0
SET @spidstr = ''
Set @DBName = 'DATABASE_NAME_HERE'
IF db_id(@DBName) < 4
@edgardo001
edgardo001 / login.html
Created December 22, 2016 16:19
Template HTML, formulario Login alienado a la derecha con bordes redondeados
<!DOCTYPE html>
<html>
<head>
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.css">-->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
.panel{
border: 2px solid #DFE0E2;
width: 350px;
padding: 10px 10px 10px 10px;