Skip to content

Instantly share code, notes, and snippets.

View stephenlb's full-sized avatar
😀
Coding with Rust

Stephen Blum stephenlb

😀
Coding with Rust
View GitHub Profile
## gem install pubnub
require 'pubnub'
pubnub = Pubnub.new(
:subscribe_key => 'sub-c-44d3418c-4855-11e4-8a5b-02ee2ddab7fe',
:publish_key => 'pub-c-eae49ba3-b1ee-46c4-8674-27ce042e7ab3'
)
## Get Latest Dashboard and Modify Revenue
pubnub.history( :channel => '', :count => 1 ) do |response|
@stephenlb
stephenlb / .bashrc
Last active August 29, 2015 14:07
Mac Terminal Backup Files
export PS1="\u:\w$ "
alias ..='cd ..'
alias ...='cd -'
alias l='ls -lsrtahG'
alias ls='ls -hG'
alias c='cd '
alias v='vim '
@stephenlb
stephenlb / sproggiwood-crash
Created November 2, 2014 17:32
Sproggiwood Crash 2014-11-02 (November 2nd)
Process: Sproggiwood [4006]
Path: /Users/USER/Library/Application Support/Steam/*/Sproggiwood.app/Contents/MacOS/Sproggiwood
Identifier: unity.Freehold Games.Sproggiwood
Version: Unity Player version 4.5.5f1 (4.5.5f1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Sproggiwood [4006]
User ID: 501
Date/Time: 2014-11-02 09:30:06.104 -0800
@stephenlb
stephenlb / README.md
Last active August 29, 2015 14:11
Secure PubNub Subscriber Key and Channel Name by Securing Data Streams on PubNub with ACL / Access Management

Securing Data Streams on PubNub with ACL / Access Management

You want to Secure the PubNub Subscriber Key and the Channel Name too. With fine grain read and write access control on a per-connection level you can Provide Authorization and access control to users, devices and channels.

Good Part - With PubNub Access Management and ACL you can prevent someone from setting up their own PubNub client and receive the notifications without any authorization.

@stephenlb
stephenlb / metasploit-install.sh
Last active August 29, 2015 14:12
Creating a Metasploit Server
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## Your Metasploit Server
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Download VirtualBox: https://www.virtualbox.org/wiki/Downloads
# Download Ubuntu Server: http://www.ubuntu.com/download/server
#
# Create VirtalBox image named "Metasploit"
# Add Ubuntu ISO CD
# Follow Install Guide Below
@stephenlb
stephenlb / storage-and-playback.md
Created January 11, 2015 03:13
How do I use the start, end and count parameters in a history request?

###How does the count parameter affect the history result when both start and end timestamps are specified?

The count parameter restricts the number of messages to return (with a max of 100 per request). This remains true regardless of other parameters used in the request - start, end or reverse

If both start and end parameters are provided, the reverse parameter is ignored and the traverse direction is assumed to be from start towards end always. The request will return a max of 100 messages if no count is provided, otherwise the result will be restricted to whatever the count parameter is set to if < 100.

See more about using history in the tutorials and the API reference on our docs site.

@stephenlb
stephenlb / mqtt.py
Last active August 29, 2015 14:23
MQTT PubNub Demo
#!/usr/bin/python
from mosquitto import Mosquitto
publish_key = "demo"
subscribe_key = "demo"
channel_name = "F"
client_uuid = "2fb96def5"
mqtt_hostname = "mqtt.pubnub.com"
mqtt_connect = publish_key + "/" + subscribe_key + "/" + client_uuid
mqtt_topic = publish_key + "/" + subscribe_key + "/" + channel_name
@stephenlb
stephenlb / gist.sh
Created July 20, 2015 22:35
GitHub Gist 302 Redirect Failure
~$ curl -v https://gist.github.com/7756459c939b76e021c5.js?file=esp8266_hooks.c
* Connected to gist.github.com (192.30.252.143) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.github.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
/* ----------------------------------------------------------------------------
JavaScript Easy Date Function Similar to PHP but with JS Function Names minus 'get'
"Today is Thursday the 7th in January 2010. The time is 5:28pm and 46 Seconds."
jsdate(
'Today is {Day} the {Date}{DateSuffix} in {Month} {FullYear}. ' +
'The time is {HalfHours}:{Minutes}{AMPM} and {Seconds} Seconds.'
);
// config file: nodejuice.js
// Example StaticMatic configuration.
// -> http://localhost:3010
exports.sidekick = {
host : null, // Leave 'null' to listen on all hosts.
port : 3010, // access your server from this port.
fetch : { // point to your web server.
host : 'localhost',
port : 3000