Accessing Docker Postgres in the host application
Accessing docker postgres is was easier with right commands. Docker has been a life saver for most of us – no doubt on that. We can do any kind of software interaction from host machine or from other docker container with bliss.
Once you have the docker postgres up and running, access docker postgres and use it for multiple of your projects. Here I will show how to access docker postgres from host machine. That is the same thing as any other app to access it as well.
Continue reading Accessing Docker Postgres from host application
Upgrade mysql version
This would probably make sense on Amazon EC2 instance where it comes by default with
mysql 5.5, as of this writing, and you want to upgrade mysql to the next version.
In this example I have used version 5.5 for the upgrade mysql example. But, technically the methodology would work for other versions as well unless mysql drastically changes folder locations.
How to upgrade mysql from 5.5 to 5.6
First go ahead and move the mysql 5.5 to new folder
sudo mv /var/lib/mysql /var/lib/mysql55
Then grab the tar from mysql download page [Here]
Once you download the tar file containing the new mysql version do the following commands on your terminal.
sudo tar -xvf yourDownloadedTar.tar
sudo rpm -ivh MySQL-shared-5.6.17-1.el6.x86_64.rpm
sudo rpm -ivh MySQL-client-5.6.17-1.el6.x86_64.rpm
sudo rpm -ivh MySQL-server-5.6.17-1.el6.x86_64.rpm
This would upgrade your current mysql version to mysql 5.6 or which ever is the new mysql version.
Then restart mysql for the change to take effect.
If there is an image change on the same file name, say logo.png or front.jpeg, the change won’t happen right away unless you force refresh it on browser to clear the cache.
The problem with this one is when you have dynamic updates and your users couldn’t see the change right away b/c of the cache.
The simple fix for this would be appending version at the end of the file name. Like your original html would look like:
img height="200" src="/path/to/image/file.ext"
Then appending the version at the end
img height="200" src="/path/to/image/file.ext?v=someVersionGoesHere"
For any backend it would be easy to append the versioning when the image is presented. It could be random number or unix timestamp would work in this case too..
var version = new Date()->getTime(); //get the unix timestamp
var path = "/path/to/image/file.ext?v="+version;
Shall do the trick. I used jQuery her but, it is not limited to it..
Was trying to pull something to github and noticed I was using a bit old Git version.
Then I went to and downloaded for mac.
After installing, I checked if I have the latest version by doing
and it showed
git version 220.127.116.11
Then I suspected the previous one is not updated and checked which git binary is being used
And it replied as
The new one is being save on another directory – /usr/local/git
Then I checked how my path is setup
it was something like
As you can see the poor mac would see the /usr/bin first to check if command binary is inside it and it would continue.. so it was not checking the /usr/local/git..
Just putting the proper path infront of the path would solve the problem
That would fix the problem. In the mean time, doing some cleanup on the existing git files would help also..
if you are on linux destro, by default you might have installed it on /usr/lib/php5/Zend or wherever you install it and look into the Version.php file, you can see the number of the version sitting and wondering