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 [email protected]:luispuerto/bash-custom-commands.git
git clone https://github.com/luispuerto/bash-custom-commands.git # if you prefer http protocol
Then 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 bash
And 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-brew
It executes a brew update, upgrade and a cleanup.
This command updates R packages
up-r-pacakges
It 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-all
If 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-openblas
You 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-reinstall
subldiff <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-bluetooth
This just resent the bluetooth device on your Mac.
reset-sound
This 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-app
The 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-services
Sometime 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-sync
This is just restarting the notification center
fix-notifications
This just fix the google drive icon folder when this is updated.
fix-gdrive-icon
So we can build rjava
from source
pcre2-libs-ln
So I upload my resume to Dropbox after I update it and I publish on my site.
resume-upload
This is a function to reset the desktop and closing and opening some apps.
reset-desktop
This is a function to reset the 1Password 7 app.
reset-1pw
This is a function to close and open again DEVONthink 3.
reset-dt
I think it's benefitial when you are connecting to VPN to flush DNSs if you have connection problems.
dnsflush