Skip to content

Instantly share code, notes, and snippets.


Rohit Bhute rvbhute

View GitHub Profile
rvbhute /
Created May 26, 2018 — forked from erlepereira/
Using DNSMasq as a caching nameserver & add in a malware etc blocking

Assuming a Properly configured DNSMasq

a quickstart for dnsmasq is given at the end if you have not set it up yet.

something like this will add a great regularly updated malware file for it to use. More security and privacy to you! Specifically, this uses Choose one of the Raw Hosts file from there to use.

To setup DNSMasq, follow the below ...

wget -O- | awk '$1 == "" { print "address=/"$2"/"}' > /etc/dnsmasq.d/malware.conf`
rvbhute /
Created Nov 23, 2017 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
View apache_cors_example
# Sets CORS headers for request from and pages
# for both SSL and non-SSL
SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
Header set Access-Control-Allow-Credentials "true" env=ORIGIN
# Always set Vary: Origin when it's possible you may send CORS headers
Header merge Vary Origin