date -u "+[%Y-%m-%d %H:%M:%S%z (%Z)]" # Space separated with tz abbreviation
[2013-07-31 23:56:34+0000 (UTC)]
date -u "+[%Y-%m-%d %H:%M:%S.%N %z (%Z)]" # Space separated with nanoseconds and tz abbreviation
[2013-07-31 23:56:34.812572000 +0000 (UTC)]
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
| brew install qemu vagrant | |
| vagrant plugin install vagrant-qemu | |
| vagrant init -m perk/debian-11-genericcloud-arm64 | |
| vagrant up provider qemu | |
| vagrant ssh |
no need to install the docker-desktop package
- We assume you have installed
limawithbrewbrew install lima
- Download docker template
mkdir -p ${HOME}/.lima/docker
Check here format and escaping in jq https://jqlang.github.io/jq/manual/v1.5/#format-strings-and-escaping
system_profiler SPApplicationsDataType -json | jq -r '."SPApplicationsDataType" | .[] | [ ."_name",."version" ] | @tsv '
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 | |
| set -e | |
| # OSX is not a Linux! But bash works on both ;-) | |
| if [ $(uname -s) != "Darwin" ]; then | |
| echo "** I know you should run this on a Mac :) But it's a bash, so you can adapt it on your risk! **" | |
| exit 1 | |
| fi | |
| # check if it's a git repo |
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 | |
| do_hash(){ | |
| [ -f shasum.txt ] && mv -fv shasum.txt shasum_$(date +%s).txt | |
| shasum -a 256 * | tee -a shasum.txt && \ | |
| awk '{print $1}' shasum.txt | sort | uniq > shasum_hash.txt | |
| } | |
| do_move(){ | |
| [ -z "$1" -o $# -eq 0 ] && return 1 | |
| SRC=$(pwd); DST=$1; | |
| comm -23 ${SRC}/shasum_hash.txt ${DST}/shasum_hash.txt | while read hash; do FILE=$(grep ^$hash ${SRC}/shasum.txt | awk '{print $2}'|head -1); [ ! -f ${SRC}/$FILE ] && continue; mv -v ${SRC}/$FILE ${DST}/new-$(echo $hash | head -c12).${FILE#*.} && sed -I_bak "/^$hash/d" ${SRC}/shasum.txt; done |
NewerOlder