Skip to content

Instantly share code, notes, and snippets.

@tarcam
tarcam / Create ECDSA certificate.txt
Created August 17, 2023 08:18 — forked from marta-krzyk-dev/Create ECDSA certificate.txt
Create self-signed ECDSA (ECC) certificate with private key inside in openssl
--- CREATE SELF-SIGNED ECDSA CERTIFICATE WITH PRIVATE KEY INSIDE ----
1. Open openssl.exe.
2. If you haven't chosen a curve, you can list them with this command:
ecparam -list_curves
I picked sect571r1 for this example. Use this to generate an EC private key if you don't have one already:
@tarcam
tarcam / hash.js
Created October 30, 2024 18:59 — forked from pierreis/hash.js
How to generate and check strong binary hashes for passwords with Node.JS
/*!
* Password hashing
*
* In essence, passwords are hashed with a global salt (the same for every password), which is
* to remain secret, and a local salt (only specific to one password). If you don't provide
* local salt to `hashPassword`, it will generate one for you.
* The result is a 48-byte long buffer which includes your hashed password along with the local
* salt in clear, that you can store in your DB. You may call buffer.toString('hex') in case
* you want to store it as hex and waste space.
*
@tarcam
tarcam / get_final_url
Created November 7, 2024 02:18 — forked from daveajones/get_final_url
A php function to follow all redirects and return the final destination url.
//Follow redirects to get to the final, good url
function get_final_url($url, $timeout = 5, $count = 0)
{
$count++;
$url = clean_url($url);
$ua = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0';
$cookie = tempnam("/tmp", "CURLCOOKIE");
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT, $ua);
@tarcam
tarcam / mask-referrer
Created April 1, 2025 20:23 — forked from bmhaskar/mask-referrer
This is sample page demonstrating referrer masking with the help of JS without iframe.
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Mask A referrer in get request without iframe</title>
</head>
<body>
<a href="http://google.com" class="masked" >Clicking to google</a> ||
<a href="http://yahoo.com" class="masked-differently" id="yahooLink" target="_blank">Clicking to yahoo</a>