https://serverfault.com/questions/617398/is-there-a-way-to-see-the-execution-tree-of-systemd
On NixOS:
> systemctl get-default
multi-user.target
| <?php | |
| $t = ''; | |
| $before = microtime(true); | |
| for ($i=0 ; $i<100000 ; $i++) { | |
| $dummy = empty( $t ); | |
| } |
| #!/bin/bash | |
| ############################---Usage---######################################### | |
| #source this function in your bashrc | |
| # Copy below functions (delay and progress fuctions) into your shell script directly | |
| # Then invoke progress function to show progress bar | |
| # In other way, you could import source indirectly then using. Nothing different |
| #!/usr/bin/env sh | |
| # arguments | |
| name="${1}" | |
| src="${2}" | |
| dest_dir="$(dirname "${3}/gets_removed")" | |
| # validate arguments | |
| if [ -z "${name}" ]; then | |
| echo "Invalid backup name (first argument)" |
| #!/usr/bin/env bash | |
| # Strict mode (see: http://redsymbol.net/articles/unofficial-bash-strict-mode/). | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # We name the repository directory after the system's hostname and the current | |
| # year/month. We include the year/month combo so our backup repository doesn't | |
| # continue to grow forever, and we can manually delete old ones as necessary. | |
| name="$(hostname)" |
| <?php | |
| // For laravel 5 based systems | |
| // /path/to/project/app/Console/Commands/AllowSSHFromIP.php | |
| namespace App\Console\Commands; | |
| use Aws\Ec2\Ec2Client; | |
| use Carbon\Carbon; | |
| use Illuminate\Console\Command; |
https://serverfault.com/questions/617398/is-there-a-way-to-see-the-execution-tree-of-systemd
On NixOS:
> systemctl get-default
multi-user.target
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
| #!/usr/bin/env bash | |
| set -o pipefail | |
| slow_compute_hash() { | |
| find "$1" -type f -exec md5sum {} \; | sort -k 2 | md5sum | |
| } | |
| fast_compute_hash() { | |
| find "$1" -type f -print0 | sort -z | xargs -0 md5sum | md5sum | |
| } |
| //this makes a 8gb RAM DISK | |
| diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://16384000` |