Skip to content

Instantly share code, notes, and snippets.

@yosemitebandit
yosemitebandit / key-fingerprint
Created March 7, 2012 18:27
view your ssh public key's fingerprint; compare this to what Github has listed in the ssh key audit
$ ssh-keygen -l -f /path/to/keys/id_rsa.pub
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA)
@vidoss
vidoss / gist:2178987
Created March 24, 2012 06:20
Using underscore.js while scripting mongodb shell.
MongoDB provides a Javascript shell. But Javascript is no fun without underscore.js
Turned out its straight forward to use underscore.js while scripting mongodb.
Here are the steps.
1) Use underscore to write your db script file (say my_commands.js)
E.g: _.each(db.dbname.find().toArray(), function(itm) { ... })

Here's how you validate a mailgun webhook in Node.js (as per the mailgun docs for securing webhooks)

'use strict';

var scmp = require('scmp')
  , crypto = require('crypto')
  . mailgunPrivateKey = 'XXXXXXXXXXXXX'
  , mailgunTokens = {}
  , mailgunExpirey = 15 * 60 * 1000
@aitzol
aitzol / check_gpio.py
Created February 10, 2015 20:18
Python code to check any Raspberry Pi GPIO status
#!/usr/bin/env python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
while True:
data = raw_input("Insert GPIO BCN number to check status (blank to quit): ")
if data == '':
break
try:
@ctigeek
ctigeek / SendMailgunEmail.ps1
Last active January 2, 2023 17:36
Send an email using Mailgun in Powershell.
function Send-MailgunEmail($from, $to, $subject, $body, $emaildomain, $apikey) {
$idpass = "api:$($apikey)"
$basicauth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($idpass))
$headers = @{
Authorization = "Basic $basicauth"
}
$url = "https://api.mailgun.net/v2/$($emaildomain)/messages"
$body = @{
from = $from;
<form action='' method='post'>
LDAP DN: <input type='text' name='ldaprdn' value='<?php echo $_POST["ldaprdn"]; ?>'><br>
LDAP PASS: <input type='text' name='ldappass' value='<?php echo $_POST["ldappass"]; ?>'><br>
LDAP HOST: <input type='text' name='ldaphost' value='<?php echo $_POST["ldaphost"]; ?>'><br>
<input type='submit' value='begin test'><br>
</form>
<?php
//sleep(4);
// using ldap bind
$ldaprdn = $_POST["ldaprdn"];