Category Archives: MAC

Mac: How to copy files from hard disk to USB drive through command line ?

In order to copy really big files or full directory coping through command line is good idea.
It will be fast and easy. In your mac you can find source directory easily but how to find destination directory?

Go to root and check the volume directory. /Volumes
Now its time to check where is your destination directory and where you want to keep your files.
In my case /Volumes/Seagate Backup Plus Drive/my_download

There are 2 points
A. cp has -R which is used to copy entire directory.
B. “Seagate Backup Plus Drive” directory in my case has quote because of space. If you don’t use quote probably it will not work! However you can name your drive without space.

It will take few minutes to copy really big chunks of data… Still it depends on size.


How to access one server if they are connect with LoadBlancer?

If you are LAMP developer and your server is connected with LoadBlancer now LoadBlancer is big advantage in production to distribute traffic but sometimes it could be trouble for developer as you want to access one server out of two.

Now here is the analogy.
You have 2 servers and web1 and web2. Web1 is main and you are accessing through FTP and adding files then web2 is synced with web1 but while you are developing few files or code you want to access only web1 how to do that ?

Well this is simple, change host file and one config file!
I am using MAC so add these 2 lines in host file and you will be accessing only web1.

edit /etc/hosts
add the lines
at the bottom of the file
edit /etc/resolv.conf
add the line
order hosts, bind
to the top of the file

And you are done!