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
import org.fourthline.cling.UpnpService; | |
import org.fourthline.cling.UpnpServiceImpl; | |
import org.fourthline.cling.model.message.header.STAllHeader; | |
import org.yasukawa.inventory.upnp.InventoryUpnpRegistryListener; | |
import org.yasukawa.inventory.upnp.UpnpController; | |
public class App { | |
public static void main(String[] args) throws Exception { |
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
$ npm install node-upnp-ssdp upnp-device-client |
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
var ssdp = require('node-upnp-ssdp'); | |
var UPnPDeviceClient = require('upnp-device-client'); | |
var mqtt = require('mqtt'); | |
var clientId = 'kenta-upnp-gateway'; | |
var mqttOptions = { clientId: clientId }; | |
var mqttEndpoint = 'mqtt://beam.soracom.io'; | |
var mqttClient = mqtt.connect(mqttEndpoint, mqttOptions); |
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/sh | |
# Check if the registry image is already installed | |
IS_INSTALLED=`docker images | grep -E 'registry\s*latest' | wc -l` | |
if [ $IS_INSTALLED == 0 ]; then | |
. /opt/elasticbeanstalk/hooks/common.sh | |
# Load ElasticBeanstalk environment variables | |
touch /tmp/env.sh |
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 | |
. /opt/elasticbeanstalk/hooks/common.sh | |
# Load ElasticBeanstalk environment variables | |
touch /tmp/env.sh | |
chmod 600 /tmp/env.sh | |
jq .docker.env[] $EB_CONFIG_FILE | tr -d \" > /tmp/env.sh |
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/env ruby | |
require 'rubygems' | |
require 'aws-sdk' | |
@ec2 = AWS::EC2.new({:region => ENV['AWS_DEFAULT_REGION']}) | |
@eips_to_assign = ARGV # [EIP1 EIP2 EIP3 EIP4 ...] | |
DEBUG=false | |
def self.main |
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/sh | |
[[ -n "$1" && -n "$2" ]] || { echo "Usage: $0 <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ..."; exit 0 ; } | |
IIF=$1 | |
OIF=$2 | |
shift | |
shift | |
SRC_MACADDR=`ip link show $OIF | awk '/ether/ {print $2}' | tr -d :` |
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/sh | |
VIP=$1 | |
IF=$2 | |
# Determine the interface's MAC address | |
MAC=`ip link show $IF | awk '/ether/ {print $2}'` | |
# Determine ENI ID of the interface | |
ENI_ID=`curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MAC/interface-id` |
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/sh | |
IF=$1 | |
# Gets MAC address of the interface | |
MY_MAC_ADDR=`ip link show $IF | awk '/ether/ {print $2}'` | |
# Get the ID of the subnet that the interface is connected to | |
MY_SUBNET_ID=`curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MY_MAC_ADDR/subnet-id 2> /dev/null` |
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/sh | |
LVS_IP=172.31.24.1 | |
TABLE=1 | |
ip route flush table $TABLE | |
ip route show | grep -Ev ^default | while read ROUTE; do | |
ip route add table $TABLE $ROUTE | |
done | |
ip route add table $TABLE default via $LVS_IP | |
ip rule del from all fwmark 1 |
NewerOlder