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
# This file should be placed at /etc/logrotate.d/ | |
/srv/*/shared/log/*.log { | |
daily | |
missingok | |
dateext | |
rotate 30 # amount of days to keep compressed logs (you should backup it up externally) | |
compress | |
delaycompress | |
notifempty |
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
function wait_run_in_parallel() | |
{ | |
local number_to_run_concurrently=$1 | |
if [ `jobs -np | wc -l` -gt $number_to_run_concurrently ]; then | |
wait `jobs -np | head -1` | |
fi | |
} | |
function get_status() { | |
local line=$1 |
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
import System.Linq.Enumerable | |
words = ("blueberry", "chimpanzee", "abacus", "banana", "apple", "cheese") | |
wordGroups = words.GroupBy({ w | w[0] }) | |
for g in wordGroups: | |
print "Words that start with the letter $(g.Key):" | |
for word in g: print "\t$word" |
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
# Bit.ly API implementation - thanks to Richard Johansso http://gist.github.com/112191 | |
require 'httparty' | |
class Api::Bitly | |
include HTTParty | |
base_uri 'api.bit.ly' | |
format :json | |
# Usage: Bitly.shorten("http://example.com") | |
def self.shorten(url) |
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
Passos que segui para conseguir instalar a gem mysql2, | |
pois o comando de forma tradicional gem install mysql2 não estava funcionando. | |
1) locate mysql_config | |
Não listava nada, porém tenho mysql rodando aqui com PHP. | |
2) brew install mysql | |
3) locate mysql_config | |
/Applications/MAMP/Library/bin/mysql_config |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: APPLICATION | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the APPLICATION unicorns at boot | |
# Description: Enable APPLICATION at boot time. | |
### END INIT INFO |
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
#Output | |
<div class="section"> | |
<h3>Sample Title</h3> | |
<div class="in"> | |
<div class="field"> | |
<label>Date</label><br/> | |
<input id="name" name="name" type="text"> | |
</div> | |
</div> | |
</div> |
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
#!/bin/bash | |
# must run as root!!! | |
RUBY_VERSION=1.9 | |
RUBY_PATCH=1.9.3-p429 | |
#RUBY_PATCH=1.9.3-p385 | |
#RUBY_PATCH=1.9.3-p286 | |
#RUBY_PATCH=1.9.3-p194 |
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 /tmp | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git | |
git checkout v`git --version | awk '{print $3}'` | |
cp contrib/completion/git-completion.bash ~/.git-completion.bash | |
cd ~ | |
rm -rf /tmp/git | |
echo -e "source ~/.git-completion.bash" >> .profile |
OlderNewer