This file contains 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
# Atualizar o sistema | |
sudo apt-get update | |
# Instale o cú rl ( haha ) | |
sudo apt-get install curl | |
# Agora vai a rvm :) | |
curl -L https://get.rvm.io | bash -s stable |
This file contains 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
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.deb | |
sudo dpkg -i elasticsearch-1.4.2.deb |
This file contains 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
Rodar webbrick em todas as pastas da sua maquina ;) | |
ruby -run -ehttpd . -p8000 | |
#processador de imagens => sudo apt-get install imagemagick | |
#mysql2 need => sudo apt-get install libmysql-ruby libmysqlclient-dev | |
#MYSQL SERVER => sudo apt-get install mysql-server | |
#Nood js => sudo apt-get install nodejs | |
#Lib Java Runtime => sudo apt-get install libv8-dev | |
This file contains 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
require 'mechanize' | |
agent = Mechanize.new.get("http://www.mepergunte.com/index_novas_respostas.php") | |
total = agent.links.count | |
total.times do |i| | |
puts agent.links[i].href | |
agent2 = Mechanize.new.get("http://www.mepergunte.com/"+ agent.links[i].href ) | |
agent2.links.count.times do |j| | |
a = agent2.links[j].href.to_s && j | |
t = a[0].scan('http://mepergunte.s3.amazonaws.com/usuarios/') | |
puts t if t != [] |
This file contains 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
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
This file contains 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
<?php | |
// sudo apt-get install vnstat | |
// sudo vnstat -u -i eth0 | |
// sudo vnstat -i eth0 | |
$results = shell_exec("vnstat -m --oneline"); | |
$resultsArray = explode("\n", trim($results)); | |
$servidorArray = explode(";", $resultsArray[0]); | |
$data = $servidorArray[2]; |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
deploy@VilaDeFabiano:~/viladefabiano$ bundle exec sidekiq | |
2014-07-10T16:12:28Z 2270 TID-45f4w INFO: Booting Sidekiq 2.17.7 with redis options {} | |
2014-07-10T16:12:28Z 2270 TID-45f4w INFO: Running in ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] | |
2014-07-10T16:12:28Z 2270 TID-45f4w INFO: See LICENSE and the LGPL-3.0 for licensing details. | |
2014-07-10T16:12:28Z 2270 TID-45f4w INFO: Starting processing, hit Ctrl-C to stop | |
2014-07-10T16:12:28Z 2270 TID-ld0ss Sidekiq::Extensions::DelayedMailer JID-5642f1b11420d41d6a72ae42 INFO: start | |
2014-07-10T16:12:59Z 2270 TID-ld0ss Sidekiq::Extensions::DelayedMailer JID-5642f1b11420d41d6a72ae42 INFO: fail: 30.35 sec | |
2014-07-10T16:12:59Z 2270 TID-ld0ss WARN: {"retry"=>true, "queue"=>"default", "class"=>"Sidekiq::Extensions::DelayedMailer", "args"=>["---\n- !ruby/class 'UnsubscribeMailer'\n- :unsubscribe_confirmation\n- - !ruby/object:Subscriber\n attributes:\n id: 1\n email: henrique@breim.com.br\n verification: b8d7429816da0d522de0f707bea1fc47\n |
This file contains 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
# Controller | |
def nome_da_action | |
format.html {redirect_to :back, notice: "Enviado!"} | |
format.js | |
end | |
# Dentro da view do controle, o arivo nome_da_action.js.erb |
This file contains 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
package br.com.empresa.projeto; | |
public class Main { | |
public static void main(String[] args) { | |
for (int i = 1; i<=3000000; i++){ | |
System.out.println(i); | |
} | |
} | |
} |
OlderNewer