use xsl to output plain text

You can define a template to match on script/command and eliminate the xsl:for-each concat() can be used to shorten the expression and save you from explicitly inserting so many <xsl:text> and <xsl:value-of> elements. The use of an entity reference &#xA; for the carriage return, rather than relying on preserving the line-break between your <xsl:text> element … Read more

How do I encrypt plaintext with GnuPG?

What about: $ echo “hello” | gpg –symmetric –armor –passphrase “asdf” —–BEGIN PGP MESSAGE—– Version: GnuPG v1.4.11 (Darwin) jA0EAwMCWfhRZo0AiwVgyRw5Q26Tf+i6OCiQOVoUNJZEfz5ekBJw6BdVpE88 =ecV3 —–END PGP MESSAGE—– If this is what you’re looking for, you’ll want to setup gpg-agent to handle the passphrase… Passing it in from the command line like that is fairly insecure (as any program on … Read more

Why are plain text passwords bad, and how do I convince my boss that his treasured websites are in jeopardy? [closed]

In the military it’s called “Defense in Depth”. The theory is that you harden every layer you can rather than hardening just one layer and hoping it’s enough. I’ve heard databases like yours called “hard on the outside, soft and chewy on the inside”. There are a million ways a dedicated hacker can get access … Read more

Creating user with encrypted password in PostgreSQL

You may provide the password already hashed with md5, as said in the doc (CREATE ROLE): ENCRYPTED UNENCRYPTED These key words control whether the password is stored encrypted in the system catalogs. (If neither is specified, the default behavior is determined by the configuration parameter password_encryption.) If the presented password string is already in MD5-encrypted … Read more

Converting HTML to plain text in PHP for e-mail

Use html2text (example HTML to text), licensed under the Eclipse Public License. It uses PHP’s DOM methods to load from HTML, and then iterates over the resulting DOM to extract plain text. Usage: // when installed using the Composer package $text = Html2Text\Html2Text::convert($html); // usage when installed using html2text.php require(‘html2text.php’); $text = convert_html_to_text($html); Although incomplete, … Read more

What is the MIME type for Markdown?

tl;dr: text/markdown since March 2016 In March 2016, text/markdown was registered as RFC7763 at IETF. Previously, it should have been text/x-markdown. The text below describes the situation before March 2016, when RFC7763 was still a draft. There is no official recommendation on Gruber’s definition, but the topic was discussed quite heavily on the official mailing-list, … Read more