Monday, September 9, 2019

How to duplicate a column in mysql

I wanted to copy a column's data into a new column in my MySQL database or rather say I wanted to create a new column and copy data from an already existing column in same table.

If you too want to do the same just issue below commands either in MySQL console or SQL tab in phpmyadmin:

ALTER TABLE `table_name` ADD `new_column` varchar(700);  
UPDATE `table_name` SET `new_column` = `old_column`;

First command creates the new column. Change the "varchar(700)" to whatever you want.
Second command copies the data from old column to new column.

Friday, May 25, 2018

Letsencrypt renewal command thats working for me

I had problem with my configuration for letsencrypt certificate so I searched a little. I did not wanted to waste too much time in fixing the configuration. I just figured out how it will work for me.
I am noting down the renewal command here for further usage.

I am using the standalone method for renewal so first stop the nginx server to free up the port
service nginx stop

then run this command for renewal:
sudo certbot certonly --standalone --preferred-challenges http -d domain.com

Thats it

Saturday, September 23, 2017

Joining two hobbies this time

I am a huge fan of creating forums. They are easy to make but very difficult to make them successful. My first successful site was a forum that grew up to 60,000+ members and thousands of posts.
I also look up hostings and servers very frequently. Even though I do not buy them but still I like to surf around looking at them. I never made a successful website about it though.
This time around I am joining these two hobbies of mine and making a web hosting related forum webhostinghelp.org.
I recently purchased this domain and installed discourse.
I am finding it very comfortable working on it than the one health-related forum I tried to make earlier.
Have any question about web hosting, VPS or dedicated servers you should ask it in this forum.

Sunday, August 27, 2017

Two new websites

I have been planning to do this youtube video making thing for quite some time now and once made one or two videos too. You can find them here. But never managed to do it long term.
I taught in a dental college for 3 years and learnt that most of the students were struggling in my subject human anatomy and it was mostly because we were teaching them in english.
English and all those new words in anatomy were making it very difficult for students to understand things as almost all of the students were hindi speaking.
When I started teaching them in hindi they responded very well.
My classes saw more attendance than other teachers and students learnt and enjoyed far more.
After I left that job I thought about making videos of what I was teaching and make them available for new students. Never managed to do that.
Recently I registered this domain hinditutorial.in and now I am planning to make not only the videos for anatomy students but videos of whatever I know and put them on youtube and on this website too.

And now about the second website.
Recently I started observing that I like to optimize websites for fast loading and actually wasting a lot of time doing it.
As Google also ranks websites with faster loading time higher lots of other people also do that.
So I registered this domain fastwebsite.org and I am going to write whatever I have learnt about website optimization and server optimization for faster websites.

The first website will need a lot of work but the second will not.

Lets see what fate these websites hold.

Sunday, March 19, 2017

I am missing something

I have learnt so much still very little productivity.
I need to figure out what I am missing.

Saturday, March 18, 2017

Political

Most of my life I have been apolitical. I never found politics any enjoyable but in recent years because of all the political discourse on social media I gained interest in it.
I went inactive on Facebook few months before 2014 general elections because my known people started posting lots of fake/propaganda statuses on Facebook and I found it annoying. I left Facebook because if I told them the truth many people will take it as personal insult and if they don’t get offended the discussion will waste a lot of my time. Staying silent was not peaceful for me.
The party who was doing most propaganda actually won in that election.
I thought the propaganda will stop after the elections are over and I will return to the old merry Facebook again. Rather the propaganda became more and more aggressive and that is still going on. This made me sad.
I got more active on twitter as not many of my friends are active there thus less chances of loosing friends there.
Doing so I gained some knowledge about politics and I am finding it rather amusing now. Yes sometime annoying too. So decided to write about my political thoughts so I can get some clarity of mind. This is important because politics is so confusing that you don’t realize when you becomes a hypocrite.
If you support a party you start supporting it no matter what. The party or its leader may be doing wrong but as you are their supporter you find a reason to support them while opposite goes with the other parties.
This time around I am choosing a topic that is in news currently and I think is going to explode in coming elections. I am learning about it and making a blog on it.

Lets see how it goes.

Monday, September 12, 2016

Life is too short to..

Life is too short to be shy.
Life is too short to satisfy your ego.
Life is too short to do things other wants.
Life is too short to not to fight for what you want.
Life is too short to give up something you love.
Life is too short to not to be with people you love.
Life is too short to waste in keep saying no.
Life is too short to not to take risks.
Life is too short to not to make mistakes.
Life is too short to not to play with your kids.
Life is too short to miss the memorable moments.
Life is too short to keep procrastinating.
Life is too short to holding yourself back.
Life is too short to stop your heart take control once in a while.
Life is too short to hold your head high.
Life is too short to have that body you always wanted.
Life is too short to not live the life you should.
Life is too short to keep doing chores.
Life is too short to finding your peace.
Life is too short to keep sleeping.
Life is too short to..

Friday, May 13, 2016

To be successful

You will have to do chores.
You can't be special all the time.
Talent is not enough.
Working hard and learning is not enough.
Success lies in doing routine work better.

Sunday, April 24, 2016

Discourse or nodeBB

Serious confusion.
Can't decide between discourse and nodebb. Discourse is perfect, other then its looks and more importantly its initial load size. Whereas nodeBB is around half in size for initial load but its buggy with many things like mod_pagespeed, Cloudflare etc. All this good in discourse but initial load size is big turnoff for me.
I really liked flarum but don't know when will it come out of beta. I am OK with beta if its working decently but developer themselves are advising strongly against using it in production. So its gone.
While evaluating I am not counting the server requirements here. Nodebb works on far lesser resources than discourse, which won't even start on Server below 1GB RAM and recommended is 2GB RAM. They say even with lesser resources nodeBB can serve far more users than discourse.
After the initial load nodebb and discourse are almost on same speed. May be nodebb is a bit snappier.
What I notice is that while nodebb Developers have focused on all the fancy stuff like chat system, theming, UI etc discourse developers have focused on doing basic forum stuff nicely. Discourse looks very well built and everything goes very smoothly. You get lots of finely thought out functions in discourse whereas in nodebb you get those old controls that we are seeing since vBulletin but mixed with fancy stuff.
With what i have written above you can guess i am inclined toward discourse a little bit. But the main problem is i am planning to build an Android forum and i suspect initial load size of discourse is going to cause some troubles on the mobile devices specially the cheaper ones with less RAM. Even one of the lead  developer of discourse says JavaScript performance on Android device is a serious problem and you are bound to lose visitors who visit your site from Android devices. And here i am planning to build a forum for Android users.
Gotta think more and decide.