avatar

Andres Jaimes

Common git commands

Imagine you’re a developer working on a project that’s stored in a remote Git repository. Your first step is to clone the repository using the command git clone git@github.com:some-account/some-project.git.

Once you’ve cloned the …

Generate a random string using the console

Generate a random string using the command line:

1cat /dev/urandom | tr -cd [:graph:] | head -c 32

On OSX, the previous command might return a tr: Illegal byte sequence error, so try:

1export LC_ALL=C; cat /dev/urandom | tr -cd [:graph:] | head -c 32 …

Undoing the Last Git Commit

A command so important, it deserves its own page:

1git reset --soft HEAD~1

The previous command undoes the last commit to git. I think this is one of those commands that I have typed many times during the last year. It’s very important to know …

iptables snippets

iptables is the default firewall you see on any linux computer. It works by allowing (ACCEPTing) or denying (DROPing) connections to the local computer. There are basically three scenarios you can deal with:

  1. INPUT: Connections generated from a …