This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ad8f2da2749e24ca038ea7d4bd96ce61df937ee1 Mon Sep 17 00:00:00 2001 | |
From: Naveen Nathan <naveen@lastninja.net> | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# imap | |
## .muttrc_auth should contain the following | |
## set folder = "imaps://mail.messagingengine.com/" | |
## set imap_user = "billg@microsoft.com" | |
## 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# always shfmt -i 2 this dealio | |
# i don't need to see my username | |
PS1='\h:\W \$ ' | |
# so i can recursive glob to find files e.g. echo src/**/App.java for a java src tree | |
# only works in bash 4.x and later, while mac still supplies crummy bash 3 | |
if shopt 2>&1 | grep -q globstar; then | |
shopt -s globstar | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* turns out this is wrong, the regex "quic | noise" contains spaces you need to consider */ | |
/* | |
* $ ./r | |
* "quic | noise" matches "high pitched noise coming from car" | |
* $ ./r s | |
* "noise | quic" matches "a quick fix" | |
* "noise | quic" matches "high pitched noise coming from car" | |
*/ | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From foo@bar.com Tue Jan 8 09:37:45 2019 | |
Date: Tue, 8 Jan 2019 09:37:45 +1100 | |
From: foo@bar.com | |
To: a@b.c | |
Subject: a quick fix | |
Message-ID: <20190107223745.GA1689@Administrators-MacBook-Pro-3.local> | |
MIME-Version: 1.0 | |
Content-Type: text/plain; charset=us-ascii | |
Content-Disposition: inline | |
User-Agent: Mutt/1.11.1 (2018-12-01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* A simple qsort implementation on linked lists */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
/* | |
* A 'node' is an element of the linked list, containing a pointer | |
* to the next element, and the associated data | |
* A full list is represented by a pointer to its first element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* See queue(3) or https://www.freebsd.org/cgi/man.cgi?query=queue&sektion=3 for reference. | |
*/ | |
#include <stdio.h> | |
#include <sys/queue.h> | |
struct Pattern { | |
char name[100]; | |
/* Following expands to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" make sure to: | |
" mkdir -p ~/.config/nvim && echo 'source ~/.nvimrc' >> ~/.config/nvim/init.vim | |
" also install vim-plug: | |
" curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
" Then call :PlugInstall | |
call plug#begin() | |
Plug 'nnathan/desertrocks' | |
Plug 'fatih/vim-go', { 'tag': '*' } | |
" we really need to get rid of this - github.com/nnathan/desertrocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'tpope/vim-surround' | |
Plugin 'kien/ctrlp.vim' | |
Plugin 'tpope/vim-sleuth' |