This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p ~/.ssh | |
# generate new personal ed25519 ssh keys | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>" | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>" | |
# generate new host cert authority (host_ca) ed25519 ssh key | |
# used for signing host keys and creating host certs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>SSH Client</title> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:ok, connection} = AMQP.Connection.open | |
{:ok, channel} = AMQP.Channel.open(connection) | |
message = Enum.join(System.argv, " ") || "Hello World!" | |
AMQP.Exchange.declare(channel, "logs", :fanout) | |
AMQP.Basic.publish(channel, "logs", "", message) | |
IO.puts " [x] Sent '#{message}'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Sends HAL signals to the given MQTT broker host. | |
# | |
# usage: hal2mqtt.py [hostname] | |
# | |
# Video demo at https://www.youtube.com/watch?v=uFbr7xBjItE | |
# | |
# sudo apt-get install mosquitto mosquitto-clients python-mosquitto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// formatName: the image format name (jpeg, png) | |
public static InputStream resizeImage(InputStream inputStream, int width, int height, String formatName) throws IOException { | |
BufferedImage sourceImage = ImageIO.read(inputStream); | |
Image thumbnail = sourceImage.getScaledInstance(width, height, Image.SCALE_SMOOTH); | |
BufferedImage bufferedThumbnail = new BufferedImage(thumbnail.getWidth(null), | |
thumbnail.getHeight(null), | |
BufferedImage.TYPE_INT_RGB); | |
bufferedThumbnail.getGraphics().drawImage(thumbnail, 0, 0, null); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
ImageIO.write(bufferedThumbnail, formatName, baos); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "Applying the Saga pattern with AWS Lambda and Step Functions", | |
"StartAt": "BookHotel", | |
"States": { | |
"BookHotel": { | |
"Type": "Task", | |
"Resource": "arn:aws:lambda:us-east-1:{AccountID}:function:lambda-saga-dev-book-hotel", | |
"Catch": [ | |
{ | |
"ErrorEquals": ["States.ALL"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const Converter = require('./converter.js'); | |
const options = { | |
name: process.argv[3], | |
description: process.argv[4], | |
activate: process.argv[5], | |
}; | |
const converter = new Converter(JSON.parse(fs.readFileSync(process.argv[2])), options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: https://github.com/tzutalin/labelImg/issues/141 | |
# create conda env using python 2.7 | |
conda create -n py2 python=2.7 | |
source activate py2 | |
# install necessary libs using conda install | |
conda install pyqt=4 | |
conda install libxml2 | |
conda install lxml |
OlderNewer