187 private links
The advantage of
#!/usr/bin/env bash
is that it will use whatever bash executable appears first in the running user’s $PATH variable.
Ban some words: beholder words, lazy words, salt and pepper words (meaning nothing) and generic adverbs.
The passive voice hides information. We want however to convey concise and efficient information in a technical paper. The writings should avoid the passive voice.
Given the volume of submissions to top peer-reviewed venues, there will always be more than enough technically correct papers to fill the venue. The function of peer review has become to decide which true things are worth knowing. In that sense, peer reviewers are the guardians of the scientific community's most limited resource: our collective attention span. To market a paper, the author must make a compelling case for why her idea deserves access to that resource.
A language that compiles to bash
Idea : rewrite it as a rust command :)
That's great to have such simple deployment. Maybe one for rust with such a script or command could be great too.
Or a bash script :)
Because of modularity
How to launch a program without network access?
firejail --noprofile --net=none <program-name>
4kB en Assembleur, ou quelques octets pour les builtins de l'OS
mkdir -p
instead of mkdir
ln -sfn source target
instead of ln -s source target
rm -f example.txt
instead of rm example.txt
Modifying a file
if ! grep -qF "/mnt/dev" /etc/fstab; then
echo "/dev/sda1 /mnt/dev ext4 defaults 0 0" | sudo tee -a /etc/fstab
fi
Check if variable, file or dir exists
formatting a device
mounting a device
touch {hero,lightbox,form,another-component}.njk
Only one same job at a time ?
My solution to deal with this is to bind an IPv6 localhost ::1 socket to a given port. Only one process can do this, and thus it’s a very effective mutex. No lock files to cause havoc, no dealing with the dark and buggy corners of advisory file locking.
For shell scripts, simply replace the #!/bin/sh with #!/somewhere/bin/lock 2048 where 2048 is the port number you will use to enforce the lock (greater than 1024 if you do not want to deal with the hassles of privileged ports).
Using the tool jc to convert the output of a command to JSON.
Takeaways:
- It is possible to list a directory with 8 million files in it.
- strace is your friend
- Don't be afraid to compile code and modify it (hell, simple C compiles so fast it could be interpreted)
- There is no good reason to have 8 million files in a directory :-), but this was a good learning experience (and possibly a good interview question).
The last point is the most important :D
$'$HOME'
expands escape sequences like \n or \'
Do one thing per command and one only. Everything will be fine.
Amend a commit message by ID. A simple script.