Translate

Monday, August 10, 2015

How to create a symbolic Link in linux



Basically, to create a symbolic  link in Linux you have to use the  command called ln as follows:
  
    ln -s /var/www/myapp/web/ /html/customerapp

  
the command ls has two parameter the target(/var/www/myapp/web/) and the source (/html/customerapp). The target  is the existing file/diretory and the source the file to be created.


Wednesday, August 5, 2015

Routing Error No route matches [GET] "/users/logout"




The message "Routing Error No route matches [GET] "/users/logout" is because you are sending the request via get and should be delete, so to fix it you have two options:

 The first one  is the  better, change the tag  link_to to button_to, doing that, rails will  do  the dirty work to send it as  a delete request.

The second one is not recommended, since DELETE is the appropiete RESTFUL query , but it works. Got to devise.rb change  config.sign_out_via = :delete to config.sign_out_via = :get



 

Tuesday, July 14, 2015

How to find which Linux distribution and version you are using?





To know  which Linux distribution and version you have installed on your computer,  follow this  steps:

1-Open your terminal
2- Type the following command

 cat /etc/issue




Output:


Monday, June 29, 2015

How to find a computer serial number from command prompt

Serial Number


Sometimes, you will want to find  the computer serial number on your computer to do that in an easy way you can do it typing the following code in your command console.

  
     wmic bios get serialnumber

  
You will see something like this:

Ouput:

Serial Number

Tuesday, June 16, 2015

How To Find Duplicate Records in MYSQL



In this tutorial, I will explain how to find duplicate records in MYSQL.
I think the best way to explain is using an example:

This is our table called actors:




As you can see, we have  the name JULIO several times, which is fine because it won't affect anything, but what would happen if someone told you how many JULIO'S  we have in our actors tables?

To do that, we need the next SQL statement:
   

  select count(a.first_name)as 'Duplicate Records', 
        a.actor_id,a. first_name
  from actor a
 group by a.first_name 
  HAVING count(a.first_name) > 1

 

Output:

Basically, we've created  an extra  column  called duplicate Records that will tell us how many time  the name of Julio and the others names are repeated.