Skip to content

Instantly share code, notes, and snippets.

View alephalpha0's full-sized avatar
💫
Learning bash scripting ⌨️ and python🐍. Thanks O'reilly!

alephalpha0 alephalpha0

💫
Learning bash scripting ⌨️ and python🐍. Thanks O'reilly!
View GitHub Profile
@alephalpha0
alephalpha0 / soc-20220309112841.md
Created March 9, 2022 17:41
stream of consciousness
creation author categories tags
2022-03-09 03:28:41 -0800
mdk3
SoC
stream of consciousness
commandline gazing
terminal blues

This SoC is mainly created so I could use the hub command to push a gist to GitHub. This would give me a lazy way to get onto GitHub, via the generated by hub link to the gist, without actually alt-tabing to FireFox.. All so I can search for some little whirly gig application that has now completely slipped from my memory.

...

Keybase proof

I hereby claim:

  • I am alephalpha0 on github.
  • I am alephalpha0 (https://keybase.io/alephalpha0) on keybase.
  • I have a public key ASAE7L4nzWs71iicjqNTZtwd8ZLDErWfiQoGbLUHxSuLVgo

To claim this, I am signing this object:

@alephalpha0
alephalpha0 / Figlet.md
Created February 20, 2021 10:22
Reference for when I wanna make banner text on the command line

http://www.figlet.org/fontdb.cgi

figlet -f ascii12 ...

                                                                      
           mmmm                          mm                  mmmm     
           ""##                          ##                  ""##     
  m#####m    ##       m####m   ##m###m   ##m####m   m#####m    ##     
  " mmm##    ##      ##mmmm##  ##"  "##  ##"   ##   " mmm##    ##     
@alephalpha0
alephalpha0 / buildingAPipeline_01.md
Last active November 10, 2020 21:39
First entry in a series on my first true bash script, one with a purpose.

Building a cli program flow in order to archive a single webpage or article.

The problem to be solved:

I have a desire to be able to, through the command line, download a single webpage into a self-contained .html file with the option to convert it to (or save alongside) other formats such as PDF, EPUB, or even md if possible. There are two main use-cases I want to offer: 1) get the entire webpage, strip out the ads/useless shit, and save the new version locally & 2) for journal/website articles, blog entries, or tutorials: simply save the main content and discard every other element from the source.

The inital idea for solution:

A bash script that takes in a URL and, through menu redirection, outputs the desired file(s) into a standard directory.

Why not use currently available methods:

I've come across quite a few programs and scripts that seem like they would be perfect for what I want to do, but unfortunately I'm using termux on an Android and most of them do not work

@alephalpha0
alephalpha0 / aa0FileHeaderv2.txt
Created November 6, 2020 18:46
File header currently in use for bash scripts NOV2020 v2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# SCRIPT_NAME_FULL || CUTE_TAG_LINE
# created:202X-XX-XX || modified:202X-XX-XX #
# product of alephalpha0's mind //// A ROOTOFPI PRODUCTION #
# http://github.com/alephalpha0 http://rootofpi.me #
######################### ###########################
################## ####################
# Many thanks to those who have shared and discussed their #
# dotfiles/source code/scripts on blogs, stackoverflow, #
# dev.to, gitlab / github, and any open forum for ideas on #
@alephalpha0
alephalpha0 / aa0FileHeaderv1.txt
Last active November 6, 2020 18:42
personal file header {license & warranty free} OCT 2020 - v1
##################################################
## alephalpha0 | [Purpose] [Witty tag line] ##
## created:YYYY-MM-DD | modified:YYYY-MM-DD ##
##----------------------------------------------##
## https://github.com/alephalpha0 ##
#################### ###################
############# #############
## Many thanks to those who have shared and ##
## discussed their dotfiles/source code/scripts ##
## on blogs, stackoverflow, dev.to, gitlab / ##
@alephalpha0
alephalpha0 / imgManip.md
Created October 26, 2020 21:56
Im messing about with images on terminal. This is just for future reference.

Using ImageMagick via CLI is esoteric but some google-fu sorted me out.

convert (originalfile) -resize ##% (outputfile) will resize an image by the percentage given. Better than using -scale as it keeps the image quality up. Replace ##% with HxW to make the image resize into dimensions that best fit H or W. eg, a 1024x768 original ran through -resize 80x80 will have width of 80 and height within ratio.

Converting from one imgage type to the next is simple as well. convert png myjpeg.jpg will convert myjpeg.jpg into a png.

Using jp2a as a neat tool to output images via ascii and ansi color codes into the terminal is fun and entertaining, but fleeting.

If I want to save the output for future use and display, I have two options. The first outputs html via jp2a . jp2a --zoom-term --colors --html (originalfile) > newfile.html will put the HTML output from jp2a into an html file. If, instead, I want to save the ansi codes and ascii decorations without formatting into html,

@alephalpha0
alephalpha0 / Ascii_Finger.md
Created October 26, 2020 02:10
Only ASCII art I'll ever need.
....................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
.........\.................'...../
..........''...\.......... _.·´
............\..............(
@alephalpha0
alephalpha0 / ffmpegForAudioConversion.md
Created October 15, 2020 09:28
the command line method to convert one audio type to the other

Requirements:

  • ffmpeg
  • libmp3lame

Variables for ref:

  • SRC = source file.
  • codec = libmp3lame IF conversion to mp3. codec = libvorbis IF conversion to ogg.

  • BKB = bitrate kilobytes.
  • OUTPUT = output file.
@alephalpha0
alephalpha0 / gist:38fda022ef652f8ff569c49479b40b79
Created September 3, 2020 14:34
Fluffing about; ZSH prompt
#### IN JUST 7 DAYS, HONEY, I CAN MAKE YOU A PROMPT
##
autoload -Uz promptinit ; promptinit
setopt PROMPT_SUBST
setopt PROMPT_PERCENT
PROMPT="[%~] %0 :: %DT%*
༼==_⁰⁰o> "