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 | |
CONTAINER=${STREAM}_${ISLAND_NAME}_1 | |
CONTAINER_ID=$(docker ps -a | grep ${CONTAINER} | awk '{print $1}') | |
# exception check if the container exists | |
if [ ! ${CONTAINER_ID} ]; then | |
echo "There is no ${CONTAINER}" | |
exit 1 | |
fi |
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
#sudo apt-get install ia32-libs | |
ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 ~/.local/share/Steam/ubuntu12_32/libGL.so.1 |
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
I believe you can connect gdb to a running valgrind process, and instruct it to run a leak check explicitly. | |
I haven't tried this, just seen it in the docs. | |
In case of link breakage: | |
Connecting GDB to a Valgrind gdbserver | |
$ valgrind --tool=memcheck --vgdb=yes --vgdb-error=0 ./prog | |
(the error parameter is the number of errors before the gdbserver becomes active: zero means it starts running right away). |
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 | |
# | |
# generates an 8 bit color table (256 colors) for | |
# reference purposes, using the \033[48;5;${val}m | |
# ANSI CSI+SGR (see "ANSI Code" on Wikipedia) | |
# | |
echo -en "\n + " | |
for i in {0..35}; do | |
printf "%2b " $i | |
done |
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
# console.log("\x1b[36m sometext \x1b[0m"); | |
# console.log("\x1b[31m sometext \x1b[0m"); | |
# console.log("\033[31m\033[40m sometext \033[0m"); | |
# console.log("\x1b[31m\x1b[40m sometext \x1b[0m"); | |
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each |
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
process.on('unhandledRejection', (reason, p) => { | |
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); | |
// application specific logging, throwing an error, or other logic here | |
}); | |
process.on('uncaughtException', function (err) { | |
console.error('Unhandled Rejection at:', err.stack); | |
// application specific logging, throwing an error, or other logic here | |
console.log('NODE will not be terminated.'); | |
}); |
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
http://stackoverflow.com/questions/38841204/events-js160-throw-er-unhandled-error-event | |
--- | |
events.js:160 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: Channel closed by server: 404 (NOT-FOUND) with message "NOT_FOUND - no exchange 'exchange_name_final' in vhost '/'" | |
at Channel.C.accept (/home/nilath/test/rabbitmq/node_modules/amqplib/lib/channel.js:406:17) |
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 Promise = require('bluebird'); | |
var redis = Promise.promisifyAll(require('redis')); | |
var redis = require('bluebird').promisifyAll(require('redis')); |
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
alias babel-node='babel-node --presets stage-0' | |
------ RECV ------ | |
// babel-node recv2.js "#" | |
// babel-node recv2.js "kern.*" | |
const amqp = require('amqplib'); | |
const args = process.argv.slice(2); | |
if (args.length == 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
// Code for checking the behavior of Consul | |
var Promise = require('bluebird'); | |
var Consul = require('consul'); | |
var consul = Consul({host: "localhost", promisify: true}); | |
// Session Create | |
consul.session.create({ | |
name: "test-java-script", | |
ttl: "600s", |