how-to, MySql

Recover MySQL root Password

It is only common to forget the database password. However, we can recover MySQL database server password following five easy steps.

  1. First step is to stop the MySQL server process.
    $> sudo /etc/init.d/mysql stop
  2. Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for the password.
    $> sudo mysqld_safe --skip-grant-tables &
  3. Then, connect to mysql server as the root user.
    $> mysql -u root
  4. Now that we’re in as the root user, setup new mysql root account password i.e. reset mysql password.
  5. mysql> use mysql;
    mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    mysql> flush privileges;
    mysql> quit
  6. Finally, exit and restart the MySQL server.
    $> sudo /etc/init.d/mysql stop
    $> sudo /etc/init.d/mysql start
    $> mysql -u root -p

With this we would’ve successfully changed the password.
 

Standard
css, web

Easy Web Fonts with Google Font API

Web fonts allow you to step outside of the normal web-safe fonts by taking advantage of CSS’s @font-face rule. However, right now, browsers aren’t uniform in its implementation of @font-face. More specifically, web browsers differ in the types of font files they support (hopefully this will change with the WOFF standards). Additionally, you must be careful with the fonts you use since some of them might not be licensed for web use.

To sidestep the issues with @font-face, the Google Font API is here to the rescue. Here is an example of using the Cantarell font on elements that takes advantage of Google Fonts API. If you want to use the Cantarell font from Google Font API, first reference the remote stylesheet inside your tags:

href="http://fonts.googleapis.com/css?family=Cantarell"

To use the font in h1 elements, simply use the font-family CSS property.

h1 {
    font-family: 'Cantarell', Arial, serif; /*Use a font stack, just in case.*/
}

 

Standard
Ruby, technology

Loading data from multiple files in Ruby using Hash

Loading data into Database reading from multiple files was never easy. I have been working on different projects lately, which required such exercise often. A general technique I followed to do that is explained here. In a gist, this is what it looks like:

require 'rubygems'
require 'fastercsv'

files.each do |key, value|
	file = "#{RAILS_ROOT}/db/drugsatfda/" + key
	recs = 0

	puts "Working with #{value.pluralize}.."
	FasterCSV.foreach(file, :headers => true) do |row|
		begin
			obj = value.constantize.new(Array.to_hash(row.headers, row.fields))
			obj.save

			recs += 1
		rescue => e
			puts "Rows processed: " + recs.to_s
			puts e
		end
	end
	puts "Loaded #{recs} #{value.pluralize}"
end

What do you think?

Standard
general, hackery, technology

Adding close link to flash messages

The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action that sets flash[:notice] = "Successfully created" before redirecting to a display action that can then expose the flash to its template. Actually, that exposure is automatically done. But not closing or removing and that flash message will be there till the view is refreshed or a new action is served. [Read more..]

Standard
blog

2010 in review

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads Wow.

Crunchy numbers

Featured image

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 210,000 times in 2010. If it were an exhibit at The Louvre Museum, it would take 9 days for that many people to see it.

 

In 2010, there were 7 new posts, growing the total archive of this blog to 203 posts. There were 6 pictures uploaded, taking up a total of 406kb.

The busiest day of the year was August 23rd with 868 views. The most popular post that day was Nebula.

Where did they come from?

The top referring sites in 2010 were stumbleupon.com, perezsolomon.com, southaustralia.inetgiant.com.au, 74.125.67.100, and facebook.com.

Some visitors came searching, mostly for nebula, taj mahal, believe, ripley’s believe it or not, and tajmahal.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

Nebula April 2008
7 comments

2

Taj Mahal May 2008
111 comments

3

Ripley’s Believe it or not!. October 2007
122 comments

4

Japanese Invisible Technology – Optical Camouflage January 2008
20 comments

Standard
general

I don’t owe you shit


Originally uploaded by urbanwide

The question was “What happened to the release????” on ruby-forum. But, what followed was furious, funny replies.

As an example check this out:

and it's now 24 July, I don't think it's inappropriate to get impatient for a release
or an explanation of the delay. Heck, if they asked for help, they might get some,
but this silence is bad if the core team want to keep their credibility. Why should I
trust a core team that can't get its act together to take 2 minutes to write a blog
post explaining why the release was delayed?

This should help clear things up: http://bit.ly/diXfGx

If you wanna know what the rails community is all about (other than awesome) then read on. I develop Rails apps and I love everything about it, the Framework, community, blogs and the attitude is one among them.

Standard
general

Would I Survive No Internet for a Whole Month?

Can anyone, of the current generation, survive without the Internet nowadays? I don’t know. But if you ask me, the answer is plain simple NO.

Google Classic: Please Allow 30 Days for your Search Results

No. Not for a month. If there is no Internet there is no work. If there is no work there is boredom. If there is boredom and nothing else to do, then one should die. But, I want to live a little longer.

Powered by Plinky

Standard
projects

Reach Your Doctor

The latest from Mapunity, Reach Your Doctor is a simple Patient, Appointment & Consultation Management Software for your practice. Everything you need to get your practice online, track your appointments, consultation details and client interactions in one convenient, secure and easy to use place. Help your clients find you and book online 24/7.

What’s Reach Your Doctor all about?

The chances are that you already use a calendar for booking your appointments. Maybe you just write everything down in your diary, maybe you use a calendar like outlook or iCal. While these are great for booking general appointments, they aren’t integrated with your client and consultation history.

Reach Your Doctor provides you with a simple system for managing appointments with weekly views. This view allows you to create and edit appointments quickly. The appointments system in Reach Your Doctor is constantly evolving as we progress and we’re always ready to hear about ideas that will make it work better for you.

You probably also take notes during and after a consultation but how easy is it to refer to these later on ? Can you access them from anywhere, any time ? Are they safe, secure and most importantly – are they backed up?

What if your clients could find you and book a confirmed appointment 24/7 within minutes ?

More Organised for a Better Service to Your Clients

Reach Your Doctor helps you manage the day to day activities of your practice, focused around your clients, appointment management and consultations. It helps to keep you organised and provides better visibility of your practice which in turn should help you better service your clients.

We’ve also recently introduced the ability for practices to get a simple web presence with profiles for each practitioner and most importantly, the ability for clients book appointments 24/7. This is an area we plan to expand on considerably in future releases giving you more control and flexibility over your practice website and content. If you’re interested in seeing what we have planned for the future, checkout our roadmap.

Want more info? Take the tour

Please provide feedback as to how we can improve this.

Standard
projects

Timely reminders for your child’s health

Mapunity is working to put together simple information platforms for promoting public health. The first initiative in this effort is Vaccidate, a free online and mobile-based alerting service that remind parents and guardians about the vaccination schedules for their children.

Parents can register to Vaccidate service free of cost by sending an SMS
VACC <space> Date of Birth (in DD MM YY format) to 52225

or by logging to the site vaccidate.in.

The recommended vaccination schedule for any given date of birth is used to create alerts on both web and mobile platforms.

Standard