Linux


Solved: Failed to start raise network interfaces on ubuntu using vmware workstation

I updated ubuntu on my virtual machine and once it finished it wasn’t being assigned an IP address. During boot it showed the error “Failed to start raise network interfaces”.

Create a new file 10-rename-network.rules in /etc/udev/rules.d/ and add the following content to it:

SUBSYSTEM==”net”, ACTION==”add”, ATTR{address}==”ff:ff:ff:ff:ff:ff”, NAME=”eth0″

where

eth0 = desired network interface name, used in /etc/network/interfaces
ff:ff:ff:ff:ff:ff = hardware mac address of the network device

You can check your current MAC address with the command: # ip link show interface. where interface is the name of your network interface. The section that interests us at the moment is the one that has “link/ether” followed by a 6-byte number.

Then restart the VM. After that you should have an IP address again. Verify by typing “ip a” .


bower install or update error: unable to connect a socket (Connection timed out)

When running bower install or update if you receive the error “unable to connect a socket (Connection timed out)” related to a dependency that’s installed via git, run the following command to change the protocol “git config –global url.”https://”.insteadOf git://” . Then bower install and update should be able to find the repository.


How to install Node and NPM on Linux CentOS 5 2

Once logged into the server as root, I initially ran “yum install nodejs” and and was presented with the “no package nodejs available” message, which means yum couldn’t find it. So we need to add the EPEL repository so it can be installed with yum, and then proceed to install nodejs and npm.

#Add the EPEL Repository allow yum to intall nodejs
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

#The epel release version might be slightly different when you download it, so change the command as needed to point at the right file.
rpm -Uhv epel-release-6-8.noarch.rpm

#install node
yum install nodejs

#enter ‘y’ for the two or three prompts

#install npm
yum install npm

#enter ‘y’ for the prompt

And that’s it. If for some reason you get “no package nodejs available” still, then clear the yum cache with “yum clean all” so it uses the new repository and then try to install node again.


Linux – search for text in files

Find a string in all files in the current directory

find . | xargs grep 'string' -sl

Limit the search to a certain file type

find . -iname '*php' | xargs grep 'string' -sl