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
#!/sbin/runscript | |
# Copyright 1999-2012 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: $ | |
depend() { | |
need net | |
} | |
start() { |
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
## Lets suppose that we want to merge path/to/my/file.txt from branch_a into branch_b | |
# We start in branch_b | |
git checkout branch_b | |
# We create an intermediate branch | |
git checkout -b intermediate_branch | |
# We merge merge_a into that | |
git merge branch_a |
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
`nslookup my.workshare.com 8.8.8.8` | |
list = %w{ | |
8.8.8.8 | |
8.8.4.4 | |
156.154.70.1 | |
156.154.71.1 | |
208.67.222.222 | |
208.67.220.220 | |
198.153.192.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
# Generate fingerprint from public key | |
ssh-keygen -lf id_rsa.pub | |
# Forward keys | |
# ~/.ssh/config | |
host * | |
ForwardAgent yes | |
# Make forwarded keys available to root | |
sudo su -l -c "export SSH_AUTH_SOCK=$SSH_AUTH_SOCK; bash" |
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
# From http://stackoverflow.com/questions/5513558/executing-code-for-every-method-call-in-a-ruby-module | |
class ChattyArray < Array | |
Array.instance_methods.each do |name| | |
m = instance_method(name) | |
define_method name do |*args, &block| | |
# puts caller.grep(/app_name/) if name == :certain_method | |
puts ([name] + args).inspect | |
m.bind(self).(*args, &block) | |
end | |
end |
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
User.connection.select_values User.select('id').to_sql | |
# => [1,2,3,4] |
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
# From http://systembash.com/content/delete-directories-older-than-week/ | |
for i in `find /home/backup/ -maxdepth 1 -type d -mtime +7 -print`; do echo -e "Deleting directory $i";rm -rf $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
# Guess which device is it | |
$ sudo cat /etc/mtab | grep /media/Pendrive | |
/dev/sdb1 /media/Pendrive vfat rw,utf8,umask=007,gid=46 0 0 | |
# Unmount and format | |
sudo umount /media/Pendrive | |
sudo mkfs.vfat -n Pendrive -I /dev/sdb1 |
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
wget http://apache.rediris.es/lucene/solr/3.4.0/apache-solr-3.4.0.tgz | |
tar zxvf apache-solr-3.4.0.tgz | |
cd apache-solr-3.4.0/ | |
mkdir ../solr | |
cp -r example/* ../solr/ | |
# cp -r ../ey-cloud-recipes/cookbooks/solr/files/default/conf/ ../solr/solr/ | |
mkdir ../solr/solr/lib | |
cp dist/apache-solr-cell-3.4.0.jar ../solr/solr/lib/ | |
cp contrib/extraction/lib/*jar ../solr/solr/lib/ | |
cd ../solr |
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 b43-fwcutter firmware-b43-installer # and restart | |
# In Ubuntu 13.04 was | |
sudo apt-get remove bcmwl-kernel-source | |
jockey-gtk | |
# Install the BCM driver |