Skip to content

Instantly share code, notes, and snippets.

View obar1's full-sized avatar
🏠
Working from home

obar1 obar1

🏠
Working from home
View GitHub Profile
@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
Created April 11, 2024 04:13
venv auto cd handling for 0to100 folder
function venv_cd() {
# set -x
if [[ $PWD == */0to100* ]]; then
echo "0to100 folder..."
if [[ -d .venv ]]; then
if [[ "$VIRTUAL_ENV" == "$PWD/.venv" ]]; then
echo "using $VIRTUAL_ENV"
else
deactivate || true
source .venv/bin/activate
@obar1
obar1 / update_0to100s.sh
Last active September 15, 2024 10:52
update 0 to 100 repos
#!/bin/bash
# set -x
function get_latest_0to100 {
cd 0to100.git
git switch main
git pull
cd -
}
function update_local_repo {
@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
https://help.dropbox.com/sync/ignored-files
Set-Content -Path 'C:\Users\yourname\Dropbox(Personal)\YourFileName.pdf' -Stream com.dropbox.ignored -Value 1
or better
PS C:\Users\mario\Dropbox\gcloud_0to100> Set-Content ./.git:com.dropbox.ignored -value 1
> https://www.dropboxforum.com/t5/Apps-and-Installations/Ignoring-a-directory-does-not-work/td-p/679164