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 / http-proxy.conf
Last active April 7, 2017 15:46
Configuration of HTTP Proxy in Docker with Linux
# /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
EnvironmentFile=-/opt/proxy/bin/.docker_env
@pascencio
pascencio / docker
Last active April 7, 2017 15:50
Docker options with configuration file
# /etc/sysconfig/docker
OPTIONS="--bip=20.18.9.1/24 --fixed-cidr=20.18.9.0/24"
@pascencio
pascencio / proxyoff.sh
Last active December 19, 2017 19:49
Proxy Management on Manjaro Linux
ID=$(id -u)
PROXYON="${http_proxy}"
if [ ${ID} != 0 ] ;
then
echo "Debes ejecutar este comando como root"
else
if [ "${PROXYON}X" != "X" ] ;
then
sed -i "s/\(.*\)\(PROXY\|proxy\)\(=\)/#\1\2\3/" /etc/environment
@pascencio
pascencio / unirest-selfsignedcert.js
Last active May 18, 2017 17:36
Make a Request to a site with self signed certificate using Unirest and Node.js
var unirest = require('unirest');
unirest
.get('https://some.selfsigned.cert.domain.com')
.strictSSL(false)
.end(function(response){
console.log(response.body);
});
@pascencio
pascencio / start.bat
Created July 18, 2017 22:18
Start selenium node with IExplorer WebDriver
@echo off
set WEBDRIVER_HOME="c:\put\your\webdriver\home"
set PATH=%WEBDRIVER_HOME%;%PATH%
set GRID_HOST="put your GRID HOST here"
set GRID_PORT=4444
java -jar selenium-server-standalone-3.4.0.jar -role node -hub http://%GRID_HOST%:%GRID_PORT%/grid/register
@echo on
@pascencio
pascencio / start.sh
Created July 27, 2017 18:26
Start Selenium Node In Linux
WEBDRIVER_HOME="/path/to/webdrivers"
JAVA_BIN="/path/to/java_exe"
SELENIUM_SERVER_JAR="/path/to/selenium_server_jar"
GRID_HOST="Put your GRID HOST here"
GRID_PORT=4444
export PATH=$WEBDRIVER_HOME:$PATH
$JAVA_BIN -jar $SELENIUM_SERVER_JAR -role node -hub http://$GRID_HOST:$GRID_PORT/grid/register
@pascencio
pascencio / add_proxy.sh
Last active August 18, 2017 22:16
Configuración del proxy al iniciar terminal
# Para usar esta shell realice los siguientes pasos:
# 1.- wget https://gist.githubusercontent.com/pascencio/06ccb1d74ca555b371d04cad810bd484/raw/41cc6f84434576f6b45b88daa30dbddc11a65254/add_proxy.sh
# 2.- chmod +x add_proxy.sh
# 3.- ./add_proxy.sh
read -p "Ingrese el host del proxy: " host
reap -p "Ingrese el puerto del proxy: " port
echo export HTTP_PROXY=http://${host}:${port} >> ~/.bashrc
export HTTPS_PROXY=http://${host}:${port} >> ~/.bashrc
@pascencio
pascencio / nodeconfig.json
Created August 31, 2017 20:45
Configuración de un nodo de Selenium con archivo json
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"host": "<ip-del-nodo>",
"port": <puerto-del-nodo>,
"register": true,
"hub": "http://<ip-del-hub>:<puerto-del-hub>"
}
@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'
@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