Searching recursively all files with the given extension:
find . -name "*.orig"
Searching all files containing the given text (source):
grep -Rn . -e "palavra"
Huge life saver.
Searching recursively all files with the given extension:
find . -name "*.orig"
Searching all files containing the given text (source):
grep -Rn . -e "palavra"
Huge life saver.
For my working VM, after ditching the sluggish Ubuntu 22 for the crazy good Mint Cinnamon 21, one of the customizations I wanted to make was the maximum width of the taskbar buttons. They seemed to narrow, while a lot of room was available.
After a couple minutes of searching, I found a direction in the Mint forums. The proposed solution is for Mint 20 – for Mint 21, it has a minor difference.
Edit, as root, the following file:
/usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/constants.js
The value we’re after is MAX_BUTTON_WIDTH
, which I increased from 150
to 210
.
What caught my attention, though, is how all the layout building stuff is JavaScript.
A deb package can be installed on Linux by running:
sudo dpkg -i Package.deb
However, the installation may fail because dependencies are missing. In such cases, I found a tip which appears to work very well. After the failed dpkg
command, run:
sudo apt-get -f install
This a shorthand for --fix-broken
, and installs the dependencies and completes the aborted dpkg
installation. Like magic.
I decided to show the current Git branch at my bash prompt whenever I’m at a directory which contains a repository. I found a rather convoluted Bash-esque solution, which I adapted to myself:
gitbranch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' } #export PS1="\u@\h \[\e[32m\]\w \[\e[91m\]\$(gitbranch)\[\e[00m\]$ " export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\e[33m\]\$(gitbranch)\[\e[00m\]\$ "
It’s compact and it works as intended.
Sometimes, after you mess up too much with your Git repository, it ends up with a couple useless objects, which are no longer referenced anywhere.
I created this alias a while ago, collected from sources I don’t remember anymore, to perform a cleanup in the repository. It’s particularly useful right after a git fetch
:
alias gitcleanrepo='git fetch origin --prune && git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc "$@"'
When commiting code on Git, very often I realize I forgot some little detail right after I end the commit operation. This is very annoying. Fortunately, we have the amend command. Recently I found a very cool trick to use with amend command: updating the date and time of the commit together with amend.
So, with those in hand, I’m now using a nice alias on my ~/.bashrc
file:
alias gitamend='git commit --amend --date="$(date -R)"'
And my own memory faults are now easily addressed.