Skip to content

Instantly share code, notes, and snippets.

@CptainObvious
CptainObvious / collisionLSH.py
Created August 18, 2021 10:13 — forked from unrealwill/collisionLSH.py
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()
@CptainObvious
CptainObvious / Concepts.md
Created February 19, 2020 13:43 — forked from r6m/Concepts.md
Rust concept explanations

My explanation of the main concepts in Rust

There are three main concepts with Rust:

  1. Ownership (only one variable "owns" the data at one time, and the owner is in charge of deallocating)
  2. Borrowing (you can borrow a reference to an owned variable)
  3. Lifetimes (all data keeps track of when it will be destroyed)

These are fairly simple concepts, but they are often counter-intuitive to concepts in other languages, so I wanted to give a shot at

@CptainObvious
CptainObvious / clean-up-boot-partition-ubuntu.md
Created February 20, 2019 14:02 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@CptainObvious
CptainObvious / dns_checker.js
Created August 2, 2018 12:18
Script that print all dead dns from file dns.txt
var dns = require("dns"), sys = require('sys');
var lineReader = require('readline').createInterface({
input: require('fs').createReadStream('dns.txt')
});
lineReader.on('line', function (line) {
dns.resolve4(line, function (err, addr) {
if (!err)
console.log(line);
});