Skip to content

Instantly share code, notes, and snippets.

aws kinesis create-stream --stream-name Foo --shard-count 1
aws kinesis describe-stream --stream-name Foo
aws kinesis list-streams
aws kinesis put-record --stream-name Foo --partition-key 123 --data testdata
SHARD_ITERATOR=$(aws kinesis get-shard-iterator --shard-id shardId-000000000000 --shard-iterator-type TRIM_HORIZON --stream-name Foo --query 'ShardIterator')
aws kinesis get-records --shard-iterator $SHARD_ITERATOR
Copy the value from Records > Data
Decode it here: https://www.base64decode.org
aws kinesis delete-stream --stream-name Foo
aws kinesis describe-stream --stream-name Foo
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active October 20, 2025 02:36
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@rochacbruno
rochacbruno / ACCESS_ELASTIC.md
Last active May 3, 2024 19:15
Docker-compose wait-to-start

When unsing docker compose you can have a problem with the order of dependent linked containers

The solution is to start a script which tries to access a service and waits until it gets ready before loading your program

Go Bootcamp

All of the course material is open source and available here. I took the 3 day language class. You can find the agenda here.

Highlights

Slices of Slices

Slices of slices behave a little differently than I expected.

@sadikovi
sadikovi / SystemSimulation.scala
Created February 25, 2015 09:23
Example of Gatling scenario that uses complex authentication with response processing (asking for auth-token, encrypting it, sending back, verifying logon). Each "browsing" request is sent, and based on response several sub-requests are generated, imitating drill-down into some piece of data on a website.
package systemsimulation
import io.gatling.core.Predef._
import io.gatling.core.session._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import general._
class SystemSimulation extends Simulation {
// configure proxy
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active July 24, 2025 16:11
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@kimmobrunfeldt
kimmobrunfeldt / node-exports-styles.js
Last active July 1, 2023 18:39
A few Node module export styles. 1 seems to be the most used and I prefer it
// Style 1
// Export all manually
// Good: Calling functions inside the module is convenient
// Bad: module.exports becomes verbose and it's tedious to add new functions
function a() {
b()
}
@tadast
tadast / ssl_puma.sh
Last active September 23, 2025 21:04 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key

Figure out a good standard for how to use the HTTP response codes in a 'truly RESTful' (Now called 'Hypermedia API' apparently) way.

Summary

@krames
krames / monitoring_dev.md
Last active December 21, 2015 23:09
This is a quick crash course on fog development.

#Cloud Monitoring Pairing

Using curl with Rackspace Cloud

Authenticate

To authenticate with the Rackspace Cloud, execute the following curl command substituting USERNAME and API_KEY with the appropriate values:

curl -s https://identity.api.rackspacecloud.com/v2.0/tokens -X 'POST' \