Skip to main content

Remove git branches older than X months

1 min read

For the example, we're deleting merged branches older than 3 months :

for k in $(git branch --sort=committerdate --remote --merged | grep -o -P "(?<=origin\/)[^ ]+"); do
  if [[ ! $(git log -1 --since='3 month ago' -s origin/$k) ]]; then
    git push --delete origin $k
  fi
done

QuteBrowser and LastPass

2 min read

I've been using QuteBrowser for the past 2 days (more on that later), and the only thing I missed so far was a LastPass integration.

Now, QuteBrowser does not come with a plugin store like Firefox or Chrome, but it is still possible to use LastPass with it.

First we need to install lastpass-cli and login to the service. I'm running Manjaro Linux on my laptop so I use yaourt :

yaourt lasstpass-cli

Now we login to Lastpass :

lpass login <email@domain.tld>

A prompt pops-up, asking for your master password. If everything went right, the CLI should responds with

Success: Logged in as <email@domain.tld>.

Since we're good to go, we can now download the QuteBrowser userscripts :

mkdir -p $/.local/share/qutebrowser/userscripts && cd $_

wget https://raw.githubusercontent.com/welps/qutebrowser/9a85796ac30ef33218dd7dee9db6a3c28364f668/misc/us...

chmod +x qute-lastpass

The script is installed. We can restart QuteBrowser by typing :restart.

Now everytime you need to find your login/password for a given page type :spawn --userscript qute-lastpass

Troubleshooting

Process stderr:
Traceback (most recent call last):
File "/home/cedric/.local/share/qutebrowser/userscripts/qute-lastpass", line 50, in <module>
import tldextract
ModuleNotFoundError: No module named 'tldextract'

Solution : pip install tldextract --user

FileNotFoundError: [Errno 2] No such file or directory: 'lpass': 'lpass'

Solution : install lastpass-cli

FileNotFoundError: [Errno 2] No such file or directory: 'rofi': 'rofi'

Solution : install rofi