Skip to content

Instantly share code, notes, and snippets.

View ryandaniels's full-sized avatar
🙃

Ryan Daniels ryandaniels

🙃
View GitHub Profile
@ryandaniels
ryandaniels / ubuntu-torrent-dl.sh
Last active August 7, 2020 01:55
Downloads the .torrent files for Ubuntu ISOs since they don't exist in just one place
#!/bin/bash
wget="wget -nc -nv"
version="20.04.1"
# Downloads the .torrent files for Ubuntu ISOs since they don't exist in just one place
# To get the iso, use a local mirror: https://launchpad.net/ubuntu/+cdmirrors
# Prep
dl_dir="./torrents"
mkdir -p "$dl_dir"
@ryandaniels
ryandaniels / profile.sh
Last active June 13, 2020 03:03 — forked from jpmens/profile.sh
tmux autostart via ssh
# .profile
...
# try to attach to tmux session or create a new one.
# Uncomment exit if you want to exit this session
# when tmux exits (e.g. detach)
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
tmux new-session -As "t-$USER-$(hostname -s)"
@ryandaniels
ryandaniels / Git Subtree basics.md
Last active March 16, 2022 10:48 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@ryandaniels
ryandaniels / firefox-user.js
Last active December 5, 2022 06:17
Firefox user.js privacy and optimization settings
/*
* Open profile dir - find in about:support or about:profiles
* Copy this file into your profile directory.
* Add changes to this file. Save file.
* Restart Firefox. Below overrides will be loaded.
* Close Firefox and open prefs.js to confirm changes merged there.
* NOTE: only non-default values will be saved to prefs.js
*
*/

Keybase proof

I hereby claim:

  • I am ryandaniels on github.
  • I am ryandaniels (https://keybase.io/ryandaniels) on keybase.
  • I have a public key whose fingerprint is CA70 6BC9 8F57 2918 75E9 43EE 4346 61BF 956C 8CC2

To claim this, I am signing this object:

@ryandaniels
ryandaniels / fix_duplicate_packages_CentOS7.md
Last active June 6, 2022 15:13
fix CentOS/RHEL duplicate packages

Aborting 'yum upgrade' can cause CentOS7/RHEL7 to have "duplicate packages" installed.

To fix, you could manually run below commands for every affected package (using correct format of package-version or just package name):

rpm -e --justdb --nodeps <package-old_version>
yum reinstall <package>

Or use below commands to avoid manual work.