Posts for: #linux

A tour of FreeBSD in 2022

Why Handy resources Talks Factoids Things that feel different Software management and ports Ports patching init system coreutils Scheduling Block devices My setup NFS xorg dwm st powerd++ ntp fonts Why Mostly curiosity. I’ve been a GNU/Linux and free software enthuiatist since the late 90’s and that’s not about to change. More concrete reasons: GNU/Linux won the war. However… The Berkeley Software Distributions are family of open UNIX-like operating systems with lineage back to AT&T UNIX They come as complete and cohesive systems, not a distribution of disparate pieces The BSD license is wonderfully permissive Bill Joy (the father of Sun, BSD, vi, RISC) Marshall Kirk McKusick ZFS, DTrace and Clang It feels so damn neat, tidy and robust It wont be my daily driver, however it’s nice to be aware of what {Free,Open,Net}BSD each bring to the table Handy resources FreeBSD Handbook FreeBSD Porters Handbook FreeBSD Wiki Freshports the place for ports and most recent commits bsd-hardware.
Read more →

Default programs based on MIME type with XDG

From an ancient post I previously did…I need to refresh my mind on this topic often enough thought it worthy of breaking it out. How Linux systems figure out what program should open a file Programs that handle arbitrary files (e.g. web browsers, irc clients, file managers) delegate to a general purpose resource handler. XDG MIME Applications is the ubiquitous option here, and is not only an implementation, but a full blown specification.
Read more →

DVD backups on GNU/Linux

This is how I like to create digital copies (i.e., backups) of my physical DVD collection, which I own legitimately. I don’t condone piracy or theft. Backup instructions Rip physical DVD media makemkv Transcode mkv to m4v container using Fast 1080p30 preset in handbrake. Passthrough UTF-8 subtitles if you like those. Copy to media backup server rsync --protect-args -av --progress Season8 "shnerg@172.16.1.32:/data/TV/Penn & Teller Bullshit/" Software MakeMKV transcoder that deals with proprietary (and usually encrypted) disc into a set of MKV files Handbrake general video transcoder The C source is available as tarballs makemkv-bin-1.
Read more →

Installing Arch Linux on the Pinebook Pro

Updated 2022-04-11: Installed a minimal version of Manjaro, a SLICK flavour of Arch The pinebook pro is a beautiful 64-bit ARM based laptop, that reminds me of the form factor of a modern macbook air, shipping with a premium magnesium alloy shell, 64GB eMMC and a 10,000 mAH battery. All this for $200. As a NIX machine, I’ve found Manjaro to be delightful. I have dreams of one day installing OpenBSD.
Read more →

My LaTeX, Pandoc and Makefile workflow for writing papers in 2022

Contents Install base Tex system Pandoc Author paper Create bibliography (BibTeX) Render the paper as PDF Use Git Resources LaTeX is a high-quality typesetting system; features are designed for the production of technical and scientific documentation. It’s the de-facto standard for the communication and publication of scientific documents, and available as free software. LaTeX is actually built on the TeX typesetting system created by the legendary Donald Knuth. LaTeX is nothing more than a series of TeX macros, providing ready made commands for common formatting and layout needs, such as section headings, footnotes, bibliographies and cross references.
Read more →

Linux Storage and File Systems

Partitioning Two popular partition schemes are used in the wild, MBR and GPT. MBR MBR, or Master Boot Record, often associated with BIOS, was introduced in 1983 with IBM PC DOS 2.0, is a special boot sector located at the beginning of a drive. This sector contains a boot loader (e.g GRUB), and details about the logical partitions. MBR supports drives upto 2TiB, and up to 4 primary partitions. # fdisk /dev/vda Welcome to fdisk (util-linux 2.
Read more →

Red Hat Certified System Administrator 8 (RHCSA)

