Showing posts with label terminal. Show all posts
Showing posts with label terminal. Show all posts

Saturday, February 17, 2024

copying a range of lines from terminal

 previously posted a way

which involved opening it in vim.

This uses sed instead.

    

    sed -n '246,$p' filename.txt | pbcopy

this copys from line 246 to the end of the file 

Thursday, December 21, 2023

cli pomodoro for linux

tomatoshell

almost went with gnome pomodoro it was the only thing that showed up in the package manager but damn its almost a gigabyte. WHY!!! theres no reason a simple pomodoro timer app needs to be almost a gig jeeeezus.

"I tried a few others, none of them worked. Probably downloaded a million viruses on my computer instead."

how to use

  • p = pause
  • s = skip (reset)
  • q = quit

you can make a custom alarm by putting your own alarm.wav file in

    
  $HOME/.local/share/tomatoshell/alarm.wav
    

Wednesday, December 13, 2023

how to copy from term without mouse

 on linux mint xfce for whatever reason its just not easy to ctrl c ctrl v in the term

I end up reaching for the mouse and i hate it.

although ive got set -o vi in my .bashrc for vim motions, the y only copies internally.

ctrl shift a selects the whole terminal which isnt what I want.

visual mode isnt working anyway.


My solution:

piping my commands into xclip.

making a bash alias for xclip so i dont need to type xclip=selection clipboard.

add this to your .bashrc:


# Alias to copy text to clipboard using xclip

alias c='xclip -selection clipboard'


    after that you can echo it into a thing and pipe it to c which is your alias

Friday, December 8, 2023

how to resize an image from terminal

    don't you hate it when you upload a picture and when you go to post realize the picture is HUUUUUUUGe. its great that these modern phones have all those pixels but it sucks when your trying to do a quick edit in ms paint.

trying to throw some quick text on there and you gotta zoom all the way out and find the corner of the screen and drag it all down. peeved.

but don't worry there's a better way.

IMAGEMAGICK

the imagemagick command in this case is convert (just like how sox has a bunch of commands other than sox like synth, play, rec). by giving only one input for the dimensions in the argument it conveniently maintains the aspect ration scaling it down nicely.

convert image.png -resize 300 image_resized.png

Wednesday, November 29, 2023

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'

Monday, November 27, 2023

how to grep IP from ifconfig

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"

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 convert .caf to mp3 in terminal

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

Friday, July 7, 2023

newboat RSS config and setup

getting newboat up on a raspberry pi was breezy once i realized how to import feeds

thats a brickwall that you hit as soon as you get it installed and try to run it you get the error that you cant open it till you add at least one feed. I already had a bunch of feeds saved in OPML file just needed to air drop it over. BUT THE BIGGEST HEADACHE was it was saying it cant do it.  but heres the deal..

you first need to create a file called urls inside .newsboat  (dot newsboat) then you can enter the command

$ newsboat -i file.opml

***

THE CONFIG

in config make a file called config and inside put this: 

auto-reload yes

browser "open -a Google\\ Chrome %u"

macro y set browser "mpv %u" ; open-in-browser ; set browser "elinks %u"


***

thats my basic config for newsboat it opens in chrome by default with o, if you want mpv press comma then y.

obv install mpv if you dont have it