flash disc

Share file from Windows to Mac OS

How to share file from windows to Mac

If you are working on windows and you want to share the file to mac, follow this simple steps to get the work done.

The first is to go to your mac and enable the file sharing. I would do this temporarily so that it won’t be opened all the time, this is for security purpose

How to allow sharing file in mac

  1. Go to  settings in mac
  2. Go to sharing
  3. Check the file sharing options

How to connect to mac from windows.

Before you do this, you will need to get the ip address of the mac computer that you will be using it later in windows connection.

How to get IP address of the the computer on mac

Open a terminal using either of the following methods:

  • Go to finder
  • Select Applications under favorites, if you don’t see it, go to finder menu on the top next to the apple icon while the finder is active, select preferences and check Applications
  • In the applications, go to Utilities and select terminal

Or

  • Hold command and hit space
  • type terminal
  • select the terminal

Once you get the terminal in either ways, then type the following command in the terminal

ifconfig

From the result, look for inet and that shall be your ip address ( this time it has to be the local one)

Connecting to mac from windows

On windows, on the search bar, type run

When you get the input box type \\ip-address-here

This creates anther window where you have to enter the username and password of the mac computer. That will connect you to the mac computer.

 

node js on mac machine

Update Node and npm on mac OSX

How to completely remove Node and reinstall it

It might be a bit annoying to uninstall stuff. But sometimes you gotta do it.

To uninstall node completely from your machine:
brew uninstall --ignore-dependencies npm

This will handle the issue you may have with dependencies. If you have other modules like yarn or jhipster on your machine, they are dependent on node and uninstalling might not come easy.

To uninstall node in a more aggressive way:
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*

how to install node, npm (node package manager) on Mac OSX

It is rather simple. Just go to https://nodejs.org and download and follow the steps.

important vim commands

important VIM commands

Important VIM commands for daily usage

Important VIM commands is selected vim commands that every programmer shall have by heart.

By far important vim commands might be those we use in everyday programming life. But there more to it.

What is vim

Vim is a smart text editor for linux distros. It allows plugs ins for different usages. Basically, it pretty much knows most of programming languages you open with it.

Important vim commands will allow you to have a fast and productive usage of VIM while working on it.

Why should I use vim

You should use vim because it is cool. Really it is cool. Apart from being cool, it is light weight and almost available in most linux distributions.

Vim allows having third party plugins that will allow you to do multiple tasks from coloring to memory based copy and more.

Vim is programming language friendly. If you are working on java, it will highlight the keywords for you. Same for PHP or javascript or almost for lots of languages.

how it install vim

Usually VIM will come with most of the linux flavors:

If you are on Ubuntu installing vim on ubuntu will be
Continue reading important VIM commands

Screen Shot 2016-04-10 at 7.49.57 PM

install composer and make it globally accessible

Unless you have been living under rocks, you have heard about composer already. It is a dependency manager and more than that actually. If your PHP app is using a lot of dependencies, then it is time to consult composer.

Here I will put some notes on how to install it and make it available globally so that you can use it from any directory.

First thing first, go and grab the phar file from composer download page

It would be a single phar file and u can use that as it is:

composer.phar install

Of course you would need the composer.json file for the above to work where you would list the dependencies.

But, this would require you to call the phar from where you downloaded and that might not be handy

cd /to/composer/phar/file
sudo mv composer.phar /usr/local/bin/composer

Now, you can call composer from any directory and rock from there
get more @ get composer
That is how you install composer on linux/mac computer and make it globally accessible with in

Screen Shot 2016-03-29 at 4.59.26 AM

Get your filezilla password from your mac

Yeah, FileZilla, the major FTP software would put the passwords along with your username,  host  and other info in your computer directory.

So if you lost your FTP credentials and you have been using FileZilla, you can simply retrieve or assist you remember it.

Just go ahead and open options menu from FileZilla, on Mac computer, you can get this by clicking on the FileZilla menu, and look for settings directory and there you would get xml files containing your credentials.

You can grab and use it. In the meantime, if your computer is accessed by others, also know that they can access your FTP information from there.

Mount to NSF Server timed out on Vagrant

I had a bit rough weekend :( after successful update of some packages and successful breakage of my guest machine aka vagrant.
The thing is my symfony app is running on vagrant and all of a sudden I can’t ssh or after halt I can’t vagrant up – it is giving me the mount to NFS server timed out

This has something to do, unfortunately, with the firewall setting. After the guest and the host are two, at least technically, machines and firewall decided to block the packets for some of the host machine applications.

You can comb those needed for it by looking from the list of the firewall..
On Mac => go to System Preferences and click on Security and Privacy and Turn off the firewall to make sure the issue is associated with it and then you can turn it back with applications related to virtual host to accept all the incoming traffic.

t h a t i s IT

Failed to Retrieve Share List from Server when connecting unix

I was getting the Failed to Retrieve Share List from Server when I was trying to move files from my mac to mint 13 pc.

I am trying using the existing samba protocol.

Here is how I fixed it.
I just added the ip address of the mac on my hosts file

sudo vi /etc/hosts

this will bring the hosts file. Then add the ip address and the host name of the computer you are trying to communicate.

Say the ip address of the computer you are trying to connect is 192.168.2.5

192.168.2.5 hostname

Then reboot your *nix

sudo reboot

Wi-fi connected but no internet mac troubleshooting

It is a bit frustrating when you want to send and email or watch a trailer on youtube or whatever it is and you can’t connect. it looks we can’t live without it anymore :)
Here are steps that would help you to figure out what has went wrong when you are in such scenarios. We will start from the obvious ones..

