Skip to content

Instantly share code, notes, and snippets.

View anned20's full-sized avatar
💻

Anne Douwe Bouma anned20

💻
View GitHub Profile
@anned20
anned20 / README.md
Last active April 10, 2023 12:26
Facebook unfollower and refollower

Facebook unfollower and refollower

Want to unfollow every friend you have on Facebook to reduce the clutter and regain focus?

Or unfollowed a lot of your friends on Facebook? Want to follow them again and not click 9 million times on small buttons?

This script can do it automatically!

Requirements

@anned20
anned20 / convert_latin1_to_utf8mb4.php
Created April 23, 2020 09:53
Convert a latin1 database to utf8mb4
<?php
/**
* This script can convert a latin1 database(s) to utf8mb4 and then actually convert the data too.
*
* Actually stolen from and tweaked a lot from
* @link https://gist.github.com/pobegov/f8b293fb6eb658a13feb1c318e6c07ed
*
* Disclaimer: This is a really _hacky_ script but it does the job.
*

Keybase proof

I hereby claim:

  • I am anned20 on github.
  • I am anned20 (https://keybase.io/anned20) on keybase.
  • I have a public key ASB2bzDsCkNBzjHmrLMJi5r2wDr3KdLMsmYgFxFu1PESbgo

To claim this, I am signing this object:

@anned20
anned20 / encryption.js
Last active June 1, 2023 11:45
Encrypting files with NodeJS
const crypto = require('crypto');
const algorithm = 'aes-256-ctr';
let key = 'MySuperSecretKey';
key = crypto.createHash('sha256').update(String(key)).digest('base64').substr(0, 32);
const encrypt = (buffer) => {
// Create an initialization vector
const iv = crypto.randomBytes(16);
// Create a new cipher using the algorithm, key, and iv
const cipher = crypto.createCipheriv(algorithm, key, iv);
@anned20
anned20 / brightness.sh
Created February 6, 2017 20:15
Control intel brightness with commands
#!/usr/bin/env bash
current=$(cat /sys/class/backlight/intel_backlight/brightness)
max=$(cat /sys/class/backlight/intel_backlight/max_brightness)
wanted=$1
stepsize=30
function usage() {
echo "Usage:"
echo "Make it higher: brightness higher"