Saturday, November 25, 2023

finding mac temperature from terminal

44.97 c is what it was when i started running it cold.
56.98 c is what its at now after running it for a while...
Im going to let it run for a while with a courier bag on top of it
to see if its okay or if it gets too hot covered up.
heres the one liner:
sudo powermetrics --samplers smc |grep -i "CPU die temperature"

Tiles Window Manger + karabiner app launching

 Tiles Is nice and simple//

============================

amethyst was kind of overkill.

playing arounmd with linux mint

gave me a taste of a simpler but 

nice way of going about window managers.

ITS JUST LIKE THE ONE IN LINUX MINT !!! YES

The Home Page For Tiles

-----------------------------------

KARABINER ::

Getting ctrl+ alt + T to open the terminal//

==============================

why isn't this also the default on mac?

Im sick of cmd space-ing and typing term

then hitting enter. finally figured out 

how to use karabiner to do it.

    - under complex mods

    - add rule

    - import rule from the internet.

another thing:: 

on my dell windows keyboard remapped

- pause = sleep

- scroll lock = f14

- print screen f13

why f13 & f14? because then you can use the shortcuts app to trigger them. in shortcut details click add keyboard shortcut. get the shortcut to open the app of your choosing.


* trick to get this working properly: go to system preferences > keyboard

