136 private links
A nice feature I’ve become used to in the last year is a so-called “smart directory changer” that keeps track of the directories you change into, and then lets you jump to popular ones quickly, using fragments of the path to find the right location.
There is quite some prior art in this, such as autojump, fasd or z, but I could not resist building my own implementation of it, optimized for zsh.
For bureaucratic reasons, a colleague of mine had to print, sign, scan and send by email a high number of pages. To save trees, ink, time, and to stick it to the bureaucrats, I wrote this script.
An IT-etymology/linuxguistics page for people wondering "how come the package yasysmand-cling has such a strange name?"
Giving cryptic names to software is a well-established UNIX tradition, and the explanations are often missing from the documentation, either because the developers imagine it's obvious (usually wrongly) or because they think nobody cares (and here they're usually right, or it would turn up as FAQ material).
After RTFM’ing, I realized, under the hood, systemd just runs mount command to mount the specified partition with the specified mount options listed in the mount unit file. Basically, you need to specify the following options in your unit file:
What= a partition name, path or UUID to mount
Where= an absolute path of a directory i.e. path to a mount point. If the mount point is non-existent, it will be created
Type= file system type. In most cases mount command auto-detects the file system
Options= Mount options to use when mounting
In the end, you can convert your typical fstab entry such as this:
UUID=86fef3b2-bdc9-47fa-bbb1-4e528a89d222 /mnt/backups ext4 defaults 0 0
to:
[Mount]
What=/dev/disk/by-uuid/86fef3b2-bdc9-47fa-bbb1-4e528a89d222
Where=/mnt/backups
Type=ext4
Options=defaults
A gentle admonishment to use shell scripts where appropriate accept that shell scripts will appear in your codebases and to lean heavily on automated tools, modern features, safety rails, and best practices whenever possible.
You stuffed command shell with aliases, tools and colors but you lose it all when using ssh. The mission of xxh is to bring your favorite shell wherever you go through ssh without root access and system installations.
If you like the idea of xxh click star on the repo and tweet now.
Blazing fast terminal client for git written in Rust
Features
Fast and intuitive keyboard only control
Context based help (no need to memorize tons of hot-keys)
Inspect, commit, and amend changes (incl. hooks: commit-msg/post-commit)
Stage, unstage, revert and reset files and hunks
Stashing (save, apply, drop, and inspect)
Push to remote
Branch List (create, rename, delete)
Browse commit log, diff committed changes
Scalable terminal UI layout
Async input polling
Async git API for fluid control
Map lets you process each line from stdin with a command of your choice. For example:
Note that the command must be wrapped in single quotes to prevent the variable from being expanded by the shell.
There are many ways to accomplish what you can do with map, including find, xargs, awk, and shell for-loops. The approach taken by map is extremely pragmatic and allows me to express concisely what I want. Given the fact that it's designed as a filter, it can operate on any kind of list, not only lists of files.
The problem that prompted me to think about map was the following: given a list of files, I wanted to execute two commands on each. Here's how you can do it with different tools:
This article will teach you how to create and use these five types of aliases:
Simple Aliases
Suffix Aliases
Functions for Aliases With Parameters
Global Aliases
Operating system specific aliases
Easy to use and install.
Multiple cursors.
Common keybindings (Ctrl-s, Ctrl-c, Ctrl-v, Ctrl-z, …).
Sane defaults.
Splits and tabs.
Extremely good mouse support.
Cross-platform (it should work on all the platforms Go runs on).
Plugin system (plugins are written in Lua).
Built-in diff gutter.
Simple autocompletion.
Persistent undo.
Automatic linting and error notifications.
Syntax highlighting for over 130 languages.
Color scheme support.
True color support (set the MICRO_TRUECOLOR environment variable to 1 to enable it).
Copy and paste with the system clipboard.
Small and simple.
Easily configurable.
Macros.
Common editor features such as undo/redo, line numbers, Unicode support, soft wrapping, …
With DB you can very easily save, restore, and archive snapshots of your database from the command line. It supports connecting to different database servers (for example a local development server and a staging or production server) and allows you to load a database dump from one environment into another environment.
For now, this is for MySQL only, but it could be extended to be used with other database systems as well.
The Unix philosophy lays emphasis on building software that is simple and extensible. Each piece of software must do one thing and do it well. And that software should be able to work with other programs through a common interface – a text stream. This is one of the core philosophies of Unix which makes it so powerful and intuitive to use.
In this post though, I would like to show some examples of this philosophy in action – of how one can use different unix tools together to accomplish something powerful.
In short: modern Linux systems (since Linux 2.6.30, released in 2009) already use relatime, which should give you a really fast performance boost. That means you don't need to tweak your /etc/fstab file and can rely on the relatime kernel default.
But if you're looking to tweak your system to get maximum performance, disabling atime is still a valid option in 2020.
This performance tweak might not be very noticeable on very fast modern drives (like NVME or a fast SSD), but there's still a little boost there.
Awk crunches massive data; a High Performance Computing (HPC) script calls hundreds of Awk concurrently. Fast and scalable in-memory solution on a fat machine.
This looks like an interesting vim
plugin: it gives you tips, as you type,
on how to improve/shorten the actions you're doing. It's like the Clippy
helper on Windows, but actually useful!
This post shares some ideas about working with cronjobs, to help make common tasks more easy for both junior and senior sysadmins.
This is choose, a human-friendly and fast alternative to cut and (sometimes) awk
Features
terse field selection syntax similar to Python's list slices
negative indexing from end of line
optional start/end index
zero-indexed
reverse ranges
slightly faster than cut for sufficiently long inputs, much faster than awk
regular expression field separators using Rust's regex syntax
Rationale
The AWK programming language is designed for text processing and is extremely capable in this endeavor. However, the awk command is not ideal for rapid shell use, with its requisite quoting of a line wrapped in curly braces, even for the simplest of programs:
awk '{print $1}'
Likewise, cut is far from ideal for rapid shell use, because of its confusing syntax. Field separators and ranges are just plain difficult to get right on the first try.
It is for these reasons that I present to you choose. It is not meant to be a drop-in or complete replacement for either of the aforementioned tools, but rather a simple and intuitive tool to reach for when the basics of awk or cut will do, but the overhead of getting them to behave should not be necessary.
This is not a fork. This is a repository of scripts to automatically build Microsoft's vscode repository into freely-licensed binaries with a community-driven default configuration.
This tool is a rewrite of ngxtop to make it easier to install and hopefully run faster. For those unfamiliar with the ngxtop, it is a tool that helps you parse NGINX access logs and print various statistics from them regardless of format. It is currently not as feature complete as the original version but it should have enough functionality to be usable.
Whatfiles is a Linux utility that logs what files another program reads/writes/creates/deletes on your system. It traces any new processes and threads that are created by the targeted process as well.
Rationale:
I've long been frustrated at the lack of a simple utility to see which files a process touches from main() to exit. Whether you don't trust a software vendor or are concerned about malware, it's important to be able to know what a program or installer does to your system. lsof only observes a moment in time and strace is large and somewhat complicated.