This is a small repo with some bash custom commands I use. Mainly to update software in a easier way.
- How to use install
- Dependencies
- Update & Upgrade Commands - Update Homebrew - Update R packages - Update all - Link R to openBLAS - Reinstall Command Line Tools
- Other commands - diff files with sublimemerge - Reset the bluetooth - Reset sound - Fix mail app - Fix Share Services - Fix iOS sync - Fix notification center - Fix Google Drive Icon - Add pcre2 to R - Upload resume - Reset desktop - Reset 1Password 7 - Reset DEVONthink 3 - Flux DNS
Pretty easy. Just clone this repo:
git clone git@github.com:luispuerto/bash-custom-commands.git
git clone https://github.com/luispuerto/bash-custom-commands.git # if you prefer http protocolThen in bash or zsh you have to source updating-software.sh in your shell config file. More info here but basically:
open ~/.zshrc # for zsh
open ~/.bash_profile #for bashAnd paste something like:
source ~/path/to/bash-custom-commands-repo/updating-software.sh
Open and close the terminal —or whatever you are using— and that's it.
This command will perform a general update of all the Homebrew packages.
up-brewIt executes a brew update, upgrade and a cleanup.
This command updates R packages
up-r-pacakgesIt upgrades all R packages in your machine.
This updates oh-my-zsh, brew packages, r packages, gems, App Mac Store Apps and macOS system.
up-allIf you want to use openBLAS on your R install from the binary you need to link it manually using a symbolic link. This command do it for you.
r-openblasYou have to run it every time you updates or reinstall R.
Sometimes when the system updates mess up with the command line tools install and they have to be reinstalled, this command is for that.
command-line-tools-reinstallsubldiff <file1> <file2>This is a command that uses SublimeMerge3 as a diff tool. You should have Sublime Text and this package installed to make it work properly.
reset-bluetoothThis just resent the bluetooth device on your Mac.
reset-soundThis just resent the coreudiod service.
The mail app sometimes it's a little slow opening. It seems that /Users/lpuerto/Library/Containers/com.apple.mail/Data/DataVaults/MailBundles/Library/Mail/Bundles/Properties.plist gets corrupted or something. This function just delete it and the next time mail opens the file gets recreated.
fix-mail-appThe share services sometimes doesn't work as expected when you change the size of the monitor you are using. Like for example you are using the laptop screen and you change to an external monitor, or the other way around.
The command will force kill the Messages Share Services and the TelegramShare.
fix-share-servicesSometime I can't reboot or turn off the computer because the iOS sync is in progress but jammed. The best thing to do is to kill the process that make the sync to happen AMPDeviceAgent. This function will kill it for you.
fix-ios-syncThis is just restarting the notification center
fix-notifications
This just fix the google drive icon folder when this is updated.
fix-gdrive-iconSo we can build rjava from source
pcre2-libs-lnSo I upload my resume to Dropbox after I update it and I publish on my site.
resume-uploadThis is a function to reset the desktop and closing and opening some apps.
reset-desktopThis is a function to reset the 1Password 7 app.
reset-1pwThis is a function to close and open again DEVONthink 3.
reset-dtI think it's benefitial when you are connecting to VPN to flush DNSs if you have connection problems.
dnsflush