Skip to content

Instantly share code, notes, and snippets.

View jazlopez's full-sized avatar
🏠

Jaziel Lopez jazlopez

🏠
  • Thermo Fisher Scientific
  • Tijuana, MX
View GitHub Profile
@jazlopez
jazlopez / demo.triggers.mysql.archived.sql
Created May 3, 2023 00:09
Demo Triggers Database [Archived]
DROP TRIGGER IF EXISTS db_enrollments.on_insert_transaction_creates_event;
DROP TRIGGER IF EXISTS db_enrollments.on_udate_transaction_record_event_transitions;
DROP TABLE IF EXISTS events;
DROP TABLE IF EXISTS transacts;
CREATE TABLE transacts (
transact_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
transact_status ENUM("CREATED", "IN_MEM", "RELEASE_MEM", "PROC_STALL", "OK", "FAILED") DEFAULT "CREATED",
transact_data TEXT NULL,
transact_deleted TINYINT NOT NULL DEFAULT 0, -- soft delete (retain transact status information to easy rollback)
@jazlopez
jazlopez / menu.from.command.sh
Last active February 26, 2023 08:51
menu arrow down up selection bash
awsprofiles(){
grep -Eo "\[.*\]" $HOME/.aws/credentials | sed 's/[][]//g' | nl
}
prompt_goto(){
local mopts=$1
tput cup $mopts 1
echo "Go to: "
tput cup $mopts 8
}
@jazlopez
jazlopez / yt-loop.sh
Created February 25, 2023 01:39
yt-dlp in loop bash script
__URL__=""
while :
do
printf "${GREEN_FG}"
printf "╭─ \n"
printf "│ URL: \n"
printf "╰─○ \n"
tput cuu 2
@jazlopez
jazlopez / .curlrc
Created January 8, 2023 08:10
.curlrc simple practical configuration
# ---------------------------------------------
# Custom Configurations for CURL
# Usage instructions:
# Download this file and save it at: $HOME/.curlrc
# Contact: Jaziel Lopez Software Engineer Tijuana Area, BC MX
# store the trace in curl_trace.txt file. beware that multiple executions of the curl command will overwrite this file
# --trace curl_trace.txt
# store the header info in curl_headers.txt file. beware that multiple executions of the curl command will overwrite this file
@jazlopez
jazlopez / I-exploring.linux.command.tools.exam.essentials.md
Created January 6, 2023 09:35
Chapter 1 Exploring Linux Command-Line Tools Exam Essentials

Exploring Linux Command-Line Tools


Summarize features that Linux shells offer to speed up command entry.

The command history often enables you to retrieve an earlier command that’s similar or identical to the one you want to enter. Tab completion reduces typing effort by letting the shell finish long command names or filenames. Command-line editing lets you edit a retrieved command or change a typo before committing the command.

Describe the purpose of the man command.

The man command displays the manual page for the keyword (command, filename, system call, or other feature) that you type. This documentation provides succinct summary information that’s useful as a reference to learn about exact command options or features.

@jazlopez
jazlopez / new.finder.window.scpt
Created January 5, 2023 07:19
Applescript Create New Finder Window
tell application "Finder" to make new Finder window
@jazlopez
jazlopez / set.path.finder.to.home.scpt
Created January 5, 2023 07:14
Applescript set finder window path to home
tell application "Finder" to set the target of the front Finder window to home
@jazlopez
jazlopez / get.path.finder.windown.scpt
Created January 5, 2023 07:12
Applescript to get path of current finder window
tell application "Finder" to get the target of the front Finder window
@jazlopez
jazlopez / applescript.ls.from.installed.path.scpt
Created January 5, 2023 02:01
Apple script to list files in the current installed application path
tell application "Finder"
set currentDir to (target of front Finder window) as text
end tell
do shell script "cd " & (quoted form of POSIX path of currentDir) & "; ls"
@jazlopez
jazlopez / htpasswd-ssl.sh
Created December 31, 2022 19:42 — forked from samba/htpasswd-ssl.sh
htpasswd replacement with openssl
#!/bin/sh
# Writes an APR1-format password hash to the provided <htpasswd-file> for a provided <username>
# This is useful where an alternative web server (e.g. nginx) supports APR1 but no `htpasswd` is installed.
# The APR1 format provides signifcantly stronger password validation, and is described here:
# http://httpd.apache.org/docs/current/misc/password_encryptions.html
help (){
cat <<EOF
Usage: $0 <htpasswd-file> <username>