Friday, February 28, 2020

Backing up dot files in my home folder

In spending some time with customizing my machine, I have some heavily modified configuration files within my home folder.  As a good measure, here's a way to help backup dot files in your home folder:

$ tar cvfz my_dotfile_backup-$(date +"%Y-%m-%d").tar.gz --exclude .file_to_exclude --exclude .vscode  ~/\.*

The above will:
    • c = create a tarball
    • v = verbose
    • f = write the output to the specificed file
    • z = compress the output file with gzip. 
    • Output filename will be "my_dotfile_backup-" + the date the command was run in YYYY-MM-DD format + ".tar.gz"
    • Exclude files matching .file_to_exclude, and .vscode
    • ~ = My home folder
    • \.* Escaped dot character then wildcard (meaning the filename needs to start with a .)
Here's an example output of when the command above was run:

$ ls -l my_dot*

-rw-r--r--  1 arojas  staff  30093272 Feb 28 12:17 my_dotfile_backup-2020-02-28.tar.gz

Monday, February 10, 2020

Update Sublime Text to automatically default a particular filetype



Found this nugget today on Stack Overflow:
https://stackoverflow.com/questions/7574502/set-default-syntax-to-different-filetype-in-sublime-text-2

In a nutshell, Colin R a user from Stack Overflow suggested that the following steps can be used to set the defaults for all future new files opened in Sublime Text, which is much easier than having to hack around the JSON preferences.

In a nutshell, Sublime Text -> View -> Syntax -> Open all with Current Extension As... ->  Select default option.

Not exactly sure why certain options aren't available as a default, will continue digging into that: