Skip to content

Instantly share code, notes, and snippets.

View obar1's full-sized avatar
:shipit:
looking for a job

mar10 obar1

:shipit:
looking for a job
View GitHub Profile
@obar1
obar1 / simple_yt_dowloader.py
Last active April 18, 2025 06:28
save yt locally in folder and play via ws
from yt_dlp import YoutubeDL
import os
import json
import html
import re
import http.server
import socketserver
import threading
# Directory to store videos
@obar1
obar1 / rsync wsl2 to dropbox.sh
Created July 6, 2024 08:55
rsync wsl2 to dropbox
rsync -avz --exclude='.git/' --exclude='.venv/' --exclude='__pycache__' --exclude='.pytest_cache' ./kb.oreilly.git/ /mnt/c/Users/mario/Dropbox/kb.oreilly.git
@obar1
obar1 / drop-wsl2-Identifier.sh
Last active June 26, 2024 13:25
drop Identifier
find . -name "*.Identifier" -type f -print0 | xargs -0 rm
@obar1
obar1 / venv_cd.sh
Last active April 28, 2025 08:25
for bashrc to automaticaly activate and deactivate venv in folders as you move between them
function check_venv() {
# Check if we're entering a directory with a .venv
if [ -d "./venv" ]; then
echo "!!! deleting venv "
rm -rf venv
fi
if [ -d "./.venv" ]; then
if [ -n "$OLDPWD" ] && [ "$PWD" != "$OLDPWD" ]; then
echo "folder changed..."
python_path=$(which python 2>/dev/null)
@obar1
obar1 / update_0to100s.sh
Last active April 24, 2025 13:19
update 0 to 100 repos
#!/bin/bash
# set -eox pipefail
update_0to100() {
cd ../0to100.git
pwd
git switch main
git pull
}
@obar1
obar1 / get oreilly cookies.md
Created December 15, 2023 04:19
get oreilly cookies

https://learning.oreilly.com/profile/

console.log(JSON.stringify(document.cookie.split(';').map(c => c.split('=')).map(i => [i[0].trim(), i[1].trim()]).reduce((r, i) => {r[i[0]] = i[1]; return r;}, {})))
@obar1
obar1 / obar1.uses.ps1.sh
Last active October 25, 2023 03:39
my ps1
# - bash history id
# - current pwd but only last folder
# - colored git branch
# v0.1
PS1='\! ${PWD#"${PWD%/*/*}/"}\n\e[1;34m\W$(__git_ps1 " (%s)")] \e[m'
@obar1
obar1 / read_from_file_and_do_shit.sqh
Created July 7, 2023 10:54
read fro file and do shit in bash
while read line; do
printf "%s %s\n" "git mv $line https§§§__$line"
done <"$1"
@obar1
obar1 / how_to_absorb_0to100.md
Last active June 28, 2023 09:21
how to absorb 0to100
@obar1
obar1 / poweshell_gwip
Created June 7, 2023 08:52
poweshell gwip
PS C:\Users\mario\Dropbox\0to100gcloud> git add . ; git commit -m "wip" ; git push