Skip to content

Instantly share code, notes, and snippets.

View nuxlli's full-sized avatar
🎯
Focusing

Everton Ribeiro nuxlli

🎯
Focusing
View GitHub Profile
@nuxlli
nuxlli / ccat.sh
Created December 19, 2014 17:37
Same of cat, but with colors \o/
#!/bin/bash
# Font: http://scott.sherrillmix.com/blog/programmer/syntax-highlighting-in-terminal/
if [ ! -t 0 ];then
file=/dev/stdin
elif [ -f $1 ];then
file=$1
else
echo "Usage: $0 code.c"
@nuxlli
nuxlli / error.sh
Created November 4, 2014 19:22
refactoring source path error
azk: Error: one test error
azk: at Cmd.<anonymous> (/AZK_v0.6.1-dev/src/cmds/info.js:13:13)
azk: at eval (eval at <anonymous> (/Users/nuxlli/Work/azuki/azk/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:589:32)
azk: at nextOrThrow (eval at <anonymous> (/Users/nuxlli/Work/azuki/azk/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:496:21)
azk: at GeneratorFunctionPrototype.next (eval at <anonymous> (/Users/nuxlli/Work/azuki/azk/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:516:14)
azk: at /AZK_v0.6.1-dev/src/utils/index.js:86:26
azk: at /AZK_v0.6.1-dev/src/utils/index.js:63:24
azk: From previous event:
azk: at /AZK_v0.6.1-dev/src/utils/index.js:69:16
azk: at node.js:906:3
@nuxlli
nuxlli / generator_arq.js
Created October 29, 2014 16:33
Arquitetura de julgamento do generator do azk
// rails 4, node.js, mysql
/*
Rules = investigator + jury
Generator.detect [
[Rules].investigate();
Generator.judgment();
[Rules].verdict();
]
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
function ruby_system(command, extra) {
var merge = require('azk')._.merge;
var extra = extra || {};
return merge({
// Dependent systems
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
var ruby_system = function(command) {
return {
// Dependent systems
depends: ["postgres", "mongodb", "redis", "mail"],
// More images: http://images.azk.io
image: "gullitmiranda/ruby",
@nuxlli
nuxlli / Azkfile.js
Last active August 29, 2015 14:06
New volumes options in Azkfile.js
systems({
app: {
// ...
mounts: {
// equivalent mount_folders
'/azk/root' : '/',
'/azk/app' : path('.'),
'/azk/demos' : path('../demos', { required: false }),
'/azk/Gemfile': path('./Gemfile', { mode: 'r' }), // File example
@nuxlli
nuxlli / Azkfile.js
Last active August 29, 2015 14:06
azk mongo and postresql example
systems({
mongodb: {
scalable: false,
ports: {
http: "28017",
}
http : {
hostname: "#{manifest.dir}-#{system.name}.#{azk.default_domain}",
},
persistent_folders : [ "/data/db" ],
@nuxlli
nuxlli / Azkfile.js
Last active February 25, 2016 21:20
Example of use of `azk` to control a node.js and mysql application
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
'node-example': {
// Dependent systems
depends: ['mysql'],
// More images: http://images.azk.io
@nuxlli
nuxlli / valgrind.log
Created August 14, 2014 18:58
Log of the valgrind for nss_resolver
[==========] Running 3 test(s).
[ RUN ] gethostbyname_unknown_name_test
[ OK ] gethostbyname_unknown_name_test
[ RUN ] resolver_by_nameserver_test
==14327== Conditional jump or move depends on uninitialised value(s)
==14327== at 0x404B4C: ares_init_options (in /azk/resolver-nss/build/test)
==14327== by 0x4019DD: resolver_by_servers (resolver.c:97)
==14327== by 0x40276B: resolver_by_nameserver_test (test.c:88)
==14327== by 0x503F16B: _run_test (in /usr/local/lib/libcmocka.so.0.2.1)
==14327== by 0x503FA0F: _run_group_tests (in /usr/local/lib/libcmocka.so.0.2.1)
@nuxlli
nuxlli / avahi.js
Created August 9, 2014 17:32
Adding alias in `.local` domain, using avahi
/*
* Require: lodash, dbus-native
* Referencies:
* http://www.avahi.org/wiki/Examples/PythonPublishAlias
* https://github.com/airtonix/avahi-aliases
* http://code.metager.de/source/xref/freedesktop/avahi/avahi-python/avahi/__init__.py
*/
var _ = require('lodash');
var dbus = require('dbus-native');