Thursday, September 26, 2013

Reverse DNS Lookup Zone File and Whitespace

I have been struggling to get my reverse look up working on my DNS (bind) server for a LONG time... The problem I finally figured out:

$TTL 3D
@       IN      SOA     ns.linux.bogus. hostmaster.linux.bogus. (
                        199802151 ; Serial, todays date + todays serial
                        8H      ; Refresh
                        2H      ; Retry
                        4W      ; Expire
                        1D)     ; Minimum TTL
                NS      ns.linux.bogus.

; NO WHITESPACE!!!!
    1               PTR     gw.linux.bogus.
    2               PTR     ns.linux.bogus.
    3               PTR     donald.linux.bogus.
    4               PTR     mail.linux.bogus.
    5               PTR     ftp.linux.bogus.

See the spaces in front of the 1, 2, etc...? Those cannot be there for whatever reason.

Tuesday, September 24, 2013

Is Prism a reverse hoax?

I always figure things out before everyone else, but I never tell anyone about it. This time is going to be different.

Which is more likely:
  1. Our government actually thinks they could keep a monstrous scam like Prism a secret from the masses?

  2. Or the possibility that our government is willing to take a black eye PR wise in order to make bad guys *think* that they are being monitored therefore making their lives more difficult with relatively little effort?
I would actually be pretty impressed if the latter were to be the case. I'm way too cynical to believe it, but wouldn't that be great to find out that our government is actually doing all this to scam the terrorist?

This is similar to what I have heard said that Ronald Regan did to the Soviets with the Star Wars project. Made them think we were dumping tons of research into this project to the point they couldn't compete and they tore down that wall.

Here's hoping.

Friday, September 20, 2013

Restore previous version of a file from GIT repository

From the surprisingly helpful stackoverflow.com, regarding how to restore a file from GIT:

Find the last commit that affected the given path. As the file isn't in the HEAD commit, this commit must have deleted it.
git rev-list -n 1 HEAD -- <file_path>
Then checkout the version at the commit before.
git checkout <deleting_commit>^ -- <file_path>
Or in one command, if $file is the file in question.
git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"

Thursday, September 12, 2013

VLC Fine Speed Control shortcut keys

I'm always forgetting this. In VLC if you want to increase/decrease playback speed use + or -, but that only works in big chunks. For smaller increments use [ and ].

Tuesday, September 10, 2013

Generating entropy quickly

I wrote a script to generate passwords for users, but it runs very slow at times. The solution was to install rng-tools.

From http://www.101tech.net/2011/11/01/apg-automated-password-generator-runs-slow-on-centos/

# apt-get install rng-tools
# echo "rngd -r /dev/urandom -o /dev/random -t 3" >> /etc/rc.local
# rngd -r /dev/urandom -o /dev/random -t 3

EDIT:
After reading this posting by Theodore Ts'o maybe using this isn't such a great idea as it is basically a bridge to the possibly compromised RNG instruction in the Intel processor.

Thursday, September 5, 2013

Bash one liner

I can't believe it took me this long to figure this out but an easy way to do one liners in bash for multiple files:
~$ for name in *.pdf; do pdftotext "$name"; done