Skip to content

Instantly share code, notes, and snippets.

@mapmeld
mapmeld / OverEncrypt.md
Last active July 25, 2023 18:55
OverEncrypt - paranoid HTTPS

OverEncrypt

This is a guide that I wrote to improve the default security of my website https://fortran.io , which has a certificate from LetsEncrypt. I'm choosing to improve HTTPS security and transparency without consideration for legacy browser support.

WARNING: if you mess up settings, lose your certificates, or decide to no longer maintain HTTPS certs, these steps can and will make your domain inaccessible.

I would recommend these steps only if you have a specific need for information security, privacy, and trust with your users, and/or maintain a separate secure.example.com domain which won't mess up your main site. If you've been thinking about hosting a site on Tor, then this might be a good option, too.

The best resources that I've found for explaining these steps are https://https.cio.gov , https://certificate-transparency.org , and https://twitter.com/konklone

@nootanghimire
nootanghimire / convert.php
Created November 7, 2013 06:45
Converts numbers into nepali
<?php
function convert($num){
$arr = array(०,१,२,३,४,५,६,७,८,९);
$newArr = array();
$sep = str_split($num); //implicit string conversion
foreach($sep as $key=>$value){
$newArr[$key] = $arr[$value];
}
return implode('',$newArr);
@njsubedi
njsubedi / tictactoe.html
Created May 30, 2013 07:14
This is a simple Two-player TicTacToe game developed by me using HTML and JS in one night. I could have used X and O instead of colors but I tried to make it different, hence made it worse. Anyways, it would give an idea to do similar stuff using HTML and Javascript.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="author" content="Nj Subedi" />
<meta name="http-equiv" content="charset: utf-8" />
<meta name="description" content="Tic Tac Toe game developed using HTML and Javascript. Simple- commented and uncompressed." />
<meta name="generator" content="Bluefish Editor (Ubuntu OS, Version 12.04 LTS)" />
@crazybyte
crazybyte / encrypt_openssl.txt
Created November 25, 2012 10:10
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@granoeste
granoeste / gist:870440
Created March 15, 2011 07:57
[Android] Modify contrast using a ColorMatrix
ColorMatrixColorFilter setContrast(float contrast) {
float scale = contrast + 1.f;
float translate = (-.5f * scale + .5f) * 255.f;
float[] array = new float[] {
scale, 0, 0, 0, translate,
0, scale, 0, 0, translate,
0, 0, scale, 0, translate,
0, 0, 0, 1, 0};
ColorMatrix matrix = new ColorMatrix(array);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);