Just use uv to run yt-dlp (the new version of youtube-dl):
>> uv run --with yt-dlp -k --with node \
yt-dlp --js-runtimes node --remote-components ejs:github \
https://www.youtube.com/watch\?v\=y3vV-yvMfF0
Just use uv to run yt-dlp (the new version of youtube-dl):
>> uv run --with yt-dlp -k --with node \
yt-dlp --js-runtimes node --remote-components ejs:github \
https://www.youtube.com/watch\?v\=y3vV-yvMfF0
> pandoc -C -s main.tex --natbib -o main.docx
this will produce a document with citations using the (Author, year) format, to produce citations with a numeric format download the ieee.csl file and call:
> pandoc -C -s main.tex --natbib --csl=ieee.csl -o main.docx
#!/bin/bash #title :socksProxySSH.sh #description :initiates SSH dynamic port forwarding and sets up # the network proxy settings for you #author :Gabriele Facciolo (http://linuxtoosx.blogspot.com/) #date :20130615 #version :1.0 #OSX version :Tested on OSX 10.6.8 #usage :socksProxySSH.sh [remoteHost [localPort (default:1080)]] DEFAULTSSHHOST="" DEFAULTLOCALSOCKSPORT=1080 # DEAL WITH COMMAND LINE PARAMETERS if [ "${1}" != "" ] then SSHHOST=$1 else SSHHOST=$DEFAULTSSHHOST fi if [ "${2}" != "" ] then LOCALSOCKSPORT=$2 else LOCALSOCKSPORT=$DEFAULTLOCALSOCKSPORT fi # SORRY NO SSHHOST if [ "${SSHHOST}" == "" ] then echo "${0}: initiates SSH dynamic port forwarding and " echo "sets up the network proxy settings for you." echo "" echo " Usage: ${0} [remoteHost [localPort(default:1080)]]" echo "" echo "Indicate a remoteHost, or set the DEFAULTSSHHOST variable" exit 1 fi # ENABLE SOCKS ON ACTIVE INTERFACES networksetup -listallnetworkservices | grep -v asterisk | while read line ; do t=`networksetup -getinfo "$line" | grep "IP address" | grep -v none` if [ "$t" ]; then tt=`networksetup -getsocksfirewallproxy "$line" | grep -v Authenticated | grep "Enabled: No"` if [ "$tt" ]; then echo Enabling SOCKS on $line networksetup -setsocksfirewallproxy "$line" localhost $LOCALSOCKSPORT fi fi done # OPEN CONNECTION AND INITIATE SOCKS SERVER echo "" echo "INITIATING SSH CONNECTION AND SOCKS SERVER..." echo "=========================================================" echo "TO DISCONNECT FIRST HIT Ctrl-D, WAIT A SECOND THEN Ctrl-C" echo "=========================================================" echo "" ssh -C -D *:$LOCALSOCKSPORT $SSHHOST # DISABLE SOCKS ON ACTIVE INTERFACES networksetup -listallnetworkservices | grep -v asterisk | while read line ; do t=`networksetup -getinfo "$line" | grep "IP address" | grep -v none` if [ "$t" ]; then tt=`networksetup -getsocksfirewallproxy "$line" | grep -v Authenticated | grep "Enabled: Yes"` if [ "$tt" ]; then echo Disabling SOCKS on $line networksetup -setsocksfirewallproxystate "$line" off fi fi done
Seems that jot is the replacement (and is more powerful) but has a different syntax.
Derived from:
http://codesnippets.joyent.com/posts/show/1797
http://www.labrat.info/blog/?p=9
Add this function to your ~/.bash_profile
to rewrite your simple seq calls as jot.
# integer test
function is_int() { return $(test "$@" -eq "$@" >/dev/null 2>&1); }
function seq() {
declare incr n1 n2 num1 num2
if [[ $# -eq 1 ]]; then
if ! $(is_int "$1"); then echo 'No integer!'; return 1; fi
for ((i=1; i<=${1}; i++)) { printf "%d\n" ${i}; }
elif [[ $# -eq 2 ]]; then
if ! $(is_int "$1") || ! $(is_int "$2"); then echo 'Not all arguments are integers!'; return 1; fi
if [[ $1 -eq $2 ]]; then
echo $1
elif [[ $2 -gt $1 ]]; then
for ((i=${1}; i<=${2}; i++)) { printf "%d\n" ${i}; }
elif [[ $1 -gt $2 ]]; then
for ((i=${1}; i>=${2}; i--)) { printf "%d\n" ${i}; }
fi
elif [[ $# -eq 3 ]]; then
num1=${1}
incr=${2}
num2=${3}
#/usr/bin/awk -v n1=${num1} -v n2=${num2} -v add=${incr} 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed 's/.+e.+/0/'
/usr/bin/awk -v n1=${num1} -v n2=${num2} -v add=${incr} 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed -E '/e/s/^.+e.+$/0/'
fi
return 0
}
-------------------------------------------------------------------------------------
UPDATED VERSION
-------------------------------------------------------------------------------------
function seq() {
# rewrites seq as jot for osx with format support.
# Updated version by G. Facciolo
if [ $# -gt 0 ]
then
if [ $1 == "-f" ]
then # with format parameters start from 3
format=$2
case $# in
3) # single argument
jot -w $format $3
return 0;
;;
4) # double argument
let nr="2*($4-$3)"
jot -w $format $nr $3 $4 1
return 0;
;;
5) # triple argument
let nr="2*($5-$3)/$4";
jot -w $format $nr $3 $5 $4
return 0;
;;
esac
else # without format parameters start from 1
format=""
case $# in
1) # single argument
jot $1
return 0;
;;
2) # double argument
let nr="2*($2-$1)";
jot $nr $1 $2 1
return 0;
;;
3) # triple argument
let nr="2*($3-$1)/$2";
jot $nr $1 $3 $2
return 0;
;;
esac
fi
else
echo "seq to jot for osx by G. Facciolo"
echo "Usage: seq [-f format] LAST"
echo " or: seq [-f format] FIRST LAST"
echo " or: seq [-f format] FIRST INCREMENT LAST"
return 1;
fi
}
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Edit
~/.bash_profile
and add the following two lines:
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
The new ls command does not use the same old --color=auto argument. If you want to set up the color labeling again, put the following in your ~/.tcshrc file (if you are using tcsh as your default shell):
setenv TERM "xterm-color"
setenv CLICOLOR "true"
setenv LSCOLORS "exfxcxdxbxegedabagacad"
The TERM variable can be set in the Terminal Preferences also, but it won't turn on the color labeling until you add at least the CLICOLOR variable to your .tcshrc file.
Read the rest of the hint for more on color definitions.
The colors can be set with the LSCOLORS variable. The color designators are as follows:
a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background
Note that the above are standard ANSI colors. The actual display may differ depending on the color capabilities of the terminal in use. The order of the attributes in the LSCOLORS variable is as follows:
They are set in pairs, foreground (f) then background (b), i.e. fbfbfbfbfbfbfbfbfbfbfb for all 11 settings. The default is exfxcxdxbxegedabagacad, i.e. blue foreground and default background for regular directories, black foreground and red background for setuid executables, etc.