Skip to content

Instantly share code, notes, and snippets.

@Rich700000000000
Rich700000000000 / upytdl.sh
Created January 1, 2019 22:54
Update Youtube-dl
sudo wget -4 https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
@Rich700000000000
Rich700000000000 / bashes.sh
Last active October 28, 2018 09:10
Bashes
#Youtube 1 : General
youtube-dl -4 --restrict-filenames --output "[%(uploader)s] %(title)s (%(id)s).%(ext)s"
#Youtube 2 : Music Videos
youtube-dl -4 -f bestvideo+bestaudio --restrict-filenames --add-metadata --output "%(title)s [%(uploader)s][%(upload_date)s][%(duration)s][%(id)s].%(ext)s"
#Programming 1 : Last file by extention
ls -t *py | head -1 | tr -d '\n' | xsel -ib
#Programming 2 : Last file by name
find -name "*06-27*" -printf "%f\n" | tr -d '\n' | xsel -ib
#Programming 3 : Las file by time
fc -ln -1 | xargs | tr -d '\n' | xsel -ib
def aBaR(n,e,f=None):
if f == None:
try:
print ("Array: {}\nType: {}\nShape: {}\nLength: {}\nFirst Data: {}\n".format(n,type(e),str(np.shape(e)),len(e),str(e[0])))
except IndexError:
print ("Array: {}\nType: {}\nShape: {}\nLength: {}\n".format(n,type(e),str(np.shape(e)),len(e)))
else:
print ("Array: {}\nType: {}\nShape: {}\nLength: {}\nData: {}\n".format(n,type(e),str(np.shape(e)),len(e),str(e)))
@Rich700000000000
Rich700000000000 / urlFromFile.py
Created September 26, 2016 07:54
urlFromFile - WIP
def
def getAccounts():
with open('./ig.txt') as f:
lines = f.read().splitlines()
return lines
def main():
accs = getAccounts()
@Rich700000000000
Rich700000000000 / termDivide.py
Created June 5, 2016 07:48
Makes a new section in the terminal.
def newSection():
def terminal_size():
import fcntl, termios, struct
h, w, hp, wp = struct.unpack('HHHH',
fcntl.ioctl(0, termios.TIOCGWINSZ,
struct.pack('HHHH', 0, 0, 0, 0)))
return w
ter_int = terminal_size()
print ("\n" + ("_" * (int(ter_int))) + "\n\n")