Skip to content

Instantly share code, notes, and snippets.

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@metalcamp
metalcamp / linkedin-unfollow-everyone.js
Created August 30, 2022 21:41 — forked from brunolemos/linkedin-unfollow-everyone.js
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@metalcamp
metalcamp / hn_seach.js
Created August 4, 2022 05:46 — forked from kristopolous/hn_seach.js
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@metalcamp
metalcamp / upn_qr.js
Created February 2, 2022 18:18 — forked from jeancaffou/upn_qr.js
UPN QR Code
const fields = [
'UPNQR', // 1. Vodilni slog 5 Konstanta »UPNQR«.
'', // 2. IBAN plačnika Prazno.
'', // 3. Polog Prazno.
'', // 4. Dvig Prazno.
'', // 5. Referenca plačnika Prazno.
(this.user.name || '').trim(), // 6. Ime plačnika Obvezno (*). Brez vodilnih ali sledečih presledkov. Max 33 znakov
(this.user.naslov || '').trim(), // 7. Ulica in št. plačnika 33 Obvezno (*). Brez vodilnih ali sledečih presledkov.
`${this.user.posta} ${this.user.mesto}`.trim(), // 8. Kraj plačnika 33 Obvezno (*). Brez vodilnih ali sledečih presledkov.
String(this.payment.amount * 100).padStart(11, '0'), // 9. Znesek 11 Obvezno (**). Enajst cifer.
@metalcamp
metalcamp / grafana.yml
Created February 25, 2019 13:38 — forked from CVJoint/grafana.yml
TIG Stack - (Grafana, Telegraf, and InfluxDB)
version: "3.7"
services:
## Follow install instructions below
## InfluxDB
# Create config file:
# mkdir ${USERDIR}/docker/influxdb
# docker run --rm influxdb influxd config > ${USERDIR}/docker/influxdb/influxdb.conf
# Consider adding a database (optional)
@metalcamp
metalcamp / PhpStorm Keyboard Shortcuts.md
Created December 11, 2018 15:59 — forked from koomai/PhpStorm Keyboard Shortcuts.md
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@metalcamp
metalcamp / Tutorial.md
Created March 22, 2018 08:35
How to secure correctly your OpenVPN connection

Hi there,

How to secure correctly your OpenVPN connection you said?

Yes! This little code snippet will improve drasticaly the strength of your OpenVPN connection while keeping very good performances. You just have to add the code available below at the end of you configuration file.

Important precisions

  • It may not work everywhere. @Korben (Twitter) got a problem because his server does not support ECDHE, if you can't use this configuration then try to change ECDHE by DHE in the tls-cipher parameters. It should works but it will consume more battery if you are on a mobile/laptop because it will not use Elliptic curves to exchange the key.
  • You should check if your processor have AES-NI instructions. If yes then the key exchange should be protected from SPA (Simple Power Analysis) and DPA (Differencial Power Analysis) attacks + AES will be a lot faster.
@metalcamp
metalcamp / awesm.md
Created October 17, 2017 14:36 — forked from matula/awesm.md
Awesome PHP stuff in one Gist