Skip to content

Instantly share code, notes, and snippets.

View dnetix's full-sized avatar

Diego Calle dnetix

View GitHub Profile
@dnetix
dnetix / co_action.sh
Last active November 21, 2018 20:32
Prepares basic actions over installed projects
#! /bin/bash
# Prepares sites to be updated though the install.sh
ORIGIN_PATH=/var/www/vhosts/placetopay.com/sites/
HOME_PATH=/home/diegocalle/
BACKUP_PATH=/home/diegocalle/backup/co_
ACTION=$1
cd ${HOME_PATH}
@dnetix
dnetix / WSAuthentication256.java
Last active November 1, 2018 15:55
A quick script to create the authentication WSS on Java
import java.math.BigInteger;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Locale;
@dnetix
dnetix / Asobancaria2001Generator.php
Created February 27, 2018 19:11
Asobancaria 2001 testing generator
<?php
/**
* This will generate a 2001 Asobancaria file
*/
$name = 'testing.txt';
$nit = '8909002860';
$date = date('Ymd');
@dnetix
dnetix / NodeJSAuthentication.js
Created June 1, 2017 16:51
NodeJS authentication generator required for PlacetoPay's Redirection (Web Checkout)
var crypto = require('crypto');
/**
* Generates authentication data in order to communicate with PlacetoPay Web Checkout service
*
* USAGE:
*
* var authGenerator = new RedirectionAuth("YOUR_LOGIN", "YOUR_TRANKEY");
* var auth = authGenerator.asObject();
*
@dnetix
dnetix / CSharpAuthenticationTest.cs
Last active August 5, 2019 06:33
C# equivalent to the PHP authentication required for Redirection
using System;
using System.IO;
namespace AuthenticationRedirection
{
class Authentication
{
/**
* Example of use, in your code you can ignore this function
*/
#default_process_limit = 100
#default_client_limit = 1000
# Default VSZ (virtual memory size) limit for service processes. This is mainly
# intended to catch and kill processes that leak memory before they eat up
# everything.
#default_vsz_limit = 256M
# Login user is internally used by login processes. This is the most untrusted
# user in Dovecot system. It shouldn't have access to anything at all.
@dnetix
dnetix / JavaRestClientTest.java
Last active September 16, 2022 09:30
Simple Java Rest Client posting JSON to a server
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
@dnetix
dnetix / WSAuthentication.java
Last active May 31, 2022 02:05
Java equivalent to the PHP authentication required for Redirection
import java.math.BigInteger;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Locale;
@dnetix
dnetix / redirection_quick_soap_example.php
Created September 6, 2016 16:27
Quick spaghetti code for a SOAP connection example
<?php
/**
* This is a really quick SOAP connection example, by no means it should be the
* definitive way to connect with PHP
*/
header('Content-Type: text/plain');
$client = new SoapClient('http://redirection.dnetix.co/soap/redirect?wsdl');
$login = '';
<?php
/**
* Class ReCaptcha
*
* USAGE:
*
* CLIENT SIDE:
* Create the tags like its explained on the google site when you obtain the keys or before the </head> tag
* <?= ReCaptcha::getHeadTag() ?> and where you want to put the verification <?= ReCaptcha::getFormTag() ?>