1. Are you on the right wi-fi? Yea it looks obvious but mac being smart and remembering wi-fi spots you might be on the wrong one.. so give it a check

2. Is that only your mac that is not connected to the internet? Check your other gadgets have internet from the wi-fi you are trying to connect. If others can’t make it then the concern would be changed to the source.

3. Restart your router. Usually, most routers have reset button. Reset it, unplug the power and let it be like that for a couple of minutes and check again.

4. Click on the apple icon on the top left, and click System Preferences. Then select network. On the left you would see your Wi-Fi being listed. Click on it and on the right window, turn wi-fi off and click again to make it on. Then select the network from the drop down list. This one would be usually used for when you see the exclamation point on the Wi-Fi icon

5. Try the wireless diagnostics. You can access, click on the Wi-Fi icon on the right top cornet while holding the option button. It will be listed on the bottom of the list. Follow the wizard and see if that helps the problem.

6. See if you IP is accessible from other machines. If you have another computer, it could be windows or linux use the ping command to check if your ip-address is accessible and valid. On windows, open the command prompt and write ping ip.address.here. You can get the ip address of your mac from System preference->network then click on the Wi-Fi. You will see it on the right pane. Say your ip address is 192.168.2.3

ping 192.168.2.3

7. If the step number is shows you the ip-address has the problem, change the range of ip-addresses from your router to force a distribution of new ip-addresses to your devices. Please google how to assign the ip-range on your router using your router brand. The default we accessible router configuration would be http://192.168.0.1. try that on your browser or check what it is from the manual and update accordingly..

Good luck!

Serve more than one site using virtualhosts on mac OSX

There would be a need for this or that reason to serve more than one site from apache. And this is quite possible using configuration inside the apache

First thing first
go to the apache config, by default it should be

/etch/apache2/apache.conf

And search for

#Include /private/etc/apache2/extra/httpd-vhosts.conf

Which, as you can see, is commented. Hence uncomment that by deleting the # infront of it.

The above task will allow us to mess around the httpd-vhosts.conf file that is in the extras directory.

Lets assume we have a site names siteVH which is residing in the directory /www/sitevh
and lets assume we have another site called siteAnother residing in director /www/siteanother

Now the goal is to access those sites independently. So we will create two different virtual hosts for each one and be able to access them independently


    ServerAdmin youreamil@domain.com
    DocumentRoot "/www/siteVH"
    ServerName sitevh.com
    ServerAlias local.site
    ErrorLog "/private/var/log/apache2/sitevh.log"
    CustomLog "/private/var/log/apache2/sitevh.com-access_log" common
    
        AllowOverride All
        Order allow,deny
        Allow from all
        Options Indexes FollowSymLinks
    

And the we will have the same duplicate values for the other one as well.

Then update the /etc/hosts to let know our local “DNS” :) to know what to do

127.0.0.1 sitevh.com siteanother.com

This shall take care of the whole thing.
One more thing, restart apache

sudo apachectl restart
database

Connecting to Vagrant [PuPHPet] MySql from host

Probably here with – I can’t connect to mysql on vagrant machine Yup I have been there

If you are php developer and are using vagrant you would want to use mysql tool to access the vagrant mysql server.

Here is the step by step procedure.

I will assume the PuPHPet configuration
First, get the user which can connect from any host

Log into your vagrant

vagrant ssh

Then open the mysql configuration file

vi /etc/mysql/my.cnf

And update the bind-address part to be 0.0.0.0. This will allow address to be used from any host.
If you want to specifically access from some host only, then put IP over there.

Then being in your vagrant machine run

mysql -uroot -p123

This will be depending on if you have provided a password for root the default on puPHPet would ask password so you would have a password

After this allow root user to access everything from everywhere.. or you can create another user and grant that

mysql > GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123';
mysql > FLUSH PRIVILEGES;

Then to make the sql pickup the changes made so far

sudo service mysql restart

Then being on your host machine open your sequel pro – if you are on mac.. or other clients you would use for mysql.

Mysql Host: 127.0.0.1
Mysql user: root
Mysql Password: 123

SSH Host: 127.0.0.1
SSH Username: vagrant – this is the default one
SSH key -> point the key in puphpet/files/dot/ssh/id_rsa
SSH Port: 2222 – this is also the default ssh port forwarding, if you change this change it here too..

See how to Setting up vegrant machine from scratch here