- ValidaExprRegFactura.xsl
- ValidaExprRegGuiaRemitente.xsl
- ValidaExprRegNC.xsl
- ValidaExprRegND.xsl
- ValidaExprRegPercepcion.xsl
- ValidaExprRegRetencion.xsl
- ValidaExprRegSummary.xsl
- ValidaExprRegVoided.xsl
This file contains hidden or 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
#!/usr/bin/python | |
# Originally taken from https://medium.com/@djperalta/python-suds-sunat-example-afc6c37ad426#.mlm9q2lqb | |
from suds.client import Client | |
from suds.wsse import * | |
import requests | |
import base64 | |
import logging | |
logging.basicConfig(level=logging.INFO) |
This file contains hidden or 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 | |
# for-grep-sed script used to match a string and replace it in set of files | |
FGS_FIELD=$1; | |
FGS_FIELD_REPLACEMENT=$2; | |
for mf in `grep -rn ${FGS_FIELD} --include=\*.{xml,py} | tr ":" " " | awk '{print $1}' | uniq`; do | |
sed_replace="sed -i 's/${FGS_FIELD}/${FGS_FIELD_REPLACEMENT}/g' ${mf}"; | |
eval $sed_replace; | |
done |
This file contains hidden or 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
#!/usr/bin/python | |
from OpenSSL import crypto, SSL | |
from socket import gethostname | |
from pprint import pprint | |
from time import gmtime, mktime | |
from os.path import exists, join | |
CERT_FILE = "myapp.crt" | |
KEY_FILE = "myapp.key" |
This file contains hidden or 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 | |
# Tested in archlinux | |
function restore_2_container() { | |
# Container name | |
container_name=$1 | |
# Random database name | |
database_name="`shuf -n1 /usr/share/dict/cracklib-small`_`shuf -n1 /usr/share/dict/cracklib-small`" |
This file contains hidden or 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
// taken from a cached page of github.com | |
.date-selector .date-button { | |
position: absolute; | |
top: 0; | |
width: 18px; | |
height: 18px; | |
padding: 4px; | |
font-size: 12px; | |
line-height: 12px; | |
color: #4078c0; |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
int menor_a_mayor( const void * e1, const void * e2 ){ | |
return ( *(int*)e1 - *(int*)e2 ); | |
} | |
int mayor_a_menor( const void * e1, const void * e2 ){ | |
return ( *(int*)e2 - *(int*)e1 ); | |
} |
This file contains hidden or 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 | |
# This gist is mainly for export and import your gpg keys in order to backup them individualy, | |
# use somewhere else or whatever you want to do. | |
# usage: | |
# (1) $ export_gpg [email protected] fname | |
# NOTE: it will create two files: fname-gpg.txt, fname-gpg.key | |
# | |
# (2) $ import_gpg fname | |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
This file contains hidden or 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
# coding: utf-8 | |
from lxml import etree | |
from signxml import xmldsig | |
cert = open('cert.pem').read() | |
key = open('key.pem').read() | |
doc = etree.parse('sample.xml').getroot() |