Get mac addresses:
ifconfig -a | grep HWaddr | tr -s " " | cut -d' ' -f5
Output:
b8:27:eb:34:53:7e //eth0
/* | |
DESCRIPTION | |
----------- | |
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum: | |
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699 | |
CODE REPOSITORY | |
--------------- | |
https://gist.github.com/806605 |
The plan is to create a pair of executables (ngrok
and ngrokd
) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok
to connect to this ngrokd
, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com
, you'll need a record for that and for *.domain.com
.
from __future__ import print_function | |
import dbus | |
import sys | |
import dbus.service | |
import dbus.mainloop.glib | |
import gobject as gobject | |
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | |
bus = dbus.SystemBus() |
# create a mongo app | |
flynn create --remote "" mongo | |
# create a release using the latest (at the time of writing) Docker MongoDB image | |
flynn -a mongo release add -f config.json "https://registry.hub.docker.com?name=mongo&id=216d9a0e82646f77b31b78eeb0e26db5500930bbd6085d5d5c3844ec27c0ca50" | |
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a mongo ps" and it should come up. | |
flynn -a mongo scale server=1 | |
# mongo should now be running in the cluster at mongo.discoverd:27017 |
tl;dr This blog post describes the best way to host private Docker Registry instance on Amazon EC2 and Amazon S3. You can skip the lyrics and go to the 'Resources' section to get the ECS Task Definition JSON.
When working with microservices nowadays you can hardly avoid using Docker. After building your first Docker container your next step woudl be to share it with the world (or your colleauge). To achieve it you have three alternatives:
For a small project the Docker Hub 'way' is the best alternative, you can host one 'private' image for free, where commercial pricing plans will allow you to upload more. For a more serious projects we would like to re
An example of bootstrapping dynamic data onto the page, and then exposing it for programmatic access with rttc.compile()
. This makes it possible to expose our view locals in our client-side js for access in the browser. This example uses Sails.js, but is equally applicable for Hapi or Express.
UPDATE: Check out balderdashy/sails#3522 and https://github.com/mikermcneil/expose-locals-to-browser-xss-test-app
Let's assume you are building a website about vampires.
/** | |
* Module dependencies | |
*/ | |
var SailsApp = require('sails').Sails; | |
// e.g. `jobs/clean-up-orphaned-images` | |
var sails = new SailsApp(); | |
sails.load({ hooks: {grunt: false} }, function afterwards(err) { | |
if (err) { |
#!/bin/bash | |
# | |
## redis backup script | |
## usage | |
## redis-backup.sh port backup.dir | |
port=${1:-6379} | |
backup_dir=${2:-"/data/backup/redis"} | |
cli="/usr/local/bin/redis-cli -p $port" |
#!/bin/bash | |
DOCKER_IP=$(ip addr show docker0|grep "inet "|sed -e 's/^[ ]*//g'| cut -d ' ' -f 2| cut -d '/' -f 1) | |
docker stop redis_0 | |
docker stop redis_1 | |
docker stop sentinel_0 | |
docker stop sentinel_1 | |
docker stop sentinel_2 |