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 / setup_crystal_shards.sh
Last active May 10, 2016 21:36
Install crystal and shards to run spec in cricle.ci
#!/bin/bash
# Usage: circle.yml
# dependencies:
# cache_directories:
# - shards
# - libs
# pre:
# - curl http://to.azk.io/install_crystal_and_shards | sudo bash
# - shards install
@nuxlli
nuxlli / Azkfile.js
Created November 3, 2015 20:37
"bins" example in Azkfile
aliases({
bundle : { command: ["bundle", "exec"]}, // system: azkdemo (default)
scaffold : { alias: "bundle", append: ["rails", "g", "scaffold"]},
test : { alias: "bundle", append: ["rake", "test"], tty: true, context: 'test'},
'import-db': { system: "mysql", command: ["mysql"], depends: false}
});
// azk script generator --path ./script
// ./script/bundle
// ./script/scaffold
@nuxlli
nuxlli / README.md
Created September 15, 2015 21:24
azk cron example

Exemplo de como é possível usar um system do Azkfile.js para rodar uma tarefa.

Passo a passo

Se já não existir criei uma pasta scripts na pasta do projeto onde esta seu Azkfile.js, e adicione o arquivo ./scripts/cron.sh com o seguinte conteúdo:

#!/bin/bash
@nuxlli
nuxlli / export.sh
Created June 10, 2015 00:53
Export azk balancer to a public interface
# No mac ou linux
sudo ncat --sh-exec "ncat dev.azk.io 80" -l 80 --keep-open
# Apenas no linux
(
public_interface="eth0";
docker_ip=`ip -o -4 add show docker0 | awk '{print $4}' | cut -d/ -f1`;
echo iptables -t nat -A PREROUTING -i ${public_interface} -p tcp -m tcp \
--dport 80 -j DNAT --to-destination ${docker_ip}:11000;
)
@nuxlli
nuxlli / virtualbox.sh
Created May 24, 2015 13:41
Listando e ajustando as placas de rede do VirtualBox
# Lista as placas de redes e suas configurações de ip
VBoxManage list hostonlyifs
# Lista os servidores de dhcp configurados para as placas e suas faixas de ip
VBoxManage list dhcpservers
# Remove um servidor de dhcp e a placa de rede
VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0
VBoxManage hostonlyif remove vboxnet0
@nuxlli
nuxlli / agent_start.sh
Created April 23, 2015 19:02
Run azk agent in a script
#!/bin/bash
echo "" > /tmp/azk-agent-start.log
./bin/azk agent start --no-daemon > /tmp/azk-agent-start.log 2>&1 &
AGENT_PID="$!"
tail -f /tmp/azk-agent-start.log &
TAIL_PID="$!"
echo "PIDS - agent: ${AGENT_PID}, tail: ${TAIL_PID}";
until tail -1 /tmp/azk-agent-start.log | grep -q 'Agent has been successfully started.'; do
sleep 2;
@nuxlli
nuxlli / slack.css
Created April 18, 2015 01:32
Custom slack css
.light_theme .message {
color: #fff;
font-size: 40px;
}
#msgs_div {
background-color: #000;
}
.light_theme .message_sender {
@nuxlli
nuxlli / mail.js
Last active May 20, 2016 11:53
Azk templates examples
questions({
add_depends: question("Qual sistema depende de mail"),
});
systems({
mail: {
// Dependent systems
depends: [ ],
image: { docker: "schickling/mailcatcher" },
http: {
@nuxlli
nuxlli / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nuxlli
nuxlli / Azkfile.js
Last active August 28, 2020 04:23
Azkfile.js with custom dns
/**
* Mac Users:
* Add a file /etc/rsolver/my.domain.com
* nameserver [ip from dev.azk.io]
* port 5353
*
* Linux Users:
* Add a file /etc/rsolver/my.domain.com
* nameserver [ip from dev.azk.io]:5353
*