Skip to content

luispuerto/shell-custom-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 

Repository files navigation

Shell Custom Commands 🖥️

This is a small repo with some bash custom commands I use. Mainly to update software in a easier way.

How to use install

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.

Dependencies

  • Homebrew 🍺.
  • mas: brew install mas.
  • trash: brew install trash.
  • Of course, R, Ruby, Python 😃 too​.

Update & Upgrade Commands

Update Homebrew

This command will perform a general update of all the Homebrew packages.

up-brew

It executes a brew update, upgrade and a cleanup.

Update R packages

This command updates R packages

up-r-pacakges

It upgrades all R packages in your machine.

Update all

This updates oh-my-zsh, brew packages, r packages, gems, App Mac Store Apps and macOS system.

up-all

Link R to openBLAS

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.

Reinstall Command Line Tools

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

Other commands

diff files with sublimemerge

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 the bluetooth

reset-bluetooth

This just resent the bluetooth device on your Mac.

Reset sound

reset-sound

This just resent the coreudiod service.

Fix mail app

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

Fix Share Services

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

Fix iOS sync

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

Fix notification center

This is just restarting the notification center

fix-notifications

Fix Google Drive Icon

This just fix the google drive icon folder when this is updated.

fix-gdrive-icon

Add pcre2 to R

So we can build rjava from source

pcre2-libs-ln

Upload resume

So I upload my resume to Dropbox after I update it and I publish on my site.

resume-upload

Reset desktop

This is a function to reset the desktop and closing and opening some apps.

reset-desktop

Reset 1Password 7

This is a function to reset the 1Password 7 app.

reset-1pw

Reset DEVONthink 3

This is a function to close and open again DEVONthink 3.

reset-dt

Flux DNS

I think it's benefitial when you are connecting to VPN to flush DNSs if you have connection problems.

dnsflush

About

These are some custom commands I use in my system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages