Skip to content

Instantly share code, notes, and snippets.

View windytan's full-sized avatar
💭
I may be slow to respond.

Oona Räisänen windytan

💭
I may be slow to respond.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am windytan on github.
  • I am oona (https://keybase.io/oona) on keybase.
  • I have a public key whose fingerprint is 5E58 B00C B427 8814 EE00 05ED 57BE DFA9 3BBB EDE8

To claim this, I am signing this object:

#include <openssl/sha.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main() {
const char target[SHA_DIGEST_LENGTH] = {
0x69, 0xaf, 0x88, 0x1e, 0xca, 0x98, 0xb7, 0x04, 0x2f, 0x18,
0xe9, 0x75, 0xe0, 0x0f, 0x9d, 0x49, 0xd5, 0xd5, 0xee, 0x64
};
@windytan
windytan / dark_cpan.pl
Created December 11, 2014 22:56
dark perldoc & CPAN
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
domain('cpan.org')
{
html, body, tbody, tr, td, div { background-color: #232323 !important; color: #ccc !important }
pre {
display: block !important ;
background-color: #333333 !important ;
border: #777777 solid 0.1em !important ;
use warnings;
$fs = 48000;
$pi = 3.141592653589793;
open U, "|sox -t .raw -e sig -b 16 -c 1 -r $fs - numbers.wav sinc 300-4300";
dtmf ("12345567899000100100");
close U;
#!/usr/bin/perl
# Oona Räisänen 2014
use warnings;
$fs = 48000;
$f = 200;
$pi = 3.141592653589793238;
open(U,"|sox -t .raw -c 1 -r $fs -b 16 -e signed - sines.wav");
use warnings;
use DateTime;
$snum = 0;
$writing = 0;
open OUT, "|sox -t .raw -e signed-integer -b 16 -r 44100 ".
"-c 1 - stamped.wav";
while (not eof STDIN) {
use warnings;
my $snum = 0;
my $reading = 0;
open my $in, '-|', 'sox stamped.wav -e unsigned-integer -t .raw -';
while (read $in, $sample, 2) {
$bit = (unpack "S", $sample) & 1;
use warnings;
use DateTime;
$snum = 0;
$writing = 0;
open OUT, "|sox -t .raw -e unsigned-integer -b 16 -r 44100 ".
"-c 1 - stamped.wav";
while (not eof STDIN) {
@windytan
windytan / emoji.pl
Last active August 14, 2023 14:50
Visualize SSH public key fingerprints using Unicode emoji
# Oona Räisänen 2013
# http://windytan.com
# ssh-keygen -l -f ~/.ssh/id_rsa.pub | perl emoji.pl
@emoji = qw( 🌀 🌂 🌅 🌈 🌙 🌞 🌟 🌠 🌰 🌱 🌲 🌳 🌴 🌵 🌷 🌸
🌹 🌺 🌻 🌼 🌽 🌾 🌿 🍀 🍁 🍂 🍃 🍄 🍅 🍆 🍇 🍈
🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍔 🍕 🍖 🍗 🍘
🍜 🍝 🍞 🍟 🍠 🍡 🍢 🍣 🍤 🍥 🍦 🍧 🍨 🍩 🍪 🍫
🍬 🍭 🍮 🍯 🍰 🍱 🍲 🍳 🍴 🍵 🍶 🍷 🍸 🍹 🍺 🍻
$fs = 48000; # sample rate
$fc = 3729; # carrier frequency
$filter = " sinc -$fc"; # optional LP filter
$fc = freq($fc);
open(IN, "sox scrambled.wav -c 1 -b 16 -e signed -t .raw -|");
open(OUT,"|sox -r $fs -c 1 -b 16 -e signed -t .raw - descrambled.wav".
$filter);