Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| urlencode() { | |
| # urlencode <string> | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:$i:1}" | |
| case $c in |
| ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000[Updated in 02/2020 - SDK 12.3.0]
| # UDEV Rules for Black Magic Probe (STM32 Blue Pill) | |
| # copy this file to /etc/udev/rules.d/50-black-magic-blue-pill.rules | |
| # reload rules: | |
| # $ sudo udevadm control --reload-rules && sudo udevadm trigger | |
| SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6018", GROUP="plugdev", MODE="0666" |
| #!/usr/bin/env bash | |
| # Get the command from arguments | |
| arg_str="$*" | |
| $arg_str & | |
| pid="$!" | |
| # Wait for the window to open and grab its window ID | |
| winid='' | |
| while : ; do |
Update: I created jq-zsh-plugin that does this.
One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).
Another one of my favourite tools is fzf.