Moved to skeeto/scratch/aidrivers
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# If file exists (likely) copy fragment below into existing script: | |
# If stdin is a terminal | |
if [ -t 0 ]; then | |
# Set GPG_TTY so gpg-agent knows where to prompt. See gpg-agent(1) | |
export GPG_TTY="$(tty)" | |
# Set PINENTRY_USER_DATA so pinentry-auto knows to present a text UI. | |
export PINENTRY_USER_DATA=USE_TTY=1 |
This is a project structure I’ve found useful. Looking for any
thoughts/comments/feedback. Roughly, I found a tension between the style
nixpkgs expects and the style conducive to development, so I extracted the
common portion into a derivation.nix
which is used by the remaining .nix
files. This setup allows me to use nix build
, nix-shell
, overlays, Hydra,
alternate packaging schemes, cross-compiling, etc.
#! /bin/sh | |
nix-instantiate --find-file nixpkgs >/dev/null || { | |
echo "Could not find nixpkgs, please set up your NIX_PATH" | |
exit 1 | |
} | |
NIX_DO_STASH="${NIX_DO_STASH:-$HOME/.local/share/nix-do}" | |
NIX_DO_PROFILE="${NIX_DO_PROFILE:-$(readlink $HOME/.nix-profile)}" |
Notes on how to set up a new Ubuntu LTS x64 environment, how to build a recent Mainline Kernel and place it on a Raspberry Pi OS SD card.
- Install tools needed:
$ apt install git make gcc g++ device-tree-compiler bc bison flex libssl-dev libncurses-dev python3-ply python3-git libgmp3-dev libmpc-dev
This bash script updates a package version and source hash directly in the source files.
It uses unsafeGetAttrPos
to find the files to edit, which in turn require to get access to the real attrset.
This is why we have to define the overlays.
#!/bin/bash | |
MAC=false | |
date -r "$now" +%Y-%m-%d &> /dev/null | |
if [ "$?" -ne "0" ]; then echo "LINUX"; MAC=false; else echo 'MAC'; MAC=true; fi | |
now=`date +%s` | |
while true | |
do | |
if [ "$MAC" == "true" ]; then data=`date -r "$now" +%Y-%m-%d`; else data=`date -d @"$now" +%Y-%m-%d`; fi |
http://lambda-the-ultimate.org/node/3896#comment-58374
Reposting here for safe keeping.
Error Codes
One of the return values is the error. Use when the goal is to cover-your-ass by ensuring that error handling is possible, even though you know any error handling or recovery would clutter the happy-path and thus ensure programmers are reluctant to admit to their existence at all.