Sep 08, 2015

Check the a file permission number on linux

Here is how to check a specific file/folder permission number on Linux

stat -c %a /home

This will return something like:

755

Untracking and removing already pushed files in Git

I had the problem of wanting to remove and ignore files that I have already commit-ed to git. Turns out, it's pretty simple:

  1. Add the files you want to ignore to your .gitignore file
  2. To unstage and remove paths only from the index, not the file system, run:
    git rm -r --cached .
  3. Run:
    git add .
  4. Run:
    git commit -m "Removed sensitive files"

The files/paths listed in .gitignore should now be gone from the repository but should still exist in your file system.

Note: This will not remove files already pushed to your git repository. To remove sensitive data already pushed, see this article

Sep 05, 2015

Initiate zone transfer using Dig

Dig is a DNS lookup utility. You can use Dig to initiate a DNS zone transfer from a DNS server that allows it. This is useful to for finding sensitive information such as hostnames.

dig @<dnsserver> <domain> axfr

For example:

dig @dns.example.org example.org axfr