Skip to content

Instantly share code, notes, and snippets.

@moisoto
moisoto / macOS_oh-my-zsh_plugins.md
Created April 22, 2024 21:31
macOS: Oh-My-ZSH Plugins

Oh-My-ZSH Plugins

These plugins will work standalone on many Linux OS, or directly on your ~/.zshrc I'll list here the way to install them on Oh-My-ZSH but will list the repositories in case you want to install them in other fashion.

zsh-autosuggestions

To install on Oh-My-ZSH run the following:

@moisoto
moisoto / GitHub_Publishing_GO_Package.md
Created December 7, 2023 23:12
GitHub - Publishing you Go Package

Publishing your Package

Go Module!

If you haven't already go and make your package a module:

# This assumes you have your package located at ~/go/src/github.com/your_account/your_package
go mod init github.com/your_account/your_package
go mod tidy
@moisoto
moisoto / git_workflow-simplified.md
Created November 29, 2023 16:43
GIT - Workflow Simplified

Git Workflow Simplified

Create a local Repository

If you want to work on your machine and don't need a remote repository, or you want to upload your repository at a later time, you can create a local repository:

# Initialize a new repository
git init
@moisoto
moisoto / Git_private-repositories.md
Created November 16, 2023 17:44
GIT - Working with Private Repositories

Working with Private Repositories

Using SSH Authorization Key on Github

The first step will be to add your public key to github:

  • Go to Settings -> SSH and GPG Keys (currently https://github.com/settings/keys).
  • Create a SSH Authentication Key, you can use your current id_rsa public key (you should have the private key loaded on ~/.ssh/id_rsa).
  • You can clone your private repository by using the git clone command like this:
git clone git@github.com/your_user/some_private_repo.git

Undo Branch Changes

This article will show you how to revert changes in your current branch to a previous state.

Going to a previous commit

The most simple scenario is when you want to go back to a previous commit for all files.

A simple way to do this is use the checkout command.

Mounting AWS Volumes on Ubuntu Servers

Checking for the new Volume

After attaching the volume to the instance, you can check the device list. The new device will be listed as created recently:

$ ls -l /dev | grep xvd
brw-rw---- 1 root disk    202,   0 Jul 13  2020 xvda
brw-rw---- 1 root disk    202,   1 Jul 13  2020 xvda1

Markdown for the footnote link1:

Markdown for the footnote link<sup id="a1">[1](#f1)</sup>:

1 This is the footnote markdown:

<b id="f1">1</b> This is the footnote markdown:[](#a1)
@moisoto
moisoto / macOS_GitHub_Using_Token_Authentication.md
Last active August 17, 2021 01:14
macOS / GitHub - Using Token Authentication

GitHub - Using Token Authentication

Since August 13, 2021 GitHub is no longer allowing users to access repositories with username/password authentication. This will affect users accesing github repositories from command line clients.

You will need to create a Personal Access Token (PAT) if you wish to continue accessing your repositories from the command line.

Instructions for how to create a PAT can be found on GitHub. It's a simple process and at the time of this writing it consists on going to your profile's Developer Settings at Your Github profile -> Settings -> Developer Settings (click on your profile picture to find the link to Your GitHub profile).

When creating yor access token for accessing your repositories it is better if you set an expiration date[*](#f1

macOS / Xcode 12 - Recover space used by Xcode Device Simulators

Check your current Simulators:

To check the simulators currently installed in your system:

$ xcrun simctl list

Check Occupied Space:

Making ZSH your default shell

If you are on macOS Catalina, your default shell is most likely zsh but to make sure, run the following commands:

# Check your default shell:
echo $SHELL

# Check your current shell (if you configured your terminal to use a specific shell different front your default):
ps -o comm= $$