Ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications. Automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. With Ansible and its amazing module ecosystem, you describe what needs to be accomplished (i.e. declarative), rather than describing how to accomplish each step (i.e. imperative). ...

December 31, 2017 · 17 min

Vagrant

When something becomes messy in the software industry, we have the habit of tucking the problems away behind abstractions. To me Vagrant is simply an abstraction layer for working with a range of hypervisors (libvirt, VirtualBox, VMWare, Hyper-V, Docker and more), in a reliable and consistent manner. By articulating VM’s as a simple text based (Ruby) configuration file, a Vagrantfile, achieve greater simplicity, portability across systems, and consistency which could theoretically be used with any virtual environment running on top of any other system. ...

December 30, 2017 · 3 min

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.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x9228f9b7. Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Using default response p Partition number (1-4, default 1): First sector (2048-2097151, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151): +500M Partition 1 of type Linux and of size 500 MiB is set Command (m for help): l 0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris 1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT- 2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT- 3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT- 4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx 5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data 6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / . 7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility 8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt 9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/ 10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b 11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor 12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor 14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary 16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS 17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE 18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto 1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep 1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT 1e Hidden W95 FAT1 80 Old Minix Command (m for help): t Selected partition 1 Hex code (type L to list all codes): 83 Changed type of partition 'Linux' to 'Linux' Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. The partition is now available as a block device, below we now see /dev/vda1: ...

June 12, 2017 · 23 min

systemd

Cheatsheet ========================================== ========================================== INFORMATION LOGS ========================================== ========================================== systemctl journalctl list-dependencies -u <name> by service list-sockets -f follow live log list-jobs -k kernel messages list-unit-files -k kernel messages list-units -r reverse (newest first) get-default -o json format output --type=service --all -b -1 from previous boot -n 10 limit output lines (tail) ========================================== -S,--since e.g "2012-10-30 18:17:16" SERVICES -U,--until e.g. "10 min ago" ========================================== systemctl ========================================== stop <name> SYSTEM STATES start <name> ========================================== restart <name> reload <name> systemctl status <name> reboot reboot.target enable <name> poweroff poweroff.target disable <name> emergency emergency.target show <name> default default.target -H <host> status network

May 20, 2017 · 1 min

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.d Logging Rsyslog Systemd Journal Logrotate Managing Storage Disk layout Creating partitions GPT partitions with parted MBR partitions with fdisk File System Choices XFS Ext4 Mounting Persistent block device naming systemd mounts Swap Advanced Storage LVM Stratis VDO LUKS Advanced tasks Kernel management Boot procedure GRUB Systemd targets Essential troubleshooting Changing root password Managing network services SSH httpd (apache) SELinux Context Labels Booleans File context labels SELinux logs SELinux troubleshooting Firewalling with firewalld Automating installs Time services Remote file systems NFS CIFS with Samba Automount Containers Autostarting non-root containers with systemd user units Dont forget list Exam shakedown Linux Gems Essential Tools Documentation The ability to understand a program using local documentation resources; man, info, /usr/share/doc, within the RPM package. ...

May 3, 2017 · 47 min

Computer Heros

Some heros in the world of computer science. Founding Fathers (pre 1960) George Boole (1815 - 1864) Boolean algegra. Papers The Mathematical Analysis of Logic (1847), and An Investigation of the Laws of Thought (1854). Friedrich Ludwig Gottlob Frege (1848 - 1925) Analytic philosophy. Developed modern logic in the Begriffsschrift and work in the foundations of mathematics. Books The Foundations of Arithmetic, On Sense and Reference and The Thought. Alan Turing (1912 - 1954) The father of theoretical computer science. Formalised the concepts of algorithm and computation through the notion of a Universal Machine (i.e Turing Machine) in his seminal paper On Computable Numbers, with an Application to the Entscheidungsproblem. ...

April 27, 2017 · 2 min

Tmux Quick Reference

Kudos to afair for putting together this neat Tmux Cheat Sheet, which I’m addicted to at the moment. ========================================== ========================================== TMUX COMMAND WINDOW (TAB) ========================================== ========================================== List tmux ls List ^b w New -s <session> Create ^b c Attach att -t <session> Rename ^b , <name> Rename rename-session -t <old> <new> Last ^b l (lower-L) Kill kill-session -t <session> Close ^b & ========================================== Goto # ^b <0-9> CONTROLS Next ^b n ========================================== Previous ^b p Choose ^b w <name> Detach ^b d List ^b = ========================================== Buffer ^b <PgUpDn> PANE (SPLIT WINDOW) Command ^b : <command> ========================================== Copy ^b [ ... <space> ... <enter> Show # ^b q Moving vim/emacs key bindings Split Horiz ^b " -------- Start <space> Split Vert ^b % | Copy <enter> Pane->Window ^b ! Paste ^b ] Kill ^b x ========================================== Reorganize ^b <space> SESSION (Set of Windows) Expand ^b <alt><arrow> ========================================== Resize ^b ^<arrow> Resize x n ^b <n> <arrow> New ^b :new ^b :new -s <name> Rename ^b $ Select ^b <arrow> List ^b s Previous ^b { Next ^b ( Next ^b } Previous ^b ) Switch ^b o other Swap ^b ^o Last ^b ;

