Skip to content

Instantly share code, notes, and snippets.

View JupyterJones's full-sized avatar

Jack Northrup JupyterJones

View GitHub Profile
@JupyterJones
JupyterJones / tubep.sh
Created March 15, 2019 11:38
Create custom prompts for screen captures
#!/bin/bash
# Bash Prompt Menu
PS3='Please enter your choice: '
options=("YouTube" "JupyterJones" "MyLinuxToyBox" "Philippines" "Date-Time" "Original" "Quit")
select opt in "${options[@]}"
do
case $opt in
"YouTube")
PS1="\[\e[41m\]YouTube\[\e[m\]Videos: \\$ "
break ;;
@JupyterJones
JupyterJones / randomcrop.py
Created April 8, 2019 23:23
randomly finds an image in a directory crops it and overlays it on a blank image
from PIL import Image
from random import randint
import randon
import os
def ol(filenamez,num):
body = Image.open(filenamez).convert("RGBA")
path = r"/home/jack/Desktop/Images/thegirls/IMGS/"
base_image = random.choice([
y for y in os.listdir(path) if y.endswith(".jpg") or y.endswith(".png")
@JupyterJones
JupyterJones / install-beef.sh
Created April 19, 2019 22:41
Script to install beef in Ubuntu 18.04
#!/bin/bash
sudo apt install ruby-full
git clone https://github.com/beefproject/beef
cd beef
# Inserts the line
#gem 'xmlrpc' in line 28
sed -i "28i gem 'xmlrpc'" Gemfile
@JupyterJones
JupyterJones / rotate-inc.sh
Created May 12, 2019 05:49
Rotate / spin an image and turn into am mp4 video
#!/bin/bash
# Create variable NUM starting at 0
NUM=0
# Create the directory images-spin if it does not exist
[ -d images-spin ] || mkdir images-spin
# Renove any *.png images that may exist in the directory
rm images-spin/*.png
# Create a loop of 360 ( $i for each degree of a circle )
for i in {1..360}; do
# if $i divided by input variable $1 equals 0 ( no remainer )
#!/bin/bash
# Bash Prompt Menu
PS3='Choose screen capture size: '
# PS3 means (Prompt String 3) a Shell prompts available for Linux.
# The PS3 prompt is useful in scripts that use the select command in order to select a value.
options=("FullScreen" "Terminal-1280x508" "1280x720" "Quit")
select opt in "${options[@]}"
do
case $opt in
"1280x720")
#!/bin/bash
# Bash Prompt Menu
PS3='Please enter your choice: '
options=("LBRY" "YouTube" "JupyterJones" "MyLinuxToyBox" "Philippines" "PWD" "Date-Time" "Time-PWD" "Quit")
select opt in "${options[@]}"
do
case $opt in
"LBRY")
PS1="\[\e[33;42m\] LBRY \[\e[m\]Terminal: \\$ "
break
ffmpeg -y -f alsa -ac 2 -i hw:1,0 -strict -2 -f x11grab -framerate 30 \
-video_size 1280x720 -i :0.0+0,36 \
-c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast \
-f flv rtmp://a.rtmp.youtube.com/live2/XXX-XXXX-XXXX-XXXX
@JupyterJones
JupyterJones / Draw-Covid-19-plot.py
Last active April 26, 2020 01:28
Draw-Covid-19-plot - state by state from current data Using https://github.com/CSSEGISandData/COVID-19 data
import random
from random import randint
import time
import markovify
import os
import sys
import sys
sys.path.insert(1, "/home/jack/hidden")
import Key
import twython
@JupyterJones
JupyterJones / FileSearch.py
Created April 29, 2020 02:03
Search a file for a word or exact term. Prints lines before and after the search term. Finds multiple occurances.
#!/usr/bin/env -m python
"""
Searches a file enter search term and filename
Range is to give context before and after the search term.
It defaults to eight lines before the word and eight lines after.
USAGE:
from FileSearch import filesearch
search ="urcrnrlat"
filename = "basemap.help"
filesearch(search,filename,Range=2)
@JupyterJones
JupyterJones / NormalizeData.py
Created May 29, 2020 00:30
Normalize - Ranges any span of numeric data in a list between 0-1
#!/usr/bin/python
'''
Ranges any span of numeric data in a list between 0-1
Usage:
from NormalizeData import *
DATA = [1,34,546,3985,857463,49495857]
NormalizeData(DATA)
>>> array([0.00000000e+00, 6.66722483e-07, 1.10110228e-05, 8.04915870e-05,
1.73239150e-02, 1.00000000e+00])
'''