I’m a software engineer not a sysadmin. In fact I know I’m a bad one. The RHCSA is a rote, mechanical process. It did force me to discover discover several gaps in my GNU/Linux knowledge so overall happy about that. Essential Tools Documentation man /usr/share/doc RPM bundled documentation General Searching Techniques Shell history Globbing I/O Redirection and Pipes Essential File Management Linux file system layout Finding Files locate find Archiving and compression with tar Hard and Soft Links Working with text Regular expressions grep sed and awk Connecting a Linux host Consoles Terminals and TTYs Switch Users (su) sudo SSH Managing users and groups Creating users User properties User configuration files Creating and managing groups Managing password properties Managing Permissions Changing file ownership Managing basic permissions Understanding umask (user mask) Special permissions suid sgid Sticky bit Understanding ACLs Configuring Networking Network device naming Managing runtime network configuration with ip Storing network configuration persistently nmcli Routing and DNS Managing Processes Shell jobs ps Memory usage CPU load System activity with top Sending signals to processes Priority and niceness tuned profiles Managing Software RPM and yum rpm queries yum Groups Repositories Modules and Application Streams Red Hat Subscription Manager Systemd Scheduling Tasks cron at systemd Timers tmpfiles.
Read more →

C

Update: 2022-04-26: Overhauling to be simplier and bsd/clang friendly. Rules of engagement Style The language Basic Types Integer Types Real and Complex Floating Types void Memory Access Operators Strings The Pre Processor Macros Patterns vtables person_s.h print_vtable.h print_vtable.c main.c Libraries C standard library C POSIX library Unit Testing Sample C code Rules of engagement How I program C by Eskil Steenberg Notes on Programming in C by Rob Pike The Ten Commandments for C Programmers by Henry Spencer Style suckless FreeBSD man 9 style The language Basic Types Integer Types C99 with stdbool.
Read more →

make

A small make orientation guide. The Makefile (capital M) is parsed by GNU Make, which is responsible for generating the various GCC compiler commands, required to compile this source code. For example, I could issue individual compiler commands like this to create my binaries: gcc -Wall -g -std=gnu11 -O0 -Iinclude -Iinclude/engine `pkg-config --cflags glib-2.0` -c -o main.o src/main.c However, this is tedious, error prone and slow. I don’t want to have to keep a list of source files I modified, that require rebuilding.
Read more →

Linux Ops Guide

Here I aim to cover a set of common administration tasks. Things like, the hostname, system logs, what users are currently logged in, physical devices that are connected, logical volumes, file system and inode allocation, attached network interfaces and their addressing, processes and daemons currently running, kernel verison, local users and groups, installed packages, remote mounts, network shares, system uptime, bread and butter OS stats (CPU, IO, network, memory). Booting shutdown -r +5 System going down for a reboot #wall broadcast msg shutdown -c #cancel reboot shutdown -r 00:00 #schedule for midnight shutdown -h +5 #halt system in 5 mins shutdown -h now Alternatively, just use systemd:
Read more →

Secure SHell (SSH)

The OpenSSH secure shell, ssh, provides the necessary client/server security plumbing, to allow shell execution on a remote machine. ssh can be used interactively, as per a normal shell, or to run one off commands, for example: $ ssh ben@wookie.local uname -a ben@wookie.local's password: Linux wookie.local 3.14-1-686-pae #1 SMP Debian 3.14.7-1 (2014-06-16) i686 GNU/Linux Hot tip: the w command is gem for showing users currently logged in $ w -f USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT ben tty2 :0 17:05 10:36m 16:53 50.
Read more →

NeoMutt setup (2022 edition)

Intro Getting started with mutt 2022 setup cron GPG crypto Address book integration pam-gnupg Intro If you haven’t heard of mutt you’re missing out. Mutt is a small but very powerful text-based mail client for UNIX operating systems It’s a command line based mail reader (MUA). The neomutt project is a contemporary fork of the original mutt with added features, patch sets and fixes. I started seriously using mutt as my full-time mail client in 2012.
Read more →