Thursday, November 30, 2023

how to multi line comment in vim

  1. ctrl + v
  2. shift + I then # (or whatever your comment)
  3. hit escape

this applys the comment to all the selected lines in visual block mode

how to install i3 on linux mint

on linux mint > package manager > install i3 metapackage (includes menu, statusbar, screenlocker)


sudo apt install rofi

#go to line 54 of the file below and swap out dmenu for rofi

vim ~/config/13/config bindsym $mod+d exec --no-startup-id rofi -show drun -width 400 -lines 5

mods to twister os mac theme window manager shortcuts

Action shortcut remap
Toggle Fullscreen Alt +f11 ctrl+alt+f
Hide Window Alt+f9 shift+Ctrl+h

Wednesday, November 29, 2023

samples for making 90s jungle

rhythmlab breaks
90s sample cds
internet archive- sample cds

speaking text with vim

so i was playing with the firefox plugin vimium, using it to navigate around, then realized you can also use visual mode to select blocks of text. selecting is the most annoying thing to do with the mouse. Now it became super easy and that got me thinking..

what if i got it to speak the text?

yeah so what you need to do to get this to work is 3 things

the three things

  1. install xclip
  2. install espeak
  3. make a bash script
  4. don't forget to


    	
    		chmod +x speak.sh
    	
    

the bash

	
		#!/bin/bash
		xclip -o | espeak
	

use mc to move it to my bash script directory. Create an alias for it

	
		alias speak='/home/mint/Documents/bashscripts/speak.sh'
	

how to focus: brown noise

sudo apt install sox


then you can run this command to play brown noise.


whats brown noise?

Also known as Brownian noise or red noise. Its power decreases by 6 dB per octave as the frequency increases. This means that as the frequency rises, the energy decreases more slowly compared to pink noise. Brown noise contains more low-frequency components than pink noise. It's often described as having a "darker" or "deeper" sound. It is often used in audio engineering, sound masking, and relaxation purposes.

other noise

you may have heard of white noise, well theres also pink noise which has all the frequencies evenly distributed. I prefer brown for masking because its less harsh on the top end and with more low end it muffles things better imo.

protip::

you can do yourself one better by making a bash script and setting an alias for it in your .bashrc file


#!/bin/bash play -n synth brownnoise
alias noise='/home/mint/Documents/bashscripts/noise.sh'

brightness controller

my 2008 imac with linux mint boots up hella bright. I want to be able to dim it all the way down to black in finite increments which by default isn't an option. this is one solution I found

BE VERY CAREFULL WITH THIS!!!

one simple mistake and your screen is black

I had to ssh in and delete brightness-controller. you think id learn. I made the same mistake twice when I did it again with xcalib which is horrible.

xcalib -co 95 -a darkens the screen in managable increments. but it doesnt let you undo it!!!! i tried negative values, decimal values nothing worked. I had it on 50 and i ran the command again BOOM it was black and i couldnt see shit. i was trapped in the dark with no way out

i should've done all my messing around in the guest profile so i could log out.

remapping capslock to escape

xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'


thats another way ^


both of these ways don't kick in untill you open up the terminal

Textmate Vim = Textastic Vim Motions?!

textmate vim
download

Tuesday, November 28, 2023

TWISTER UI: a great theme for xfce linux mint

that raspberry pi twister os theme can be applied to linux mint! classic mac/windows dark/light themes, discord,steam https://twisteros.com/twisterui.html I went in with it to try it out because it had a windows 95 theme. I really liked the chicago 95 theme i had before but this mac one is nice.

HOT TIP::: copying in vim

if your trying to copy from the terminal to the browser your probably gonna be having a bad time. vim --version lets you know if your vim has clipboard enabled + beside means it does - means it doesnt. sudo apt install vim-gtk this is the same as G vim, graphical interface vim. then after thats installed you can use "+y to yank to system clipboard

screenshot on linux mint with keyboard shortcut

the 2008 imac with linux mint cant cmd shift 4 to screenshot like on mac os :( cmd key triggers the menu. I did some digging around found out about remapping keys with xbindkeys by editing the .xbindkeysrc with vim. found a cli screen shot program called scrot "scrot '/home/mint/Pictures/screenshots/%Y-%m-%d_%H-%M-%S.png' -s" Control + Shift + 4

webcam on linux mint

my 2008 imac has been brought back to life with linux mint. I was looking for a way to get a feature like photobooth as it was one of the greatest features the mac had. i tried cheese but it wouldnt work. i found this one called guvcview it works sudo apt install guvcview

top windows vsts

genny (not fl note glide version)vst
tal bassline - win 64
poise - win 64
Gclip
sitala
sfizz- win 64
oxefm

Monday, November 27, 2023

how to grep IP from ifconfig

how to sudo save from within vim

Sunday, November 26, 2023

how tp map a usb numpad to trigger apps

keypad layout

the layout I settled on


used karabiner to map f13 to f20 figured out what the blocker was.
I was stuck with f14 f15 not working thought apple just didnt let you use f13-f20, that they were just there to taunt you. I read somewhere that they just dont let you..
I actually believed that oh mann thats ridiculous.
almost gave up.

what I realized was f14, f15 were mapped to brightness
so you simply uncheck that and it works!!

I cmd shift 4'd the icons in shortcuts and layed them out in excalidraw. tried to use pinta and paintbrush but they both suck! they dont let you have more than one layer.
ms paint was soo much better. mypaint on linux was good.
apparently it can work with macapps package manager (homebrews evil twin)but last time i tried to install macapps it took forever and did nothing. I think i terminated the download by closing my laptop (before i knew about tmux detached sessions) I didnt want to wait around with my laptop case open or spend all day waiting for it to finish.

  • karabiner'd the windows "help key" to get an extra shortcut
  • tried remapping eject but it wouldnt let me 😓

full screen youtube within a window

youtube windowed fullscren


 this chrome extension is great! combined with tiles window manager its perfect

there is also one for firefox


youtube-windowed-fullscreen

by navi.jadoor

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.