diff --git a/lessons/02-your-env/B-ansible.md b/lessons/02-your-env/B-ansible.md index 8382db2..95c13ca 100644 --- a/lessons/02-your-env/B-ansible.md +++ b/lessons/02-your-env/B-ansible.md @@ -114,6 +114,27 @@ realize that you are just working on a "server."

+## NOTE: feel free to just watch + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + ## Install ansible as all adventures start... @@ -415,22 +436,9 @@ Your code should look something like this ## OH NO! Crash! If you are using apt and have to use sudo you should see the following error. -``` -<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: theprimeagen -<127.0.0.1> EXEC /bin/sh -c 'echo ~theprimeagen && sleep 0' -<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/theprimeagen/.ansible/tmp `"&& mkdir "` echo /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333 `" && echo ansible-tmp-1729644436.258113-1776352-80352927742333="` echo /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333 `" ) && sleep 0' -Using module file /usr/lib/python3/dist-packages/ansible/modules/apt.py -<127.0.0.1> PUT /home/theprimeagen/.ansible/tmp/ansible-local-1776140pp0cn_gm/tmp33hhis1k TO /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333/AnsiballZ_apt.py -<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333/ /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333/AnsiballZ_apt.py && sleep 0' -<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-rgqphadrxzwvmzhucbtnjvxefbemoqpt ; /usr/bin/python3 /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333/AnsiballZ_apt.py'"'"' && sleep 0' -<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/theprimeagen/.ansible/tmp/ansible-tmp-1729644436.258113-1776352-80352927742333/ > /dev/null 2>&1 && sleep 0' -fatal: [localhost]: FAILED! => { - "changed": false, - "module_stderr": "sudo: a password is required\n", - "module_stdout": "", - "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", - "rc": 1 -} +```bash +TASK [Install neovim's deps] ********************************************************* +fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} ``` Well ansible does have the ability to become the sudo but it needs the creds to diff --git a/lessons/02-your-env/D-neovim.md b/lessons/02-your-env/D-neovim.md index f1ffda2..5c16b3e 100644 --- a/lessons/02-your-env/D-neovim.md +++ b/lessons/02-your-env/D-neovim.md @@ -14,8 +14,11 @@ With ansible we: Lets build the same thing, but in the bash script now! +``` gituah: git@github.com:neovim/neovim.git
deps: cmake gettext lua5.1 liblua5.1-0-dev +make: make CMAKE_BUILD_TYPE=RelWithDebInfo +```

diff --git a/lessons/02-your-env/E-wait.md b/lessons/02-your-env/E-wait.md index 7b08c27..08bb527 100644 --- a/lessons/02-your-env/E-wait.md +++ b/lessons/02-your-env/E-wait.md @@ -222,10 +222,11 @@ what about one off scripts? ## Expected Code ```bash copy_file() { - file=$1 + from=$1 to=$2 - execute rm $to/$file - execute cp $file $to + name=$(basename $from) + execute rm $from + execute cp $from $to/$name } copy_file .specialrc ~/ diff --git a/lessons/03-navigation/B-tmux.md b/lessons/03-navigation/B-tmux.md index 8b32ac4..b4b6e43 100644 --- a/lessons/03-navigation/B-tmux.md +++ b/lessons/03-navigation/B-tmux.md @@ -16,8 +16,6 @@ centered around navigation. 1. navigate to any session by directory with fuzzy find 1. run scripts or whatever programs i want when navigating to a directory -** TO GIMP ** -


@@ -109,6 +107,11 @@ unbind C-b set-option -g prefix C-a bind-key C-a send-prefix +# vi key movement for copy/pasta mode +set-window-option -g mode-keys vi +bind -T copy-mode-vi v send-keys -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + # = XDG_CONFIG_HOME/tmux/tmux.conf # = ~/.tmux.conf bind r source-file \; display-message "tmux.conf reloaded" @@ -139,7 +142,10 @@ We can even use our fancy new dev-env script to install it! Lets go through some basic commands about tmux so you can see how they work with just usage. I will show you the ones I use and some that I don't use -* what is prefix key +ource /home/theprimeagen/.tmux-sessionizer +what is prefix key + +### just using -* commands * creating window * detaching * attaching @@ -309,17 +315,40 @@ From my original points, we still have 4 points left to address to create the "perfect" navigation system for the terminal ### What I Want -1. DONE :: sessions that last even when i close my terminal +1. ~~sessions that last even when i close my terminal~~ 1. multiple running sessions, and these sessions are based on directory -1. DONE :: "tabs" within a session +1. ~~"tabs" within a session~~ 1. navigate to any session by directory name "instantly" 1. navigate to any session by directory with fuzzy find 1. run scripts or whatever programs i want when navigating to a directory +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ## Lets Address Point 6 First -This is one of the easier points to address +This is one of the easier points to address (a bit weird) + +``` +6. run scripts or whatever programs i want when navigating to a directory +``` * opens and creates the configuration you want for a project +** gimp **

@@ -339,6 +368,7 @@ This is one of the easier points to address

+ ## Opener script ```bash @@ -349,6 +379,7 @@ if [[ -x ./.ready-tmux ]]; then elif [[ -x ~/.ready-tmux ]]; then ~/.ready-tmux fi +clear ```
@@ -395,7 +426,8 @@ with a simple script (don't worry, it'll get a lot better) We have checked off another component of what I consider a great terminal experience -> 6. run scripts or whatever programs i want when navigating to a directory +
+
But we still have a few left @@ -540,6 +572,7 @@ some sort of subset. ### CODE TIME!! Lets start this MF script (MF = Mother FZF): * get a selected directory from fzf. +* create a clean tmux session name

