Skip to content

Instantly share code, notes, and snippets.

@ethauvin
Last active December 5, 2023 19:40
Show Gist options
  • Save ethauvin/424470046b37008bd77a6a2047bc0cb4 to your computer and use it in GitHub Desktop.
Save ethauvin/424470046b37008bd77a6a2047bc0cb4 to your computer and use it in GitHub Desktop.
ubuntu snippets

A collection of Ubuntu snippets.

# Install held back pakages
apt --with-new-pkgs upgrade <list of packages>
# Force install pacakge
apt download <package>
dpkg --force-all -i ./<package.deb>
# Purge old config files
aptitude purge ?config-files
aptitude purge ~c
# Search only installed packages
aptitude search '~i keyword'
# Search descriptions
aptitude search '~d keyword'
sudo pkill --oldest chrome
duply cfg_name status
duply cfg_name list
duply cfg_name fetch /etc/passwd /root/pw 4D
fail2ban-client set YOURJAILNAMEHERE unbanip IPADDRESSHERE
fail2ban-client get YOURJAILNAMEHERE ignoreip
dpkg-reconfigure lightdm
ocrmypdf -c -d -s -r -O 3 foo.pdf bar.pdf
pdftoppm input.pdf outputname -png -f {page} -singlefile
pdftotext -layout input_file.pdf [output.pdf]
tabula -o output.csv input.pdf
# upgrade package
pip install <package_name> --upgrade
pip install <package_name> -U
# List rules
ufw status
ufw status verbose
ufw status numbered
# Add/Remove rules
ufw allow 1234/tcp
ufw delete allow 1234/tcp
# List available apps
ufw app list
# Add / Remove app
ufw allow <appname>
ufw delete allow <appname>
# Add / Remove app LAN only
ufw allow from 10.0.0.0/24 to any app <appname>
ufw delete allow from 10.0.0.0/24 to any app <appname>
update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment