Skip to content

Instantly share code, notes, and snippets.

View SathyaRupa's full-sized avatar

sathya-12 SathyaRupa

View GitHub Profile
# file location: ${HOME}/.gitignore
!.bundle/config
!.keep
__pycache__
.~lock*#
.babel.json
.boxfuse/
@SathyaRupa
SathyaRupa / capture-defaults.sh
Created March 5, 2024 04:05
Export or import settings from any macos application (whether system app or custom installed app). Caveat: Stores data in binary format specific to macos
#!/usr/bin/env bash
# file location: Put this anywhere in the path.
# This script will capture (export) the settings or import the settings from the location specified in the $TARGET_DIR env var defined down below. You can back the files up to any cloud storage and retrieve into the new laptop to then get back all settings as per the original machine. The only word of caution is to use it with the same OS version (I haven't tried in any situations where the old and new machines had different OS versions - so I cannot guarantee if that might break the system in any way)
# A trick to find the name of the app:
# Run `defaults read` in an empty window of a terminal app, then use the search functionality to search for a known word related to that app (like eg app visible name, author, some setting that's unique to that app, etc). Once you find this, trace back to the parent in the printed JSON to then get the real unique name of the app where its settings are stored.
#!/usr/bin/env zsh
# Note: This script is specific to my setup and not useful for others.
# You can run this script using this command:
# curl -L https://gist.github.com/SathyaRupa/edc8673dbb7be4afc8560f500b732d46/raw -o fresh-install-vijay.sh; chmod +x ./fresh-install-vijay.sh; ./fresh-install-vijay.sh
# These env vars are duplicated intentionally since this script would bootstrap the installation
USERNAME=${USERNAME:-$(whoami)}
PERSONAL_PROFILES_DIR=${PERSONAL_PROFILES_DIR:-"${HOME}/Personal/${USERNAME}/profiles"}
PERSONAL_BIN_DIR=${PERSONAL_BIN_DIR:-"${HOME}/.bin"}
# file location: ~/.gitconfig
# Note:
# [Windows users] If you are on windows, please search for the word 'windows' - and fix those lines - they seem to cause some trouble
# [General] Since some of the settings are specific to my setup (ie presence of fles), I have marked those lines with comments 'Personal' - you can go ahead and change those to your equivalents or delete them altogether
# [General] Since I use 'diff-so-fancy' as the diffing tool, it's absence on your system will cause some errors. If you are able to, I would sincerely urge you to install and use it for a much better experience. If not, please replace all such occurrences back to use 'diff'
# Note: Even though this will show up twice in `git config -l` - it will still be overridden based on the order of the includeIf lines below
[includeIf "gitdir/i:~/"] # Personal
path = ~/.gitconfig-oss.inc # Personal
@SathyaRupa
SathyaRupa / Brewfile
Last active March 1, 2024 07:45
Brewfile
# file location: ~/.brewfile
# This file is used along with the `brew bundle` command to ensure that required packages and apps are installed.
# Also can be used to ensure that any package/apps that were installed as experimentation are uninstalled from the system.
# If you are starting such a file on a machine where you have already installed some apps using brew, then use `brew bundle dump` to create this file and avoid starting from scratch
# If you have also installed some vscode plugins already (manually), then you can use the following command to export that list:
# code --list-extensions
# For a more detailed explanation of the philosophy/reasoning behind this file, please see https://openfolder.sh/macos-migrations-with-brewfile
@SathyaRupa
SathyaRupa / fresh-install-of-osx.sh
Last active June 22, 2024 07:21 — forked from vraravam/fresh-install-of-osx.sh
Steps to get "up and running" with new Mac OSX
#!/usr/bin/env zsh
# This script can be used to setup a macos machine based on Vijay's configurations. As of now, this script is idempotent and will restore your local setup to the same state if run multiple times.
# If you have the same files already present, it will prompt you whether to override or not
# file location: <anywhere> (just need to invoke it from that location)
# You can run this script using this command:
# curl -L https://gist.github.com/SathyaRupa/1f05266704ba26eed79ed928ec9b59e2/raw -o fresh-install.sh; chmod +x ./fresh-install.sh; ./fresh-install.sh
# BEFORE STARTING TO RUN THIS SCRIPT (for the first time on a new machine)