Skip to content

Instantly share code, notes, and snippets.

View Cloudxtreme's full-sized avatar

Kevin Hatfield Cloudxtreme

  • CloudCDN
View GitHub Profile
@Cloudxtreme
Cloudxtreme / DNSMasq_withMalwareBlocking.md
Created October 9, 2018 16:52 — forked from erlepereira/DNSMasq_withMalwareBlocking.md
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 https://github.com/StevenBlack/hosts Choose one of the Raw Hosts file from there to use.

To setup DNSMasq, follow the below ...

wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | awk '$1 == "0.0.0.0" { print "address=/"$2"/0.0.0.0/"}' > /etc/dnsmasq.d/malware.conf`
@Cloudxtreme
Cloudxtreme / proxy_switch.sh
Created September 4, 2018 20:59 — forked from jameswomack/proxy_switch.sh
Bash/ZSH for changing git/npm/global proxy info based on current Wifi SSID on Mac
alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
CURRENT_WIFI_SSID=$(eval airport -I | grep '^[[:space:]]*SSID' | sed -e 's/^.*SSID: //g')
proxy() {
export addy='http://www-west.sony.com:80'
git config --global http.proxy $addy
git config --global https.proxy $addy
npm config set http-proxy $addy
npm config set https-proxy $addy
@Cloudxtreme
Cloudxtreme / powssl
Created July 11, 2018 17:26 — forked from paulnicholson/powssl
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@Cloudxtreme
Cloudxtreme / convert id_rsa to pem
Created December 2, 2017 04:02
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
@Cloudxtreme
Cloudxtreme / generate_html_directory_index.py
Created December 2, 2017 04:00
Generate HTML directory index
#!/usr/bin/env python
import argparse
import fnmatch
import os
import sys
# Recursively generate index.html files for
# all subdirectories in a directory tree
@Cloudxtreme
Cloudxtreme / remove-annoying-fixed-headers-footers.js
Created December 2, 2017 04:00
Bookmarklet to remove annoying non-scrolling elemets such as headers/footers on a web page.
// pure js
javascript:
(function(){
var elems=document.body.getElementsByTagName("*");
var len=elems.length;
for(var i=0;i<len;i++){
if(window.getComputedStyle(elems[i],null).getPropertyValue('position')=='fixed'){
var el = elems[i];
el.parentNode.removeChild(el);
}
@Cloudxtreme
Cloudxtreme / Export-OSX-Notes-to-HTML.applescript
Created December 2, 2017 03:57
Export notes from the OSX Notes.app to separate HTML files prefixed with the creation timestamp.
on buildTitle(originalText)
set normalizedText to my replace(originalText, ":", "-")
set normalizedText to my replace(normalizedText, "|", "")
set normalizedText to my replace(normalizedText, "{", "")
set normalizedText to my replace(normalizedText, "}", "")
set finalTitle to my firstChars(normalizedText, 30)
return finalTitle
end buildTitle
on replace(originalText, fromText, toText)
@Cloudxtreme
Cloudxtreme / README.md
Created August 2, 2016 22:56 — forked from evotopid/README.md
Chromium Updater - Mac OS X

Information

This is an updater script for the open source Web browser Chromium for the people (probably mostly developers) who want to stay on the bleeding edge version of Chromium.

It's made for Mac OS X. It downloads a copy from the build server and unpacks it to the right destination. You should shut down Chromium before running this, because it could lead to various problems if you don't.

@Cloudxtreme
Cloudxtreme / gist:1c7ebe5f00988135eb5bee8c365c4351
Created June 2, 2016 01:40 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/*
Author: Twily
Description: Minimal flat styled tabs for Australis
Compitability: Firefox Nightly v31.0a1 - v32.0a1 (Australis)
CSS Variables were introduced to Firefox in v29.0a1
Website: http://twily.info/
*/