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/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
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
Alguns programas (que usam GTK) no Ubuntu nao funcionam a Ç cedilha com ' + c. | |
Pra resolver: | |
Problem with cedilla: | |
After many versions of Ubuntu assigning accented c (“ć”) instead of c with a cedilla (“ç”) when typing ‘ + c in deadkeys keyboard layouts, since Ubuntu 11.10 GTK changed the default in an U.S. English locale back to the cedilla. However, non-GTK applications (e.g., Skype) still have the old behavior. To fix them, edit as root the file /usr/share/X11/locale/en_US.UTF-8/Compose and change all instances of ć with ç, and all instances of Ć with Ç. | |
You might need to repeat this operation from time to time, when you upgrade your system and it takes the configuration files back to their original contents. |
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
<?php | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial | |
*/ | |
class VideoStream | |
{ | |
private $path = ""; |
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
//Generate a self signed X509 certificate with Bouncy Castle. | |
// StringBuilder sb = new StringBuilder(); | |
// | |
// for (int i = 0; i < pub.length; ++i) | |
// { | |
// sb.append(Integer.toHexString(0x0100 + (pub[i] & 0x00FF)).substring(1)); | |
// } | |
// | |
// System.out.println(sb); | |
// sb.setLength(0); |
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
<?php | |
namespace Acme\Util; | |
/** | |
* ImageExtractor | |
*/ | |
class ImageExtractor | |
{ | |
const FORMAT_JPG = 'jpg'; |
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
/** | |
* Apache HTTP Fluent client configuration | |
* @throws KeyStoreException | |
* @throws NoSuchAlgorithmException | |
* @throws KeyManagementException | |
* @throws IOException | |
* @throws CertificateException | |
*/ | |
public static void httpClientConfigurator() throws KeyStoreException, KeyManagementException, NoSuchAlgorithmException, | |
CertificateException, IOException { |
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
[Unit] | |
Description=Job that runs the python SimpleHTTPServer daemon | |
Documentation=man:SimpleHTTPServer(1) | |
[Service] | |
Type=simple | |
WorkingDirectory=/tmp/letsencrypt | |
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 & | |
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'` |
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
import org.bouncycastle.asn1.ASN1Encodable; | |
import org.bouncycastle.asn1.DERSequence; | |
import org.bouncycastle.asn1.x500.X500Name; | |
import org.bouncycastle.asn1.x509.BasicConstraints; | |
import org.bouncycastle.asn1.x509.Extension; | |
import org.bouncycastle.asn1.x509.GeneralName; | |
import org.bouncycastle.asn1.x509.KeyUsage; | |
import org.bouncycastle.cert.X509CertificateHolder; | |
import org.bouncycastle.cert.X509v3CertificateBuilder; | |
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; |
OlderNewer