Changes with .dev
domains in
mind.
Step 1 : Assign at least two IP address to your MAC OS (one per domain), let's say :
192.168.0.51
192.168.0.52
To setup the second IP you will have to add a second Ethernet Adapter (logical not physical).
Changes with .dev
domains in
mind.
Step 1 : Assign at least two IP address to your MAC OS (one per domain), let's say :
192.168.0.51
192.168.0.52
To setup the second IP you will have to add a second Ethernet Adapter (logical not physical).
#!python3 | |
''' | |
Directions: | |
- install yt-dlp via Pip (e.g. using (StaSh)[https://github.com/ywangd/stash] - `pip install yt-dlp`) | |
- add this script as a Share extension through Settings -> Share Extension Shortcuts | |
- while watching a video in the YouTube site or app, just share the video to Pythonista and select this script | |
- the video will download, and when it's done you can share the video file itself with any app (e.g. VLC) | |
Advanced usage: |
An example is | |
Code: | |
echo "\033[1;31m Hello \033[0m" | |
The '31' and the '1' are the things you change. The '31' is the color code, and the '1' is where you put whatever you want to color. The rest of it is the same for every color coding; the beginning starts coloring, and the stuff afterwards stops coloring ('0' switches it back to default text color). You can use the following color codes: | |
Code: | |
30 - black |
#Capture and stream a webcam To capture using the iSight camera on a Mac, or infact any other webcam connected to the Mac, we can use FFmpeg. First get a list of the devices installed.
ffmpeg -f avfoundation -list_devices true -i ""
This will list the aviable video and audio devices.
The below will capture at 30fps and the set video size to a file.
ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" out.avi
#!/bin/bash | |
# shellcheck disable=1090,1091,2059 | |
# set ENV default value to 'dev'' | |
ENV="${1:-dev}" | |
# import (source) utility variables and functions | |
. "$DIR/bootstrap/utils" | |
# Terminal output to illustrate progress |
#!/usr/bin/env bash | |
f='/path/to/example.txt' | |
base="${f##*/}" | |
echo $base | |
#=> example.txt | |
echo "${base%.*}" |
Using Homebrew on Mac OS X:
brew install jq
Add these aliases to your profile (e.g., ~/.zshrc
, ~/.bashrc
, ~/.profile
, etc.):
alias hurlp='pbpaste | jq ".log.entries" | tee >(jq --raw-output "[.[] | .request.url] | sort | unique | .[]")'
alias hurld='pbpaste | jq ".log.entries" | jq --raw-output "[.[] | .request.url] | sort | unique | .[]" | harurls | tee >(xargs -n 1 curl -O $1)'
#!/usr/bin/env zsh | |
f='example.txt' | |
echo ${f:r} | |
#=> example | |
echo ${f:e} | |
#=> txt |