Skip to content

Instantly share code, notes, and snippets.

View brianddk's full-sized avatar

brianddk

View GitHub Profile
@brianddk
brianddk / 0_ServerLessRepo.md
Last active August 29, 2015 14:18
Git Server-less repo / remote setup

#Git Server-less repo / remote setup This is an example of how to setup two directories to serve as a local and remote in the GIT protocal. Basically GIT is like the old RCS system where all things are filesystem based. All the SSH and HTTPS sugar are just spice

###Demo.cmd walkthrough

  • First 13 lines just set up directories.
  • Line 14 creates the remote repo (bare for remote).
  • Line 17 creates the local repo (no bare here).
  • Line 18 adds the remote repo that we set up in line 14 as a 'file://' url.
  • Next we create a file, add it and commit it
  • Line 22 we push with the
@brianddk
brianddk / gist_api.py
Last active August 29, 2015 14:18
Gist API Example
# [rights] Copyright Dan B. (brianddk) 2015 https://github.com/brianddk
# [license] Licensed under Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0
# [repo] https://gist.github.com/brianddk/fb5a7e4b55e323b83745
# [version] 0.2
# [tips] 18MDTTiqPM8ZEo29Cig1wfGdkLNtvyorW5
import getpass
import json
import requests
user = raw_input("GitHub Username: ")
@brianddk
brianddk / Get-TempSensors.ps1
Last active August 29, 2015 14:18
Pull Sensor Data from WMI via POSH
# [rights] Copyright Dan B. (brianddk) 2015 https://github.com/brianddk
# [license] Licensed under Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0
# [wget] Powershell -Command Invoke-WebRequest http://git.io/venKD -Outfile Get-TempSensors.ps1
# [comment] http://git.io/veZTZ
# [note] http://goo.gl/tFEG3o blog post to graph data
# [tips] 18MDTTiqPM8ZEo29Cig1wfGdkLNtvyorW5
$classes = @()
$instances = @()
$foundItems = @{}
$namespaces = Get-WmiObject -Namespace "root" __NAMESPACE
@brianddk
brianddk / AllGistHere.md
Created April 5, 2015 23:54
All Gist in One folder

How to put one gist in one branch

I have been trying to learn git, so I gave myself a number of challenges. This challenge was to have all of my Gists in one git controlled directory called 'gist', without having to merge all of them checked out.

Init gist directory

Do a git init to init gist directory

$ mkdir gist
$ cd gist
$ git init
@brianddk
brianddk / 0_file.md
Last active August 29, 2015 14:18
Test Readme

@brianddk
brianddk / chrome_edlie.py
Created April 13, 2015 15:14
Script to use selenium to get private reports from edline
# selenium http://www.seleniumhq.org/download/
# chromedriver https://sites.google.com/a/chromium.org/chromedriver/downloads
# docs http://selenium-python.readthedocs.org/en/latest/index.html
import time, sys, os
from getpass import getpass
try:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
except:
print "###\n", "Required modules missing, to acquire:\n", "\t'pip install selenium wget'"
# [rights] Copyright Dan B. (brianddk) 2015 https://github.com/brianddk
# [license] Licensed under Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0
# [repo] https://gist.github.com/brianddk/7890f3ea9543a588edaa
# [tips] 18MDTTiqPM8ZEo29Cig1wfGdkLNtvyorW5
$REAL = 0x100
$HIGH = 0x80
$ABOVE = 0x8000
$NORM = 0x20
$BELOW = 0x4000
$IDLE = 0x40
@brianddk
brianddk / pull-ssh.sh
Created April 17, 2015 05:40
how to get ssh fingerprint
ssh-keyscan -t rsa github.com > out.txt
ssh-keygen.exe -lf out.txt
@brianddk
brianddk / 0_Readme.mediawiki
Last active August 29, 2015 14:19
Windows Snowden kit

Privacy / Encryption

The following will give some background on how privacy is maintained on the internet. Simple and accurate examples may include the opening scenes of Citizen 4 where the author decrypts an message from Snowden. As fanciful as this sounds, this is exactly how most of the traffic on the internet is secured. The process uses something called public-key cryptography coupled with symmetric-key algorithms. The basics of how this works are actually pretty simple to understand and I'll touch on in a bit. These forms and methods are used in much of the web traffic on the web, and even happened when you visited this site. The 's' in the 'https' for this web URL uses both of these methods to secure the connection and scramble the traffic. Now, as opposed to walking you through how 'https' (aka SSL) works, I'm going to cover a protocol c