Skip to content

Instantly share code, notes, and snippets.

View lfir's full-sized avatar
🏠
Working from home

Leandro lfir

🏠
Working from home
View GitHub Profile
@lfir
lfir / find-files-not-accessed.sh
Created January 19, 2021 12:13
Find files in the home directory not accessed in a certain time
# Replace X with the number of days.
# Found files can be deleted by appending option -delete.
# Access time must be supported by the file system and
# enabled (noatime option not present in /etc/fstab).
find "$HOME" -atime +X -type f
@lfir
lfir / minified-js-css-from-repo-branch-jsdelivr.txt
Created April 11, 2020 01:38
Minified js/css from repository branch using jsdelivr
Replace username, repo, branch, path, file & ext with target values.
Instead of branch name a commit id or release version can also be used.
https://cdn.jsdelivr.net/gh/username/repo@branch/path/file.min.ext
@lfir
lfir / upd-conda-envs.sh
Created April 21, 2018 22:33
update all conda venvs/prefixes
#!/bin/bash
#tested with conda 4.5.0
envs_dir=$(conda config --show | grep -A 1 envs_dirs | grep -oE '/.+$')
find "$envs_dir" -mindepth 1 -maxdepth 1 -type d -exec conda update --all --prefix {} \;
#alternative method
#cd "$envs_dir" || exit
@lfir
lfir / lightdm-autologin.sh
Last active August 14, 2017 12:30
Set autologin in lightdm configuration file to the currently logged in user.
#!/bin/bash
#Tested on Fedora 25 MATE (lightdm version 1.18.3).
conf=$"[SeatDefaults]
autologin-user=$USER
autologin-user-timeout=0"
echo "$conf" | sudo tee '/etc/lightdm/lightdm.conf.d/custom-local.conf'
#Another way but may be overwritten with updates.