Skip to content

Instantly share code, notes, and snippets.

View stephenlb's full-sized avatar
😁
Coding Python, Rust, JavaScript, AI

Stephen Blum stephenlb

😁
Coding Python, Rust, JavaScript, AI
View GitHub Profile
@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 / evangelism.md
Last active March 2, 2016 23:56
PubNub Evangelism Program
@stephenlb
stephenlb / subscribe.sh
Last active July 8, 2021 18:19
Bash and Shell Command PubNub Subscribe in One Line - Basic TCP Subscribe Calls
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## URL Variables
## http://p.pubnub.com/stream/<SUBKEY>/<CHANNEL>/0/-1
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## Demo Stream
while true; do (printf 'GET http://p.pubnub.com/stream/sub-c-5f1b7c8e-fbee-11e3-aa40-02ee2ddab7fe/pubnub-sensor-network/0/-1 HTTP/1.1\r\nHost: pubnub\r\n\r\n'; sleep 5) | nc p.pubnub.com 80; done
## Local tunnel
curl "http://0.0.0.0:80/publish/demo-36/demo-36/0/ch6/0/1"
@stephenlb
stephenlb / network-rate.sh
Last active January 24, 2020 23:17
Network Throughput Bandwidth Rate Consumption Linux Command
#!/bin/bash
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- USAGE -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
##
## ./network-rate.sh eth0
##
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
tx_bytes=0
@stephenlb
stephenlb / chatroom-security.md
Last active November 21, 2021 16:27
Chatroom Security

Chat User Identification with Digital Signature Message Verification

You can identify the sender by creating a Unique ID as well as a Name attached to the message payload of the chat conversation. This is similar to IRC strategies but a bit more simplistic.

var user_id      = PUBNUB.uuid();
var user_name    = name.value;
var user_message = input.vaule;
@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
@stephenlb
stephenlb / micro-pubnub-sdk.js
Last active February 6, 2016 04:59
PubNub Mini-SDK for js13kgames.com - Look below for Usage Example.
(function(){
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Request URL
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
var requester = window.requester = function(setup) {
var xhr = new XMLHttpRequest()
, finished = false
, timeout = setup.timeout || 5000
@stephenlb
stephenlb / animated-gif.md
Last active April 8, 2026 01:36
DIY How to make your own HD Animated GIF Generator

HD Animated GIF Generator

You can make your own HD animated GIF generator.
Follow along with these commands to get started.

HD Animated GIF Generator

git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg