Try running the below command in the terminal.
uname -a
or
Try running the below command in the terminal.
uname -a
or
gksudo nautilus
aletrnatively,
sudo nautilus
grep -rnw 'directory' -e "text-to-search"
-r is recursive, -n is line number and -w stands match the whole word.
grep --include={*.c,*.h} -rnw 'directory' -e "pattern"
To access remote machine using SSH
> ssh user@remote-host
> enter password when prompted
To get rid of entering password everytime you try to access, SSH keys has to be exchanged between local machine and remote server.
> ssh-keygen [Enter] [Enter] [Enter]
In case you have trouble in accessing internet using your wired connection and while troubleshooting, if your network manager says that
"device is not managed"
open the terminal and follow the below steps to fix the issue.
sudo vim /etc/NetworkManager/NetworkManager.conf
change the line managed=false to managed=true
As we use object.class method in Ruby world, to check the class of a variable in Javascript, here is the snippet
var ss = "some string";
alert (typeof ss); #=> string
alert (typeof pp); #=> undefined
To get formatted results for select statements use \G as a suffix for the query.
select * from table_name \G;
attr_accessor is used to create setter and getter methods for instance variables so that they can be accessed outside the class. initialize is the special method in ruby that gets called when an object is instantiated.
class Birthday
attr_accessor :name
def initialize age, gender
@age = age
self.gender = gender
To copy code from the terminal use
To paste code into the terminal use
class Person
def initialize(name)
@name = name
end
end
class Employee < Person
end