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.
As is often the case, this is written for the search engines, because when I tried to find a solution to this problem, I couldn't find one. (Perhaps that was because I wasn't searching with the right keywords, or perhaps I would have found the solution had I been more persistent.) I also understand that very few people will encounter this "problem" (read: require, or desire, this crazy advanced configuration).
Because services like GitHub and BitBucket require each user account to have unique SSH keys, if you have multiple accounts on those services, it's necessary to generate multiple SSH keys.
First, we'll generate the keys.
$ ssh-keygen -t rsa -f github-user1 # key for user1