Skip to content

Instantly share code, notes, and snippets.

shopt -s globstar

Naveen Nathan nnathan

shopt -s globstar
  • Compton
Block or report user

Report or block nnathan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .mbsyncrc
# this config is to facilitate one-way backups from fastmail to local maildir,
# it is specifically set to "Sync Pull" on the IMAP account to ensure
# read-only access.
# to run:
# brew install isync
# mbsync -a
BufferLimit 1024m
nnathan / .offlineimaprc
Created Nov 18, 2019
.offlineimaprc for backing up on MacOS
View .offlineimaprc
# to do a one-shot backup:
# $ offlineimap -a fastmail
accounts = fastmail
ui = blinkenlights
[Account fastmail]
nnathan / k-and-r-1.24.c
Created Oct 30, 2019
freenode ##c caze K&R C exercise 1.24 example from
View k-and-r-1.24.c
#include <stdio.h>
#include <stdlib.h>
typedef void effector(int);
typedef struct transition transition;
struct transition {
int state;
effector *effect;
View transition.c
#include <stdio.h>
#include <stdlib.h>
typedef void effector(int);
typedef struct transition transition;
struct transition {
int state;
effector *effect;
nnathan /
Last active Oct 26, 2019
Go repository build script.
#!/usr/bin/env bash
set -e
if [ -t 1 ]
nnathan /
Created Jun 10, 2019
idea for audio cd burning gui on mac

Audio CD Burning for Mac

When it comes to burning audio CDs on a mac (since at least 10.9) there's really only two options: iTunes or using cdrdao.

iTunes has a very simple GUI and it makes it pretty easy to burn but instead of doing DAO (Disc-At-Once) burning it does TAO (Track-At-Once) which is extremely tempremental and results in more coasters than good burns. It may do DAO for CD-TEXT cds but even then I get a burn success rate of 10%.

cdrdao on the other hand does DAO and is incredibly reliable.

it would be nice to write an open source public domain native mac program that bundles cdrdao and LAME and provides a small GUI that implements the Audio CD burning interface provided by iTunes.

nnathan / Pro.terminal
Created Jun 5, 2019 profile
View Pro.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
nnathan / urandompoll.c
Last active May 27, 2019
example poll program
View urandompoll.c
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/poll.h>
#define TIMEOUT 5
int main (void)
nnathan / urandom.patch
Last active May 27, 2019
patch for /dev/urandom to block on cold start when random.urandom_can_block=y in kernel cmdline
View urandom.patch
From ad8f2da2749e24ca038ea7d4bd96ce61df937ee1 Mon Sep 17 00:00:00 2001
From: Naveen Nathan <>
Date: Mon, 27 May 2019 10:05:01 +0000
Subject: [PATCH] random: urandom reads block when CRNG is not initialized.
Adds a compile-time option to ensure urandom reads block until
the cryptographic random number generator (CRNG) is initialized.
This fixes a long standing security issue, the so called boot-time
entropy hole, where systems (particularly headless and embededd)
View .muttrc
# imap
## .muttrc_auth should contain the following
## set folder = "imaps://"
## set imap_user = ""
## set imap_pass = "hunter2"
source ~/.muttrc_auth
set imap_idle = yes
set spoolfile = "+INBOX" # specifies default mailbox
set postponed = "+INBOX/Drafts" # stores a copy of message until its sent (draft)
You can’t perform that action at this time.