Saturday, 18 March 2023

Still grepping the bash history?

"How to cycle through reverse-i-search in BASH?"

1. by repeatly pressing Ctrl+R

2. but also Ctrl+S, for the other direction - however, this only works after issuing an 

stty -ixon

source: unix.stackexchange

-

Btw... same here :)


Thursday, 26 January 2023

"How To Remove Old Snap Versions To Free Up Disk Space" - How to Keep Fewer Revisions

When in the mood to fight for the megabytes :) the Snap package manager by default keeps the 3 last versions of the snaps ... would that sound a bit too much, that number can be reduced:

https://www.linuxuprising.com/2019/04/how-to-remove-old-snap-versions-to-free.html

TL;DR

sudo snap set system refresh.retain=2

Saturday, 1 October 2022

List of recently changed Git tracked files in Bash

Forgot why I needed this, but isn't it a beauty :)

git whatchanged --since '2022-03-01' --oneline | grep "whatever_..." | uniq | sort

(Most likely largely via StackOverflow)

Friday, 30 September 2022

New to me too - create bootable using cp

Was just Googling around if I forgot anything about using dd for creating a bootable, and behold:

You can even create a bootable USB stick with cp (it seems much more straightforward for me than dd or a GUI):

sudo cp path/to/ISO /dev/sdX

Also:

That was really new to me. Together with progress unix.stackexchange.com/a/301329/87264 it shows progress, too

Source: AskUbuntu

Well, truly useful ... let's see ...!

Saturday, 2 July 2022

Ubuntu is user friendly

Looks like I'm not a user though :) can't just connect my Android phone right away ... really?

See Can't transfer files from Android to Ubuntu via USB cable - Ask Ubuntu

"After digging around I found that Ubuntu doesn't include MTP support by default, which is needed to do general file transfers with Android. I opened a terminal and typed:

sudo apt-get install gmtp

Yea' that was kind of my 2nd thought. 3rd?

Friday, 24 June 2022

You actually CAN print multiple lines into a file using (a single, meaningful line of) bash

But why it's got to get so complicated ... :)

 

Anyway, note:

echo -e "Hello \nWorld \n" >> greetings.txt

 

Or, alternatively just output each line with a separate echo statement and printing to append with the >> piper.

SO: shell - how to pipe commands in ubuntu


Sunday, 19 December 2021

Note to self: Don't slack out because "it's just a prototype"

At least when it's near-trivial to come up with some good design concerns, applying them is effortless...

... well, it turns out just now that about 5 minutes of thinking could have saved - albeit hypothetical - hours of a future DB migration. Even thinking about it I lost like a good 10 minutes :)

There are mitigating circumstances (it's just a "plug-in" until it turns out whether it's worth buying the proper dedicated tech or not - maybe won't ever be needed), but things could be much better too easily.

A poor design/bad implementation can spread in the form of bad practice afterwards... better choices are less likely to end up doing that. 

Even if not doing two ful lrounds, think 1½ times at least 😏