ls /var/cache/pacman/pkg/ | wc -l
# 13886
du -sh /var/cache/pacman/pkg/
# 61G /var/cache/pacman/pkg/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function slugify (text: string, separator = "-", ampersand = "and") { | |
const a = "àáäâèéëêìíïîòóöôùúüûñçßÿỳýœæŕśńṕẃǵǹḿǘẍźḧ" | |
const b = "aaaaeeeeiiiioooouuuuncsyyyoarsnpwgnmuxzh" | |
const p = new RegExp(a.split("").join("|"), "g") | |
return text.toString().toLowerCase() | |
// Replace whitespaces and underscores with single hyphens | |
.replace(/[\s_]+/g, separator) | |
// Replace special chars | |
.replace(p, (c) => b.charAt(a.indexOf(c))) |
Following command will get just the name of the first Docker service running (usually the last one deployed) of a list of N services with running/shutdown/etc status.
Format name: service_name.N.ID
docker service ps my_service_name \
--no-trunc --format="{{.Name}}.{{.ID}}/{{.DesiredState}}" | grep "Running" | cut -f1 -d "/" | head -n1
# my_service_name.1.abcd1v23ui456pyu7lx8k9fze
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
telegraf: | |
image: telegraf:1.14-alpine | |
environment: | |
HOST_ETC: /hostfs/etc | |
HOST_PROC: /hostfs/proc | |
HOST_SYS: /hostfs/sys | |
HOST_MOUNT_PREFIX: /hostfs | |
volumes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is an opinioned benchmark that I have made for testing some Rust web frameworks focus on static-file serving feature using the minimal code that every framework provides. | |
Yes! This can vary per use case and is just another "benchmark". | |
------------------------------------- | |
OS: Arch Linux | |
Kernel: Linux 5.6.2-arch1-2 x86_64 | |
------ | |
$ rustc -vV | |
rustc 1.42.0 (b8cedc004 2020-03-09) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Emit a warning when Emacs version is not greater or equal to 24.1 | |
(when (and (<= emacs-major-version 24) (< emacs-minor-version 1)) | |
(warn (format "\ | |
Emacs v%s.%s is not supported for this configuration. Try to upgrade to v24.1+." emacs-major-version emacs-minor-version))) | |
;; Continue installing MELPA packages etc... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set -u | |
if [ -f .env ]; then | |
export $(cat .env | xargs) | |
else | |
echo ".env file not found" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For customize the writeout take a look at https://ec.haxx.se/usingcurl/usingcurl-verbose/usingcurl-writeout | |
curl -Skw "\ | |
CURL download file testing\n\ | |
==========================\n\ | |
URL: %{url_effective}\n\ | |
Response code: %{response_code}\n\ | |
Download size: %{size_download}B\n\ |