Pages

Saturday, August 31, 2024

Gzipped images don't boot if copied with dd


gzip -dc ~/backup.img.gz | sudo dd of=/dev/sda bs=4M status=progress

This unzips it and pipes that into dd before copying. dd handles raw data otherwise it won't boot. I thought it was because I didn't do these other 2 steps


sudo sync

sudo umount /dev/sda

ugh I ended up just booting into mint to use raspberry pi imager, I was still struggling. Turns out I needed to open it sudo

rpi-imager isn't working for me on antix

I'm trying to backup my raspberry pi lite with i3 and mixxx setup.

Recently I improved upon it by adding a few more songs to mixxx, installed emacs, and xrdp so i can remote in.

This time I compressed the image with gzip

Instead of being 14gb its 4

"Much More Manageable"

Using Vim Spellcheck

  • :set spell to enable
  • ]s next [s previous mispelled
  • z= list of replacements

Friday, August 30, 2024

oceanic next

my fav vim theme now is oceanic-next

I was rolling with sonokai for a while.
I used to be a gruvbox dark man for a while but one-dark is kind of easier on the eyes.

Plug 'joshdick/onedark.vim'
Plug 'sainnhe/sonokai'
Plug 'morhetz/gruvbox'
Plug 'adrian5/oceanic-next-vim'
Plug 'junegunn/seoul256.vim'

xrdp remote desktop in i3

xrdp remote desktop in i3 on raspberry pi

sudo apt update
sudo apt install xrdp xorgxrdp
echo "exec i3" > ~/.xsession
sudo systemctl enable xrdp
sudo systemctl start xrdp

THIS IS SO COOL!
now I can use my setup with mixxx from the ipad using jump desktop. (heard nomachine can be used on linux mint for remote desktop .. haven't tried it yet though.)
I can use the rav filehub travel router to control my pi anywhere and get a screen going

WOO!! it just hit me... I CAN RUN EMACS NOW!!!
emacs + i3 woaaaaahhh
with a bluetooth keyboard and an ipad this is perfect now

Wednesday, August 28, 2024

connecting bluetooth from terminal on raspberry pi

sudo bluetoothctl
agent on
default-agent
scan on
devices
pair (mac)
connect (mac)
trust (mac)
scan off

how to control cmus from a gamepad

sudo apt install antimicrox
vim ~/.config/i3/config
# start cmus 
exec --no-startup-id lxterminal -e cmus

make sure the profile you create is set as default for usr/bin/cmus

here is my mapping

Tuesday, August 27, 2024

sudo shutdown alias


vim .bashrc

alias sd='sudo shutdown -h now'

sudo visudo

yourusername ALL=(ALL) NOPASSWD: /sbin/shutdown

source ~/.bashrc

Monday, August 26, 2024

My Top 3 Doom Emacs Themes I like

  • doom-feather-dark
  • doom-miramare
  • doom-bluloco-dark

miamare is like gruvbox dark but more muted. bluloco is like default but with sized headings, and feather dark is a more purpley version. HORORABLE MENTION: doom-manegarm. that theme is like an old lcd calculator brown, od green orange. reminds me of sunvox. not sure if ugly or beautiful. its got flava for sure though like blue cheese or yolandi

Wednesday, August 21, 2024

Email from vim v2

Improved upon it by redetermining the data structure on integromat to include recipient (tried before but the feild wasn't showing up but now it is so im using it.) It was cool being able to send yourself emails but now you can send anybody an email instead of having to manually go in and edit it in integromat. The trade off now is its a bit more stuff to type. Maybe it was better before just automatically sending it to yourself. who can remember everybodys emails anyway?

Remember to swap out YOURWEBHOOKGOESHERE for your webhookadress in the vimscript


"
"
"### EMAIL FROM WITHIN VIM###"
"
"
"
function! Email()
    " Prompt for the recipient email address
    let l:recipient = input('Enter the recipient email address: ')
    
    " Prompt for the title
    let l:title = input('Enter the title: ')
    
    " Get the current buffer content
    let l:buf_content = join(getline(1, '$'), "\n")

    " Define the body as the entire buffer content
    let l:body = l:buf_content

    " Create a dictionary for the JSON payload
    let l:json_dict = {
    \ 'recipient': l:recipient,
    \ 'title': l:title,
    \ 'body': l:body
    \ }

    " Convert the dictionary to JSON
    let l:json_payload = json_encode(l:json_dict)
    
    " Create a temporary file to hold the JSON payload
    let l:tmpfile = tempname()
    call writefile([l:json_payload], l:tmpfile)

    " Prepare the curl command with the new URL
    let l:cmd = 'curl -X POST https://hook.us1.make.com/ -H "Content-Type: application/json" -d @' . shellescape(l:tmpfile)

    " Run the curl command
    let l:output = system(l:cmd)

    " Clean up the temporary file
    call delete(l:tmpfile)

    " Show the output or errors
    echo l:output
endfunction

" Create a command to run the function
command! Email call Email()

Tuesday, August 20, 2024

fixing antimicrox mixxx window priority

in antimicrox ctrl + s to go into settings set default profile to work with mixxx in /usr/bin/mixxx. The problem I had before was the controller was locked on the focus of the antimicrox window so when i moved the dpad it would change to the blank new profile which would then stop it from working.

Saturday, August 17, 2024

how to clone a pi using dd

# Identify SD card device
lsblk

# Unmount SD card (example for /dev/sdX1)
sudo umount /dev/sdX1

# Create an image of the SD card
sudo dd if=/dev/sdX of=~/raspberry_pi_backup.img bs=4M status=progress

# Verify image integrity (optional)
md5sum /dev/sdX | tee /tmp/original_md5sum.txt
md5sum ~/raspberry_pi_backup.img

# Write image to a new SD card
sudo dd if=~/raspberry_pi_backup.img of=/dev/sdX bs=4M status=progress

# Sync and eject
sudo sync

3 ways to write html for a blogger post using vim.

there are three ways to input html.

  1. omni complete (ctrl+x+ctrl+o)
  2. emmet (mine is norm comma)
  3. vim surround plugin

I just think its neat that I am SSH'd into a raspberry pi from a macbook running Linux Mint. I am Able to create and post to a blog from within a vim buffer written as html using emmet mostly but also sometimes vim surround or omni complete. What I like about omni complete is it doesn't require any plugins although emmet is just way better imo.

The problem with vim surround is it formats the html a little weird. It puts the tags on their own seperate light, which is kind of great/horrible. In some ways it makes it easier to see and delete the tags if you want but also that can kind of suck If you like everything nice and neat on the same line.

Thursday, August 15, 2024

Emacs org agenda basics

      
            * TODO  go to places
            DEADLINE: <2024-08-15 Thu 22:00> SCHEDULED: <2024-08-15 Thu 19:00>
            - space m d gives you the date input in emacS
            - ctrl c [ that updates the org agenda
            - space o a a a = show agenda views

              dates with <> are active
              dates with [] are inactive
              :SCHEDULED
              :DEADLINE
            those ones show in agenda but inactive doesn't
             scheduled is the most usefull
             it makes the thing appear.
             its good to follow it with a deadline.
      

TEST post from vim using vimscript

writing it in html and sending it over curl to integromat(make) it uses the json from the webhook to send over to blogger


" Define the Vim function
function! Blogpost()
    " Get the current buffer content
    let l:buf_content = join(getline(1, '$'), "\n")

    " Find the first 

heading let l:title = matchstr(l:buf_content, '

\(.*\)

') if l:title == '' echo "No

heading found." return endif " Extract the title text (remove the

and

tags) let l:title = substitute(l:title, '

\(.*\)

', '\1', '') " Extract content after the first

heading let l:content_start = matchend(l:buf_content, '

\(.*\)

') let l:content = strpart(l:buf_content, l:content_start) " Create a dictionary for the JSON payload let l:json_dict = { \ 'title': l:title, \ 'content': l:content \ } " Convert the dictionary to JSON let l:json_payload = json_encode(l:json_dict) " Create a temporary file to hold the JSON payload let l:tmpfile = tempname() call writefile([l:json_payload], l:tmpfile) " Prepare the curl command let l:cmd = 'curl -X POST https://hook.us1.make.com/WEBHOOKURLGOESHERE -H "Content-Type: application/json" -d @' . shellescape(l:tmpfile) " Run the curl command let l:output = system(l:cmd) " Clean up the temporary file call delete(l:tmpfile) " Show the output or errors echo l:output endfunction " Create a command to run the function command! Blogpost call Blogpost()

Webhooks Post to Blogger Using Curl

Using make.com to send webhook with the json body of "Title" and "Content".

create a bash script that uses curl to send to that webhook


#!/bin/bash

# Prompt for title
read -p "Enter the title: " title

# Prompt for content
read -p "Enter the content: " content

# Send the POST request using curl
curl -X POST https://hook.us1.make.com/YOURWEBHOOKGOESHERE!!! \
     -H "Content-Type: application/json" \
     -d "$(printf '{"title": "%s", "content": "%s"}' "$title" "$content")"

chmod and move it


chmod +x blogpost.sh
sudo mv blogpost.sh /usr/local/bin/blogpost

Now you should be able to type blogpost anytime in the terminal and post away no need for the browser

Friday, August 9, 2024

remove border title i3

how to remove title bar in i3

add this to your config

for_window [class="^.*"] border pixel 0

the link to sunvox

sunvox

wget 'https://warmplace.ru/soft/sunvox/sunvox-2.1.1c.zip'

3.5tft when you screw up the resolution

git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/

after messing it up with raspi-config theres no option to take it back down smaller than 700

chmod +x LCD35-show
 ./LCD35-show

straight to i3 no lightdm

sudo apt remove --purge lightdm
sudo apt autoremove
sudo apt install xinit
vim ~/.xinitrc
exec i3
vim ~/.profile
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
  startx
fi

for the i3 config i like to add

sudo apt-get install unclutter

#add to /.config/i3/config
exec --no-startup-id unclutter -idle 2

tired of waiting to enter commands apparently you can double pipe to true and its supposed to keep going even if one of the parts fails

sudo apt-get install -y vifm milkytracker cmus tmux git i3 w3m || true

that way just suppresses errors. looping over them might be better?

sudo apt-get update

# List of packages to install
packages=("vifm" "milkytracker" "cmus" "tmux" "git" "i3" "w3m" "schism")

# Install each package individually
for pkg in "${packages[@]}"; do
    echo "Installing $pkg..."
    sudo apt-get install -y $pkg || echo "Failed to install $pkg"
done

hide the mouse in i3

exec --no-startup-id -idle 2

autostary programs on raspberry pi

with autostar

git clone https://github.com/Botspot/autostar
~/autostar/main.sh

Thursday, August 8, 2024

how to backup iso using cli

Step Linux/macOS Windows
Insert SD Card Insert the Raspberry Pi SD card into your computer. Insert the Raspberry Pi SD card into your computer.
Identify SD Card Use diskutil list (macOS) or lsblk (Linux) to find the device identifier (e.g., /dev/sdb). Skip to the next step as Win32 Disk Imager handles this.
Create Backup Run: sudo dd if=/dev/sdX of=~/raspberry_pi_backup.iso bs=4M (replace /dev/sdX with the correct device identifier). Use Win32 Disk Imager: Select the SD card, choose a save location, and click "Read" to create the backup.
Verify Backup Check the size of the ISO file and optionally mount it to verify the contents. Check the size of the ISO file and optionally mount it to verify the contents.
Restore (Optional) To restore, run: sudo dd if=~/raspberry_pi_backup.iso of=/dev/sdX bs=4M. Use Win32 Disk Imager: Select the ISO file and write it to the SD card.
Notes The dd command is powerful, so double-check device identifiers to avoid mistakes. Ensure you have enough storage space for the .iso file. The .iso file will be the size of the SD card, so make sure you have enough storage space.

Wednesday, August 7, 2024

post to blogger from email

Recently discovered the option in blogger to post from email. Previously had it disabled. I'm making a shortcut to publish blogposts from an iPhone.

Tuesday, August 6, 2024

vim spellcheck

enable with

:set spell
  • s[ go to next mispelled word
  • z= show changes
  • zg add to dictionary
  • zw remove

Saturday, August 3, 2024

i3 on raspberry pi os lite is great

install i3 on pi lite

sudo apt-get install i3
sudo apt-get install xserver-xorg
sudo apt-get install xinit
sudo startx

it works on a pi zero!
in raspi-config set auto login to console and use the script below to have it run startx for you after loading the tty

auto startx


vim ~/.profile

if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
    startx
fi

the default terminal is atrocious light theme. the i3-sensible-terminal references URxvt terminal so change those configurations and make the font bigger

how to grep ip using ifconfig

ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}'

under 20$ pizza order options

Pizza Pizza

a pizza order i was putting together at pizza pizza

Pizza Pizza has a fixed price 4 topping xl deal which may be better than my custom one

mountroyal pizza

this spot in burlington has some gourmet pizzas, the brisket looks good

Napolitana -medium @ Pizza Nova is $19.34 - anchovies, black olives, mushroom

Pizza Pollo @ Pizza nova has been my goto for years. $19.49 for a small. Its $23.89 for a medium

  • grilled chicken
  • roasted red pepper
  • spinach
  • feta

Chicken Florentine

$18.89 small med $23.34

  • pesto base
  • chicken
  • feta
  • roasted garlic
  • spinach

Tuscan Pesto

$19.49 small

  • pesto base
  • chicken
  • roasted red peppers
  • artichokes
  • goat cheese

Feeds - RSS reader

  1. gnome-feeds
  2. nom
  3. quiterss

sudo apt install gnome-feeds

sudo apt install nom

sudo apt install quiterss

newsboat is great but I was looking for something different. I really like feeds its clean and simple and you don't have to deal with some config files.

linuxlinks.com

I like this webistes reviews of linux software

linuxlinks.com

Thursday, August 1, 2024

i3status toolbar normal time instead of 24 hour

 sudo vim /etc/i3status.conf

edit the %H %M %S to be %I %M %P

The Tree Command


sudo apt install tree

I like piping the output of tree into less so I can actually see the rest of it using vim binds, and I like to pipe it to the clipboard when im trying to explain a directory structure to chatgpt

how to pipe term output into system clipboard


echo "hello world" | xclip -selection clipboard

!! | xclip -selection clipboard

This pipes the output of the last run command into the system clipboard