> shortcuts. after that it should work properly. (was banging my head against the wall before wondering why it wouldn't work still not entirely sure but i think it might be so weird security thing? but thats weird because if it was usually you have to go into privacy settings, type your pass and check some box)

Tmux Copying Between Panes

  • ctrl [ = enter into copy mode
  • press v to select text
  • ctrl w to copy the text
  • ctrl HJKL (or arrows)
  • ctrl ] to paste the text

use tmux navigator to have proper vim navigation. leader k arrows is only if your a masochist.


the video on the amazing tmux config i got this from

set-option -sa terminal-overrides ",xterm*:Tc" set -g mouse on unbind C-b set -g prefix C-Space bind C-Space send-prefix # Vim style pane selection bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R # Start windows and panes at 1, not 0 set -g base-index 1 set -g pane-base-index 1 set-window-option -g pane-base-index 1 set-option -g renumber-windows on # Use Alt-arrow keys without prefix key to switch panes bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D # Shift arrow to switch windows bind -n S-Left previous-window bind -n S-Right next-window # Shift Alt vim keys to switch windows bind -n M-H previous-window bind -n M-L next-window set -g @catppuccin_flavour 'mocha' set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'christoomey/vim-tmux-navigator' set -g @plugin 'dreamsofcode-io/catppuccin-tmux' set -g @plugin 'tmux-plugins/tmux-yank' run '~/.tmux/plugins/tpm/tpm' # set vi-mode set-window-option -g mode-keys vi # keybindings bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel bind '"' split-window -v -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}"

Tuesday, November 21, 2023

Thursday, November 16, 2023

linux mint is awesome!

so i heard nomad bsd could run off usb with persistant storage but i couldnt get internet and thats a deal breaker. couldnt get the wifi drivers and wasted a day trying to figure it out. not even my usb ethernet adapter would work.

what about raspberry pi os? no you have to wipe yoir whole drive. then i found mint had a live version could run off usb but lacks persistance. whatever its really good. no wifi either but my ethernet card worked! once connected was able to install wifi drivers but need to reboot for the changes to take effect.

tried partitioning got an error. I am scared i will accidentally delete my whole mac partition by mistake. im going to bed instead. i want to try again some other time. the old mac is great its a shame it cant be used to its full potential in its current state. its exciting to know that it can be revitalized.


love this theme!!!

chicago95

clone the repo run the python script to run the nice install wizard. it makes it easy to get it set up.


the hex color for win 95 bg =#018281

FONTS

Roboto Mono
Hack
Menlo
microsoft sans serif
Lucida Console
sudo apt-get install msttcorefonts my vim rc
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

I like that for default font in appearance


for terminal I like "less perfect DOS VGA regular" size 16


firefox: got the win 95 theme


firefox extensions

  • vimium
  • ubl0ck 0rigin
  • dark reader
  • video speed controller
  • YouTube Windowed FullScreen by navi.jador

linux terminal

  • vim
  • git
  • mc
  • htop
  • neofetch
  • cmatrix
  • cmus
  • mpv
  • tmux
  • ffmpeg
  • sox

gui linux software

reaper, koala sampler, pencil2d, milkytracker, renoise, lmms, shotcut/openshot, kdenlive, gimp, mypaint


sfz/sf2 player for linux

reaper for linux mint
sfzero
General Midi SF2 by S. Christian Collins
nokia soundfont
opl3 soundfont
2mbgmgs.sf2

to install linux vsts drop the file into /usr/lib/vst/ (mkdir vst if it doesnt exit yet)

fixing reaper

chordgun
how to make reapers piano roll more like FL

import the repository for tukan

https://raw.githubusercontent.com/TukanStudios/TUKAN_STUDIOS_PLUGINS/main/index2.xml
  • time selection: set time selection to items = p (default is pan)
  • open piano roll > options > mouse modifiers > midi piano roll > left click
    change default action: deselect all notes and move edit cursor
    change behavior to insert > just insert
    action: split notes on grid SET TO = ctrl u
    - Item Properties: pitch item down/up one octave = ctrl + down/up
    - Item Properties: pitch item down/up one semitown = (/)
    

Monday, November 13, 2023

how to delete non unique lines in vim with a regex

:g/^\(.*\)$\n\1$/d

how to cut long audio files in terminal with sox

## Half hour ## 
input.mp3 output.mp3 trim 0 1800 : newfile : restart

##1 hour cuts##
input.mp3 output.mp3 trim 0 3600 : newfile : restart

Sunday, November 12, 2023

how to get wordcount of a txt file in the terminal

use the wc command.


wc file.txt


the output is 3 columns of numbers:


# of lines, WORDCOUNT, bytes


how to convert .caf to mp3 in terminal

ffmpeg -i input.caf -c:a libmp3lame -b:a 320k output.mp3

Saturday, November 11, 2023

grab youtube video title from terminal

#/bin/bash 
[[ "$1" ]] && url="$1" || url="$(xclip -o)"
[[ "$url" != "https://"* ]] && read -p "Please Enter Video URL: " url
[[ "$url" != "https://"* ]] || exit 1
 
wget -qO- "$url"|tr "," "\n"|grep '^"title":"'|cut -d\" -f4

waltzs of the flowers - kenji nakatani

Thursday, November 9, 2023

Strip Blank Lines In Vim

Heres the regular expression you would use in vim to delete all those blank new lines you dont want that are needlessly taking up space in your text file.


  :g/^$/d

convert pdf to plain text

I wanted to spice up my typing practise on monkeytype by using pdfs.
heres a python script that takes the file paths as inputs and spits out a plain text version you can copy into monkeytype.

import PyPDF2

def pdf_to_text(pdf_path, output_text_path):
    text = ""
    
    with open(pdf_path, 'rb') as file:
        pdf_reader = PyPDF2.PdfReader(file)
        
        for page_num in range(len(pdf_reader.pages)):
            page = pdf_reader.pages[page_num]
            text += page.extract_text()
    
    with open(output_text_path, 'w', encoding='utf-8') as output_file:
        output_file.write(text)

# Take input for the PDF file and output text file
pdf_path = input("Enter the path to the PDF file: ")
output_text_path = input("Enter the path for the output text file: ")

pdf_to_text(pdf_path, output_text_path)

print(f'Text extracted from PDF and saved to {output_text_path}')

okay so after i did that i found an easier way:
using some free software called calibre this can convert ebook formats from CLI but its giving me some troubles il have to come back to this later.

  1. I set an alias for ebook-convert
  2. trying to get a bash script to take the input args as variables for the input and output paths.

Saturday, November 4, 2023

vim colemak keybinds on a qwerty board

a qwerty board marked up with the vim shortcuts for reference

sunset color pallate

saw this view from the bridge.
couldn’t wait to get home and figure out thise hexcodes.

immediately thought:
make a css template with it
vim/ textastic/ mweb colorschemes
want that terminal rice in i3

Friday, November 3, 2023

notes on vim tables

tables

vimwiki

just make pipes it auto aligns
pipe and 3 dashes will do horizontal lines

== VIMWIKITABLE CMDS ==

  • :VimwikiTableAddRowAbove
  • :VimwikiTableAddRowBelow
  • :VimwikiTableDeleteRow
  • :VimwikiTableAddColBefore
  • :VimwikiTableDeleteCol

== markdown-toc ==

  • ajorgensen/vim-markdown-toc
    :GenMarkdownTOC:
    :UpdateMarkdownTOC:

    • Align by a Delimiter:
      :Tabularize: /: Align lines based on a specified delimiter.
      For example, to align lines by equal signs, use :Tabularize /=.
      Align by Regular Expression:

:Tabularize: /<regular_expression>: Align lines based on a regular expression.
For example, to align lines by spaces or tabs, use :Tabularize /\s+.
Align by a Range:

:Tabularize: / : Align lines within a specified range.
For example, to align lines within a visual selection, use :'<,'>Tabularize /=.
Custom Alignment:

  • You can specify a custom alignment character or string. For example, :Tabularize: / / will align lines using spaces.
    Automatic Alignment with Operators:

  • In normal mode, select the lines you want to align.
    Then, use the :Tabularize: command to automatically align the selected lines based on the delimiter, regex, or alignment character you specify.
    Repeat the Last Tabularize Command:

:Tabularize (without any arguments) will repeat the last Tabularize command with the same arguments.
Visual Mode Alignment:

  • In visual mode, select the text you want to align.
    Then, press :, and Vim will automatically add '<,'> to the command for aligning the selected visual block.
    Custom Mappings:

You can create custom mappings in your .vimrc to quickly apply Tabularize to common delimiters or regex patterns. For example:

nnoremap a :Tabularize /,

  • This mapping allows you to align text by commas by typing a in normal mode.

== table mode ==

| name | price |
| phil | 3 |
| susan | 5 |
| janice | 8 |
| doreen | 39 |
| cordelia | 12 |
| --------------------+------- | |
| total | 67.0 |
%% tmf: $8,2=Sum(2:-1)
leader tt = csv to table
:Tableize

leader tm = :TableModeToggle

  • then you can pipe away
  • double pipe does horiz sep

== moving ==
bracket / curly brace + pipe

== editing ==

ci| = change in cell /
ca| = change around cell
leader tdd = delete row
leader tdc = delete column
leader tic = insert col

== formulas ==
leader tfa =:TableAddFormula
leader tfe = evaluate
leader t? also eval (no need it auto evaluates)

Sum(2:-1) that means col 2 and -1 = row above current line

Sum(2,2:-1) 2,2 is start at col 2 row 2
when you specify a pair of values eg 2,2 its specific to that row
when you just have 1 its the whole column.


:TableModeEnable:
Enables table mode for the current buffer.
:TableModeDisable: Disables table mode for the current buffer.
:TableModeRealign: Realigns the table columns.
:TableModeAutoFormat: Automatically formats the table by aligning columns.
:TableModeToggle: Toggles between enabling and disabling table mode.
:TableModeToggleInsertMode: Toggles between insert mode and normal mode for a table cell.
ta: Toggle table alignment (e.g., left-align, center-align, right-align).
tr: Toggle table row alignment.
tt: Toggle table text wrapping.
Table Navigation:

|: Move to the next cell in the table.
j and k (in Normal mode): Move between rows.
H and L (in Normal mode): Move to the first and last cells in the current row, respectively.
gh and gl (in Normal mode): Navigate between columns.
[[ and ]]: Jump to the previous and next table.
Text Objects:

iat: Select the entire table.
iab: Select the current cell.
a|: Select the current column.
ir: Select the current row.
Other Useful Shortcuts:

ti: Inserts a new row above the current row.
tI: Inserts a new row below the current row.
td: Deletes the current row.
tD: Deletes the current column.
tc: Change the contents of the current cell.

folds and diff

zf - manually define a fold up to motion
zd - delete fold under the cursor
za - toggle fold under the cursor
zo - open fold under the cursor
ze - close fold under the cursor
zr - reduce (open) all folds by one level
zm - fold more (close) all folds by one level
zi - toggle folding functionality


]c - jump to start of next change
[c - jump to start of previous change
do or :diffg[et] - obtain (get) difference (from other buffer)
ap or :diffpu[t] - put difference (to other buffer)
:diffthis - make current window part of diff
:dif[fupdate] - update differences
:diffo[ff] - switch off diff mode for current window


Tip The commands for folding (e.g. za ) operate on one level. To
operate on all levels, use uppercase letters (e.g. zA).

Tip To view the differences of files, one can directly start Vim in diff mode by running vimdiff in a terminal. One can even set this as git difftool

Thursday, November 2, 2023

awk simple 2 col csv sum

awk -F, 'BEGIN { OFS = ","; total = 0; } { if (NR == 1) { print $0; } else { total += $2; lines[NR] = $0; } } END { for (i = 2; i <= NR; i++) { print lines[i]; } print "total," total; }' yourfile.csv > temp.csv && mv temp.csv yourfile.csv

multi cursor editing in vim

ctrl v shift i ctrk v shift x enter visual block mode i to insert x to delete great for commenting out blocks of code

Wednesday, November 1, 2023

textastic theme

codepen themes for textastic

the best theme = "tommorow night eighties" w roboto mono font.