tar -zcvf tar-archive-name.tar.gz source-folder-name
tar -zxvf tar-archive-name.tar.gz
class MyColor | |
attr_accessor :red, :blue, :green, :alpha | |
def initialize(args) | |
@red = args[:red] | |
@blue = args[:blue] | |
@green = args[:green] | |
@alpha = args[:alpha] || 1 | |
end | |
def distance(color) | |
red_diff = self.red - color.red |
User.select(:first,:email).group(:first,:email).having("count(*) > 1").count | |
#{[nil, nil]=>512, | |
# ["Joe", "test@test.com"]=>23, | |
# ["Jim", "email2@gmail.com"]=>36, | |
# ["John", "email3@gmail.com"]=>21} |
# I was trying to connect my Edimax Wifi dongle to my raspberrypi | |
# I tried configuring it using the following llink | |
# http://www.savagehomeautomation.com/projects/raspberry-pi-installing-the-edimax-ew-7811un-usb-wifi-adapte.html | |
# but Edimax would not connect to my router | |
# after refering to the following link | |
# http://www.cyberciti.biz/faq/debian-linux-wpa-wpa2-wireless-wifi-networking/ | |
# I was able to connect make the raspberrypi connect to the router. | |
# this is how my /etc/network/interfaces looks like on my raspberrypi |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
class Smokers < ActiveRecord:: Base | |
belongs_to :heart_failure_statistics | |
has_many :cigarettes | |
attr_accessor :mins_since_last_puff | |
before_validation :check_cigarettes | |
def smoke? | |
if mins_since_last_puff >= 60 | |
print("Smoke?") |
http://kvz.io/blog/2013/01/16/vagrant-tip-keep-virtualbox-guest-additions-in-sync/ |
http://stackoverflow.com/questions/22922891/vagrant-ssh-authentication-failure/23554973#23554973 |
du -chs * |
\l - to list all the databases | |
\connect <dbname> - connect to the db | |
\dt - list all the tables in the current DB |