Skip to content

Instantly share code, notes, and snippets.

@mabroor
mabroor / global-gitignore.md
Created November 28, 2017 14:48 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@mabroor
mabroor / keybase.md
Created October 24, 2017 11:10
keybase.md

Keybase proof

I hereby claim:

  • I am mabroor on github.
  • I am mabroor (https://keybase.io/mabroor) on keybase.
  • I have a public key whose fingerprint is 1BD4 33E6 9D50 9C9A 86BE 04CC D290 B737 5A83 16C9

To claim this, I am signing this object:

@mabroor
mabroor / password.sh
Created January 27, 2017 14:25
Generate a secure URLsafe password
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
@mabroor
mabroor / print_without_comments.sh
Created February 8, 2016 20:41
cat lines of a config file without the comments
egrep -v "^\s*(#|$)" /etc/squid/squid.conf
git ls-files --deleted -z | xargs -0 git rm
@mabroor
mabroor / 0_reuse_code.js
Created November 3, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mabroor
mabroor / .htaccess
Created November 1, 2015 09:54 — forked from donnykurnia/.htaccess
.htaccess for 503 maintenance page
ErrorDocument 503 /index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.html [R=503,L]
@mabroor
mabroor / pedantically_commented_playbook.yml
Created October 6, 2015 10:51 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@mabroor
mabroor / README.md
Last active November 3, 2015 14:21 — forked from mattupstate/README.md
PostgreSQL Streaming Replication With Docker

PostgreSQL Streaming Replication With Docker

The *.txt files here hold user and database parameters. Specifically, replication.txt contains the user/role and password to use for replication. Whereas database.txt contains an initial database, user/role and password to create on the master.

Run the master:

$ fig run -d master

Wait for it to start up completely. Start the slave: