Skip to content

Instantly share code, notes, and snippets.

View pascencio's full-sized avatar
💭
Work in progress

Patricio Ascencio Aravena pascencio

💭
Work in progress
  • Santiago, Santiago Metropolitan, Chile
View GitHub Profile
@pascencio
pascencio / appium.log
Last active March 7, 2018 20:52
Appium 1.7.2
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/patricio/Aplicaciones/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","c3ea38b11f005cf2","shell","getprop","ro.product.manufacturer"]
[debug] [ADB] Current device property 'ro.product.manufacturer': samsung
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [AndroidDriver] No app capability. Assuming it is already on the device
[debug] [ADB] Getting install status for cl.some.package
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/patricio/Aplicaciones/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","c3ea38b11f005cf2","shell","pm","list","packages","cl.some.package"]
@pascencio
pascencio / myql02.ini
Created November 27, 2017 21:55
MySQL 02 Replication on WIndows: Master - Master
[mysqld]
server-id=2
innodb_flush_log_at_trx_commit=1
log-bin="C:/ProgramData/MySQL/MySQL Server 5.6/karibu-mysql02-bin.log"
sync-binlog=1
binlog-format=row
relay-log="C:/ProgramData/MySQL/MySQL Server 5.6/karibu-mysql02-relay.log"
replicate-do-table=karibu.parameterr
@pascencio
pascencio / mysql01.ini
Created November 27, 2017 21:33
MySQL 01 Replication on WIndows: Master - Master
[mysqld]
server-id=1
innodb_flush_log_at_trx_commit=1
log-bin="C:/ProgramData/MySQL/MySQL Server 5.6/karibu-mysql01-bin.log"
sync_binlog=1
binlog-format=row
relay-log="C:/ProgramData/MySQL/MySQL Server 5.6/karibu-mysql01-relay.log"
replicate-do-table=karibu.user
@pascencio
pascencio / step01.sql
Created November 27, 2017 17:00
MySQL 01 Replication on WIndows: Master - Slave
CREATE USER 'srv-repl'@'%' IDENTIFIED BY 'slavepass';
GRANT REPLICATION SLAVE ON *.* TO 'srv-repl'@'%';
@pascencio
pascencio / step02.sql
Created November 27, 2017 16:58
MySQL 02 Replication on WIndows: Master - Slave
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST = '<ip-mysql01>', MASTER_USER = 'srv-repl', MASTER_PASSWORD = 'slavepass', MASTER_LOG_FILE = '<master-log-file>', MASTER_LOG_POS = <master-log-pos>;
START SLAVE;
@pascencio
pascencio / myql02.ini
Created November 27, 2017 16:51
MySQL 02 Replication on WIndows: Master - Slave
[mysqld]
server-id=2
innodb_flush_log_at_trx_commit=1
sync-binlog=1
binlog-format=row
relay-log="C:/ProgramData/MySQL/MySQL Server 5.6/karibu-mysql02-relay.log"
replicate-do-table=karibu.parameter
@pascencio
pascencio / mysql01.ini
Last active November 27, 2017 16:51
MySQL 01 Replication on WIndows: Master - Slave
[mysqld]
server-id=1
innodb_flush_log_at_trx_commit=1
log-bin="C:/ProgramData/MySQL/MySQL Server 5.6/karibu-mysql01-bin.log"
sync_binlog=1
binlog-format=row
@pascencio
pascencio / docker-proxy-env.sh
Last active May 17, 2018 20:45
Docker Proxy Environment for Systemd
#!/bin/sh
cmd=${1}
docker_proxy_file="/etc/systemd/system/docker.service.d/http-proxy.conf"
# Installations instructions:
# sudo curl https://gist.githubusercontent.com/pascencio/c0b391832a733a9b0fedd1343cadeaab/raw/c38e2f43956668f82c0345aaaa927dfcea3c759e/docker-proxy-env.sh -o /usr/bin/docker-proxy-env && sudo chmod +x /usr/bin/docker-proxy-env
reload_docker(){
systemctl daemon-reload
systemctl restart docker
@pascencio
pascencio / filtrar_fin_logs.sh
Created October 30, 2017 15:30
Extraer logs de Weblogic 11g
#!/bin/bash
LIST_ARCHIVOS="$(egrep -l '\<Jan\ 30\,\ 2017\ 4\:.*PM.*\>' *)"
CANT_ARCHIVOS="$(egrep -l '\<Jan\ 30\,\ 2017\ 4\:.*PM.*\>' * | wc -l)"
declare -a ARRAY_ARCHIVOS
declare -a ARRAY_LINEA_INICIAL
declare -a ARRAY_LINEA_FINAL
for (( i=1; i<=$CANT_ARCHIVOS; i++ ))
do
@pascencio
pascencio / spHelloWorld_Declare.sql
Last active September 27, 2017 06:29
Transac-SQL output parameter example (http://sqlfiddle.com/#!6/c0e58/3/0)
-- Validamos que el procedimiento existe
IF OBJECT_ID ( 'spHelloWorld', 'P' ) IS NOT NULL
-- Si existe lo eliminamos para evitar el error al crear
DROP PROCEDURE [dbo].[spHelloWorld];
GO
CREATE PROCEDURE [dbo].[spHelloWorld](
@name VARCHAR(100)
,@code INT OUTPUT -- Debe ser referenciado como '@code'
,@message VARCHAR(100) OUTPUT -- Debe ser referenciado como '@message'