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.
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
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:
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
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
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.
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
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
Then reboot your *nix
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
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..
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
And search for
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
CustomLog "/private/var/log/apache2/sitevh.com-access_log" common
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
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
Then open the mysql configuration file
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
Say you added an alias to your most common command to your ~/.bash_profile or .profile file and, to use the alias, you have to reload the terminal or you can do it in one line as
That will refresh your terminal for ya
If you are a programmer/developer one thing you would face on date to date basis is handling packages.
Macports is a package manager for mac using that simplifying the installation of free/open softwares on you mac.
All how to install procedure is found on http://www.macports.org/install.php
After installing the macports don’t forget to update it
sudo port -v selfupdate