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
pg_dump -U postgres "$1" > "$1"_dump.sql | |
cat "$1"_dump.sql | recode iso-8859-1..u8 > "$1"_dump_utf8.sql | |
perl -pi -w -e 's/SQL_ASCII/UTF8/g;' "$1"_dump_utf8.sql | |
dropdb -U postgres "$1" | |
createdb -U postgres --template=template0 "$1" | |
psql -U postgres "$1" < "$1"_dump_utf8.sql |
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
<?php | |
$importe = 32887.76 * (10.6666 / 100); | |
echo $importe; | |
echo "\n"; | |
echo floor($importe * 10000) / 10000; | |
echo "\n"; | |
echo money_format_rounded('%!i', $importe); |
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 | |
## Actualizar Raspberry | |
apt update -y | |
apt upgrade -y | |
apt dist-upgrade -y | |
## Instalar apache | |
apt install -y apache2 |
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
<?php | |
function sellar($txt){ | |
$llave = " | |
-----BEGIN RSA PRIVATE KEY----- | |
-----END RSA PRIVATE KEY----- | |
"; | |
$private = openssl_pkey_get_private($llave); |
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
<?php | |
$cfdi = '<?xml version="1.0" encoding="UTF-8"?> | |
<cfdi:Comprobante xmlns:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nomina="http://www.sat.gob.mx/nomina" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd http://www.sat.gob.mx/nomina http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina11.xsd" version="3.2" fecha="2015-11-06T18:15:32" folio="123 - 1063" serie="A" subTotal="24113.81" descuento="0.00" motivoDescuento="Deducciones de nómina" total="20000.00" Moneda="MXN" condicionesDePago="Contado" NumCtaPago="No identificado" tipoDeComprobante="egreso" noCertificado="00001000000307566366" certificado="MIIFNzCCBB+gAwIBAgIUMDAwMDEwMDAwMDAzMDc1NjYzNjYwDQYJKoZIhvcNAQELBQAwggGKMTgwNgYDVQQDDC9BLkMuIGRlbCBTZXJ2aWNpbyBkZSBBZG1pbmlzdHJhY2nDs24gVHJpYnV0YXJpYTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cml |
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
<?php | |
echo obtenerserieSAT("3230303031303030303030323030303031343238"); | |
function obtenerserieSAT($str) { | |
$serie = ""; | |
for ($i = 1; $i < strlen($str); $i = $i + 2) | |
$serie .= substr($str,$i,1); | |
return $serie; | |
} |