@@ -564,14 +597,14 @@ Lets start this MF script (MF = Mother FZF): #!/usr/bin/env bash selected=$(find ~/personal -mindepth 1 -maxdepth 1 -type d | fzf) -echo "selected!! $selected" +if [[ -z "$selected" ]]; then + exit 0 +fi +selected_name=$(basename $selected | tr ".,: " "____") +echo "selected!! $selected -- selected_name $selected_name" ``` -### Ok, lets do some great things -* is there a running session given name - * `:,.` are not allowed as session name - * ` ` we should also remove spaces... but if you use a space in your directory name i dislike you - * there are other non allowed characters, but we will not worry about them +### Lets make the script gooooood * if there is, navigate to that session * if there is not, create that session and navigate to it @@ -598,24 +631,26 @@ echo "selected!! $selected" ```bash #!/usr/bin/env bash -selected=$(find ~/personal ~/ ~/.config -maxdepth 1 -mindepth 1 -type d | fzf) +selected=$(find ~/personal -maxdepth 1 -mindepth 1 -type d | fzf) if [[ -z "$selected" ]]; then exit 0 fi -selected_name=$(basename "$selected" | tr ",.: " "____") - -if tmux has-session -t=$selected_name 2> /dev/null; then - tmux switch-client -t=$selected_name - exit 0 -fi - -if [[ -z "$TMUX" ]]; then - tmux new-session -s $selected_name -c $selected - exit 0 +selected_name=$(basename $selected | tr ".,: " "____") + +switch_to() { + if [[ -z "$TMUX" ]]; then + tmux attach-session -t $selected_name + else + tmux switch-client -t $selected_name + fi +} + +if tmux has-session -t="$selected_name"; then + switch_to +else + tmux new-session -ds $selected_name -c $selected + switch_to fi - -tmux new-session -ds $selected_name -c $selected -tmux switch-client -t $selected_name ```
@@ -636,7 +671,7 @@ tmux switch-client -t $selected_name

-## Combine our two scripts +## Remember our previous scriptedy-tmux It would be nice if we could combine our two scripts...
@@ -661,24 +696,29 @@ It would be nice if we could combine our two scripts... ```bash #!/usr/bin/env bash -selected=$(find ~/personal ~/ ~/.config -maxdepth 1 -mindepth 1 -type d | fzf) +selected=$(find ~/personal -maxdepth 1 -mindepth 1 -type d | fzf) if [[ -z "$selected" ]]; then exit 0 fi -selected_name=$(basename "$selected" | tr ",.: " "____") +selected_name=$(basename $selected | tr ".,: " "____") -if tmux has-session -t=$selected_name 2> /dev/null; then - tmux switch-client -t=$selected_name - exit 0 -fi +switch_to() { + if [[ -z "$TMUX" ]]; then + tmux attach-session -t $selected_name + else + tmux switch-client -t $selected_name + fi + + tmux send-keys -t $selected_name "ready-tmux" + tmux send-keys -t $selected_name "welcome to fem" +} -if [[ -z "$TMUX" ]]; then - tmux new-session -s $selected_name -c $selected +if tmux has-session -t="$selected_name"; then + switch_to else tmux new-session -ds $selected_name -c $selected - tmux switch-client -t $selected_name + switch_to fi -tmux send-keys -t $selected_name "ready-tmux" ```
diff --git a/lessons/04-tools/C-unix.md b/lessons/04-tools/C-unix.md index 3f2067d..bd4b3d0 100644 --- a/lessons/04-tools/C-unix.md +++ b/lessons/04-tools/C-unix.md @@ -30,6 +30,7 @@ transformation with them. * lets replace `foo` with `bar` * lets replace `foo` or `bar` with `foo,foo` or `bar,bar` +* show how its like vim find / replace ```bash ➜ dev-prod-2 git:(main) cat out | sed 's/: "\(.*\)",/: "\1,\1",/' @@ -157,7 +158,8 @@ now lets use parallel to control how fast it requests
## Just a touch of awk -I don't know a lot of awk and you can do quite a bit, but the little i do know is really good +I don't know a lot of awk and you can do quite a bit, but the little i do know +is really good ```bash ➜ dev-prod-2 git:(main) ✗ ps aux | grep vim | awk '{ sum += $2 } END { print sum }' diff --git a/lessons/04-tools/D-neovim.md b/lessons/04-tools/D-neovim.md index 85af71a..64cdb03 100644 --- a/lessons/04-tools/D-neovim.md +++ b/lessons/04-tools/D-neovim.md @@ -5,8 +5,9 @@ description: "your most used tool is the editor" ## Lets start with your editor Now i am going to show you around neovim, not because you are going to use -neovim, but its good understand just how hackable it is and perhaps you will be -willing to try it +neovim, or that i am trying to convince you to use neovim. You should use +neovim because you want to explore other ways of editing. Also, its good +understand just how hackable it is and perhaps you will be willing to try it

@@ -96,6 +97,7 @@ over the last few years. * macros * commands * help +* your first init script

diff --git a/lessons/06-outro/A-outro.md b/lessons/06-outro/A-outro.md index b8e645d..d5f656e 100644 --- a/lessons/06-outro/A-outro.md +++ b/lessons/06-outro/A-outro.md @@ -3,6 +3,30 @@ title: "Outro" description: "goodbye" --- +## Why no AI? +there are two important reasons why i didn't go over AI in this course. +1. i see this rise of behavior in devs "learned helplessness" +1. the products are just moving so fast + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + ## And this is it Its the joy of making a better experience that helps keep me engaged as a dev.