print is zsh law layer command.
For example it probably build zle command behaviour.
If you master it you will get so beautifule zsh style.
Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.
With that out the way, let's begin.
| #! /usr/bin/env bash | |
| # Substitutes shell-like templates in input files. | |
| # | |
| # Usage: | |
| # template.sh [-x COMMAND] [-f FILE] [VAR=value]... | |
| # | |
| # Options: | |
| # -f FILE Read template from this file [default: -] | |
| # -x COMMAND Send output to this command [default: cat] |
| #!/bin/ash | |
| #ash shell for openwrt, it also works with bash | |
| #curl -s 192.168.44.1/logout | |
| rURL=`curl -s -I "http://192.168.44.1" | grep "Location:" | cut -d : -f 2- | cut -c 2-` | |
| if echo $rURL | grep -q "res=notyet"; then | |
| echo "notyet" | |
| challenge=`echo $rURL | cut -d '&' -f 4 | cut -d= -f2` | |
| echo "challenge=$challenge" |
| #!/usr/bin/env python | |
| import sys | |
| import re | |
| from subprocess import check_output, PIPE | |
| import pyflakes.api | |
| def git_file_content(fname): |
| #! /bin/zsh | |
| prefix=$HOME/.texdoc | |
| pkg=$1 | |
| doc=$(hrefbytext http://ctan.org/pkg/$pkg 'Pack­age doc­u­men­ta­tion') && | |
| mkdir -p $prefix | |
| cache=$prefix/$(basename $doc) && ( | |
| if [[ ! -e $cache ]]; then | |
| wget $doc -O $cache | |
| fi | |
| ) && |
| import numpy as np | |
| from timeit import timeit | |
| def timing(neg_ratio=0.5): | |
| a0 = np.random.uniform(0, 1, 20000000) - neg_ratio | |
| globals = { | |
| 'a0': a0, | |
| 'np': np, | |
| } |
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\Directory\Background\shell\mingw32] | |
| @="MinGW &32 Bash Here" | |
| "Icon"="\"C:\\msys64\\mingw32.exe\"" | |
| [HKEY_CLASSES_ROOT\Directory\Background\shell\mingw64] | |
| @="MinGW &64 Bash Here" | |
| "Icon"="\"C:\\msys64\\mingw64.exe\"" |
| #! /usr/bin/zsh | |
| if [[ $# = 0 ]]; then | |
| echo "Usage: $0 PID [INTERVAL]" | |
| exit | |
| fi | |
| pid=$1 | |
| pgid=$(ps -o pgid= $pid) |