This file contains 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
$privateKeyIntermediateCA = new \Crypt_RSA(); | |
$privateKeyIntermediateCA->setPassword('Intermediate CA password'); | |
$privateKeyIntermediateCA->loadKey(file_get_contents($privateCAKeyPath)); | |
$certificateIntermediateCA = new \File_X509(); | |
$certificateIntermediateCA->setPrivateKey($privateKeyIntermediateCA); | |
$certificateIntermediateCA->loadX509(file_get_contents($certificateCAKeyPath)); | |
$clientPrivateKey = new \Crypt_RSA(); | |
$clientPrivateKey->setPassword($password); |
This file contains 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
KeyStore keyStore = KeyStore.getInstance("PKCS12"); | |
FileInputStream clientCertificateContent = new FileInputStream("/path/to/publicAndPrivateKey.p12"); | |
keyStore.load(clientCertificateContent, "private key password".toCharArray()); | |
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); | |
keyManagerFactory.init(keyStore, "private key password".toCharArray()); | |
FileInputStream myTrustedCAFileContent = new FileInputStream("/path/to/embedded/CA-Chain.pem"); | |
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); | |
X509Certificate myCAPublicKey = (X509Certificate) certificateFactory.generateCertificate(myTrustedCAFileContent); |
This file contains 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 | |
# | |
# Given a GIT repository with two remotes, uses one as `origin` | |
# and other as `destination` for the backup. | |
# Usage: | |
# /usr/bin/backup-all-git-repos.sh [repo-name] | |
# repo-name: Name of the repository to backup, is actually | |
# the directory of the repository in the FS. | |
# If specified only backups that repository. | |
# |
This file contains 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 | |
#Reference: http://archive.gregk.me/2011/phpunit-command-line-code-coverage-summary/ | |
COVERAGE="" | |
METRICS="/tmp/phpunit-metrics.xml" | |
BEFORE="/tmp/before-wip" | |
AFTER="/tmp/after-wip" | |
if [ "$1" == "--clean" ] | |
then | |
rm -f $METRICS $BEFORE $AFTER |
This file contains 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
-- SELECT OLD AND NEW INFORMATION IF EMAIL ARE THE SAME | |
select * from account_external_ids where EMAIL_ADDRESS = 'XXXXX@XXXX'; | |
-- NEW ID | |
delete from account_external_ids where account_id= NEW_ID; | |
delete from accounts where ACCOUNT_ID= NEW_ID; | |
-- OLD ID | |
INSERT INTO account_external_ids values (OLD_ID, 'XXXXX@XXXX'', NULL, OAUTH_IDENTIFIER); |
This file contains 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
cat /tmp/json_a | php -r '$f=file("php://stdin"); $a = json_decode(join($f), true); function ksortRecursive(&$array, $sort_flags = SORT_REGULAR) { if (!is_array($array)) return false; ksort($array, $sort_flags); foreach ($array as &$arr) { ksortRecursive($arr, $sort_flags); } return true; }; ksortRecursive($a); echo var_export($a,true);' > /tmp/json_a_sorted | |
cat /tmp/json_b | php -r '$f=file("php://stdin"); $a = json_decode(join($f), true); function ksortRecursive(&$array, $sort_flags = SORT_REGULAR) { if (!is_array($array)) return false; ksort($array, $sort_flags); foreach ($array as &$arr) { ksortRecursive($arr, $sort_flags); } return true; }; ksortRecursive($a); echo var_export($a,true);' > /tmp/json_b_sorted | |
diff /tmp/json_a_sorted /tmp/json_b_sorted -u --ignore-all-space |
This file contains 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
Index: pt_BR/appendices/migration53.xml | |
=================================================================== | |
--- pt_BR/appendices/migration53.xml (revision 335291) | |
+++ pt_BR/appendices/migration53.xml (working copy) | |
@@ -1,41 +1,43 @@ | |
<?xml version="1.0" encoding="utf-8"?> | |
-<!-- $Revision$ --> | |
+<!-- EN-Revision: 331031 Maintainer: rogerioprado Status: wip --><!-- CREDITS: milhomem --> | |
<appendix xml:id="migration53" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
- <title>Migrating from PHP 5.2.x to PHP 5.3.x</title> |