April 17, 2017 · 1 min

DIY Computer Part 5 Machine Architecture

A continuation of my participation in the amazing Nand2Tetris course, by Noam Nisan and Shimon Schocken, now running on Coursera. Related posts: [DIY Computer Part 1 The NAND Gate]({% post_url 2016-03-06-diy-computer-nands %}) [DIY Computer Part 2 The ALU]({% post_url 2016-03-12-diy-computer-alu %}) [DIY Computer Part 3 Memory]({% post_url 2016-03-12-diy-computer-alu %}) [DIY Computer Part 4 Machine Language]({% post_url 2016-05-23-diy-computer-ml %}) Now armed with the necessary elementary logic gates and chips, are now ready to assemble a general purpose computer. Using a finite amount of hardware, it will be capable of performing practically an infinite number of tasks (e.g. games, word processing, networking). This remarkable flexibility, the fruit of the profound invention of several mathematicians in the 1930’s, is known as the stored program. ...

April 17, 2017 · 6 min

Nerd Gems 💎

This is a list of valuable (to me) developer resources that I’ve managed to stumble across (books, courses, friends and fellow programmers, hacker news, lobste.rs, university). Architecture AI and ML Awesome C Cloud Containers Cheat sheets Culture Databases Development Diagramming dotfiles Git Golang gRPC Hardware Humanities Jobs Kubernetes Languages Linux Message queues Mongo Monitoring Networking Open source Python Rust Security Shell systemd Text wrangling Talks Terminal Testing Text, Encoding and Serialization TypeScript Web Architecture .NET Microservices: Architecture for Containerized .NET Applications a fantastic resource for working with the modern .NET stack (post 2022) Communicating Sequential Processes Tony Hoare’s seminal 1977 paper on concurrency and CSP Why Segment Went Back to a Monolith microservices come with serious tradeoffs All software sucks complexity is the bane of all software, simplicity is the most important quality Designing Actor-Based Software with Hugh McKee an approach to building scalable software systems Queueing: An interactive study of queueing strategies an interactive journey to understand common queueing strategies for handling HTTP requests. AI and ML Andrej Karpathy on The spelled-out intro to neural networks and backpropagation: building micrograd a 2.5 hour step-by-step spelled-out explanation of backpropagation and training of neural networks. It only assumes basic knowledge of Python and a vague recollection of calculus from high school. A Beginner’s Guide to Vector Embeddings Awesome awesome-baremetal awesome-kubernetes learn-anything/books C Easy Makefile a Makefile boilerplate to hit the ground running Handmade Hero an educational series by Casey Muratori that teaches low-level game programming techniques by example Eskil Steenberg on How I program in C Cloud mcm Minimal Configuration Manager Packer a tool for building images for cloud platforms, virtual machines, containers and more from a single source configuration. CloudBoost a complete serverless platform for your app. The Google Cloud Developer’s Cheat Sheet every product in the Google Cloud family described in under 4 words Ask HN: Is Your Company Sticking to On-Premise Servers? Why? Using AWS CodeBuild to Execute Administrative Tasks What Is Amazon Resource Name (ARN)? more to the humble ARN than you think arn:partition:service:region:account-id:resource Containers OKD: The Community Distribution of Kubernetes that powers OpenShift The Docker Handbook 25 Basic Docker Commands for Beginners Setting the Record Straight: containers vs. Zones vs. Jails vs. VMs Docker Security Best Practices tools and methods to help secure Docker Kubernetes Workshop tons of details for getting started 10 Most Common Mistakes When Using Kubernetes lens kube IDE kubeseal how to safely store secrets in git if you want to use them in k8s Container Technologies at Coinbase great history on how the industry got to containers, an why kubernetes isn’t used A Practical Introduction to Container Security Webtop full desktop environments in officially supported flavors accessible via any modern web browser Cheat sheets Linux Commands - A practical reference an amazing cheat sheet, quick reference The Ultimate List of SANS Cheat Sheets when it comes to quality cyber-security training and certs SANS is world leading. They have an amazing collection of thoughtful and useful cheat sheets from topics such as Writing Tips for IT Professionals, Windows to Unix Cheat Sheet, to using pieces of software such as nmap, netcat, burb. Its a treasure trove! Lenny Zeltser’s IT and Information Security Cheat Sheets speaking of thoughtful cheat sheets, lots of wisdom here Culture Why we’re leaving the cloud You Are Not Google if you’re using a technology that originated at a large company, but your use case is very different, it’s unlikely that you arrived there deliberately; no, it’s more likely you got there through a ritualistic belief that imitating the giants would bring the same riches. GitLab’s Guide to All-Remote the remote manifesto, tips and tricks and remote resources Why we at $FAMOUS_COMPANY Switched to $HYPED_TECHNOLOGY Habbits of High-Functioning Software Teams characteristics and habits of the highest-performing dev teams Databases Things I Wished More Developers Knew About Databases SQL Coding Standards PostgreSQL Course: A Curious Moon learn PostgreSQL the way the pros do: on the job and under pressure. You’ll assume the role of interim DBA at aerospace startup Red:4, exploring data from the Cassini mission! Development What To Code inspiration and ideas Why the developers who use Rust love it so much Diagramming Excalidraw beautiful web based diagrams PlantText PlantUML (text) based diagram generator Taking ASCII Drawings Seriously: How Programmers Diagram Code dotfiles HexDSL LukeSmithxyz uoou Git Better Git configuration links and resources on configuring & using git Automate Repetitive Tasks with Custom git Commands how to write custom git commands Golang Everyday Golang LearnGo: A Large Collection of Go Examples, Exercises, and Quizzes Writing Go CLIs With Just Enough Architecture Getting Hands-On with io_uring from Go Diving Into Go by Building a CLI Application Immutability Patterns in Go Writing An Interpreter In Go gRPC gRPC - Best Practices Hardware Backblaze hard drive stats Build an 8-bit CPU by Ben Eater a programmable 8-bit computer from scratch on breadboards using only simple logic gates nand2tetris a distilled version of the book The Elements of Computing Systems, By Noam Nisan and Shimon Schocken (MIT Press), contains all the project materials and tools necessary for building a general-purpose computer system and a modern software hierarchy from the ground up Humanities The Chomsky List A definitive guide to Noam Chomsky: 10 books to get you started RATM reading list Jobs Inspired corp Kubernetes 7 Mind-Blowing Kubernetes Hacks The guide to kubectl I never had The Pros of On-Prem Kubernetes with Justin Garrison Languages Crafting Interpreters by Robert Nystrom Ever wanted to make your own programming language or wondered how they are designed and built? If so, this book is for you. Linux Linux Commands - A practical reference an amazing cheat sheet, quick reference 16 Linux server monitoring commands you really need to know Best 15 Unix Command Line Tools An In-Depth Guide to iptables covers pretty much every angle of iptables, from basic rules to NAT’ing to protocols and interfaces. mdadm Cheat Sheet practical commands when running software raid on Linux Async IO on Linux: select, poll, and epoll thorough write-up on ‘select’, ‘poll’ and ’epoll’ system calls, and how to measure them. The first 5 things to do when your Linux server keels over including hardware troubleshooting, checking the running state of applications How io_uring and eBPF Will Revolutionize Programming in Linux well explained history of Linux syscalls and their limitations, and how io_uring is a game changer by allowing async I/O via a pub/sub model bashtop gamified TUI resource monitor that shows usage and stats for processor, memory, disks, network and processes Time on Unix how time and localization works on Unix Tmux for mere mortals good defaults, modifying the keybindings to boost usability Tips for cleaning up a Linux server low hanging disk space fruit, like removing old kernels, pruning unused Docker space, clearing logs Shell productivity tips and tricks faster command line tips Message queues Postgres Message Queue - PGMQ lightweight message queue, like AWS SQS and RSMQ but on Postgres Mongo Quick reference cards Aggregation pipeline quick reference Monitoring Zabbix whatfiles logs the files programs CRUD, also traces new processes logtop reads stdin, can sort on any field and is updated in realtime Networking PacketLife Cheat Sheets The Packet Pioneer Chris Greer on TCP Fundamentals Part 1 TCP/IP Explained with Wireshark 59 Linux Networking commands and scripts the ultimate network tools goto list. Introduction to tcpdump and wireshark hping3 send arbitary TCP/IP packets to network hosts Setting up a Linux mail server linker∙d dynamic linker for microservices, taking care of the communication work needed to interact with distributed services, including routing, load balancing, and retrying. Manually Throttle the Bandwidth of a Linux Network Interface introduction to the tc tool for bandwidth shaping. connbeat agent that monitors TCP connection metadata and ships the data to Kafka or Elasticsearch, or an HTTP endpoint The Ultimate PCAP all protocols in a single PCAP What Every Developer Should Know About TCP SSH Tips & Tricks 2FA, securely forwarding agents, quitting from stuck sessions and using mosh or tmux High Availability Load Balancers with Maglev CloudFlare on their load balancing stack, BGP, Maglev connection scheduling, IPVS, UDP encapsulation for faster delivery Networking for Game Programmers: UDP vs TCP Open source Google Open Source 2000+ OSS projects managed by Google NSA on GitHub Python Python Design Patterns Inside the Python Virtual Machine Full Speed Python from Superior School of Technology of Setúbal Intermediate Python Ruff: Internals of a Rust-backed Python linter-formatter - Part 1 A Guide to Python’s Weak References Using weakref Module A Complete Guide to Pytest Fixtures Rust 100 Exercises To Learn Rust teaches Rust’s core concepts, one exercise at a time. You’ll learn about Rust’s syntax, its type system, its standard library, and its ecosystem. Security OST2.FYI OpenSecurityTraining2’s mission is to provide the world’s deepest and best cybersecurity training. That our classes are free is just a bonus! The Ultimate List of SANS Cheat Sheets when it comes to quality cyber-security training and certs SANS is world leading. They have an amazing collection of thoughtful and useful cheat sheets from topics such as Writing Tips for IT Professionals, Windows to Unix Cheat Sheet, to using pieces of software such as nmap, netcat, burb. Its a treasure trove! Lenny Zeltser’s IT and Information Security Cheat Sheets speaking of thoughtful cheat sheets, lots of wisdom here Linux reverse engineering 101 collection of resources for linux reverse engineering. Explain like I’m 5: Kerberos OAuth 2.0 Security Best Current Practices SSHHeatmap script that generates a heatmap of IP’s that made failed SSH login attempts using /var/log/auth.log psst Paper-based Secret Sharing Technique Shell Byobu multiplexer, enhanced profiles, convenient keybindings, configuration utilities, and toggle-able system status notifications for screen and tmux Makeself a self-extracting archiving tool for Unix systems, in 100% shell script 5 Types Of ZSH Aliases You Should Know alias suffixes & global aliases, plus other neat tricks Bash aliases you can’t live without systemd Why I Prefer systemd Timers Over Cron journal-triggerd runs trigger on systemd’s journal messages How to automatically execute shell script at startup boot on systemd Text wrangling CyberChef the ultimate open-source (by GCHQ) text wrangler you’ll ever need, life changing desed beautiful TUI that provides users with comfortable interface and practical debugger, used to step through complex sed scripts sed One Liners huge collection of useful sed examples xsv CLI for indexing, slicing, analyzing, splitting and joining CSV files Talks Rich Hickey on Simple Made Easy Mike Acton on Data-orientated Design Jonathan Blow on Programming Aesthetics learned from making independent games Eskil Steenberg on How I program in C Rich Hickey on Hammock Driven Development Brian Will on Why OOP is Bad Abner Coimbre on What Programming is Never About Scott Meyers on CPU Caches and Why You Care Jeff and Casey Show on The Evils of Non-native Programming Jeff and Casey’s Guide to Becoming a Bigger Programmer Hadi Hariri on The Silver Bullet Syndrome Bryan Cantrill on Fork Yeah! The Rise and Development if illumos Rob Pike on Concurrency Is Not Parallelism James Mickens on JavaScript Liz Rice on Containers From Scratch James Mickens on Why Do Keynote Speakers Keep Suggesting That Improving Security Is Possible? Terminal Terminal Text Effects visual effects applied to text in the terminal Testing Smocker simple HTTP mock server, uses YAML to define mocks and responses MockServer for any system you integrate with via HTTP or HTTPS MockServer can be used as: a mock configured to return specific responses for different requests, a proxy recording and optionally modifying requests and responses or as both a proxy for some requests and a mock for other requests at the same time Text, Encoding and Serialization The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) Illustrated jq tutorial jq is a lightweight and flexible command-line JSON processor Cap’n Proto Google Protocol Buffers TypeScript The Consise TypeScript Book Web HTML5 UP makes spiffy HTML5 site templates that are HTML5 + CSS3, customizable and 100% free under the Creative Commons How I built a modern website in 2021 Certbot automatically use Let’s Encrypt certificates Ask HN: Is There Still a Place for Native Desktop Apps? topngx parse and aggregrate statistics from NGINX access logs

April 2, 2017 · 10 min

Operational PGP

A practical guide about doing secure email the right way with PGP. I did not write this guide. Credits to the author grugq. Original source. In case this guide goes missing in the future, wanted to preserve it for my own future reference. Operational PGP This is a guide on how to email securely. There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level. ...

February 20, 2017 · 8 min