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 / shortcut-function.sh
Last active February 2, 2019 02:46
shortcut for command run in virtualenv with pipenv
# add to ~/.bashrc
shortcutName() {
cd /path/to/app/dir || return
pipenv run command "$@"
cd - &> /dev/null
}
@lfir
lfir / gist:0ab66161023a8c8d1e5f38d8c2fa29e1
Last active November 27, 2018 14:59
Make pipenv use working pip 18.0
# to create environment the first time
pipenv --python 3.6 install pip==18.0
# if it already exists
pipenv run pip install pip==18.0
https://github.com/pypa/pipenv/issues/2924
@lfir
lfir / gist:72e71a2b59b764ea45167b068c6055ac
Created November 22, 2018 14:44
electron appimage disable desktop integration prompt
To disable — create file $HOME/.local/share/appimagekit/_no_desktopintegration works
https://github.com/electron-userland/electron-builder/issues/1962#issuecomment-352531262
disables for all apps, for some (i. e. Discord) Discord_no_desktopintegration works
@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
~$ gdb mate-volume-control-applet
GNU gdb (GDB) Fedora 8.0.1-33.fc27
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
:~$ gdb mate-volume-control-applet
GNU gdb (GDB) Fedora 8.0.1-33.fc27
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@lfir
lfir / pulse-audio-auto-switch-output-device.sh
Last active January 9, 2018 19:11
PulseAudio auto switch output device
# Automatically switch to Bluetooth or USB headset when connected.
# Add the following to /etc/pulse/default.pa or ~/.config/pulse/default.pa:
load-module module-switch-on-connect
# Restart pulseaudio with the following command:
pulseaudio -k && pulseaudio --start
@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.