Skip to content

Instantly share code, notes, and snippets.

@yarwelp
yarwelp / cmu_fedora.md
Last active October 30, 2023 14:24
Using Computer Modern Unicode LaTeX fonts with LibreOffice Writer on Fedora 23

Using Computer Modern Unicode LaTeX fonts with LibreOffice Writer on Fedora 23

First quit LibreOffice Writer if you have it running. Next, perform the following commands.

sudo dnf install texlive-cm-unicode
mkdir -p ~/.fonts/
dnf repoquery -l texlive-cm-unicode | egrep '\.otf$' \
 | xargs -I{} ln -s {} ~/.fonts/
@yarwelp
yarwelp / 00_INDEX.md
Last active January 30, 2023 11:34
Running FreeBSD on the Raspberry Pi Model B

Copyright (c) 2016 Erik Nordstrøm erik@nordstroem.no

Redistribution and use in source (GitHub Flavored Markdown) and 'compiled'

forms (HTML, PDF and so forth) with or without modification, are permitted

provided that the following conditions are met:

1. Redistributions of source code (GFM) must retain the above copyright

notice, this list of conditions and the following disclaimer as the first

@yarwelp
yarwelp / truth_table.js
Created November 29, 2011 07:17
Truth table (JavaScript)
/* js-truth_table
*
* file: truth_table.js
*
* Copyright (c) 2011, Erik Nordstroem <contact@erikano.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
This file has been truncated, but you can view the full file.
70534: mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366304256 (0x800643000)
70534: issetugid() = 0 (0x0)
70534: lstat("/etc",{ mode=drwxr-xr-x ,inode=36,size=117,blksize=7680 }) = 0 (0x0)
70534: lstat("/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=7589,size=47,blksize=4096 }) = 0 (0x0)
70534: openat(AT_FDCWD,"/etc/libmap.conf",O_CLOEXEC,00) = 3 (0x3)
70534: fstat(3,{ mode=-rw-r--r-- ,inode=7589,size=47,blksize=4096 }) = 0 (0x0)
70534: mmap(0x0,47,PROT_READ,MAP_PRIVATE,3,0x0) = 34366337024 (0x80064b000)
70534: close(3) = 0 (0x0)
70534: lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 (0x0)
@yarwelp
yarwelp / comp.md
Last active May 2, 2017 09:06
Compare files in two directory trees

Compare files in two directory trees

Example directory trees:

mkdir -p ~/tmp/{hurr,durr}/{a,b,c,d}/

for i in ~/tmp/{hurr,durr}/{a,b,c,d}/k ; do echo "cool beans" > $i ; done

echo yo &gt; ~/tmp/hurr/a/fo_sho
@yarwelp
yarwelp / polyglot.c
Created September 29, 2011 06:38
A polyglot written in C and bash
#include <stdio.h>
#include <stdlib.h> /*
# Copyright (c) 2011, Erik Nordstroem <contact[at]erikano[dot]net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@yarwelp
yarwelp / LICENSE
Created March 13, 2017 23:31
The ISC license
Copyright (c) YYYY John Doe <john.doe@example.com>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
STYLE_WEIGHT=5e2
STYLE_SCALE=1.0
th neural_style.lua \
-content_image examples/inputs/hoovertowernight.jpg \
-style_image starry_night_gigapixel.jpg \
-style_scale $STYLE_SCALE \
-print_iter 1 \
-style_weight $STYLE_WEIGHT \
-image_size 256 \
@yarwelp
yarwelp / RPi3B.md
Last active September 4, 2016 20:35
Raspberry Pi 3 Model B config

Raspberry Pi 3 Model B config

Download the "Raspbian Lite" minimal image from https://www.raspberrypi.org/downloads/, unzip it and dd it to a microSD card. Insert microSD into your Raspberry Pi 3 Model B (RPi), attach keyboard, video-monitor and mouse. Power on the RPi.

Set hostname. I'll call mine rpi3b. Use something you like.

@yarwelp
yarwelp / i2c.md
Last active August 31, 2016 15:30
Investigating DDC/CI communication with ASUS PB287 monitor from Fedora 23 Linux on MSI Cubi with Intel HD Graphics 5500

DDC/CI -- ASUS PB287 / Fedora 23 / MSI Cubi / Intel HD Graphics 5500

Investigating DDC/CI communication with ASUS PB287 monitor from Fedora 23 Linux on MSI Cubi with Intel HD Graphics 5500

i2cdetect -l

i2c-0	unknown   	i915 gmbus vga                  	N/A
i2c-1	unknown   	i915 gmbus dpc                  	N/A
i2c-2	unknown   	i915 gmbus dpb                  	N/A