Friday, July 31, 2015

Change Apache Server Root in Linux

There are a million blogs that tell you how to install a LAMP stack on any linux distro.

But what if you want to move your server's root folder?

The directories I'm going to mention are specific to Fedora, but the files remain the same.

Follow these steps carefully:

1. Create your new root folder.
    For instance, "/home/sahay/newRoot"

2. Edit the Apache servers Config file:
    In Fedora, you'll find this file in the path "/etc/httpd/conf/httpd.conf"
    So, the default value of the servers root directory is "/var/www"
    We need it to be in "/home/sahay/newRoot"
    DO NOT replace every occurrence of "/var/www" with "/home/sahay/newRoot".
    Let them be as they are.
   For the sole purpose of changing your root directory, we have something called "Virtual Host."
    Type the following at the end of the file:

        <VirtualHost *:80>
            DocumentRoot /home/sahay/newRoot
            <Directory "/home/sahay/newRoot">
               
Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted

           
</Directory>
       </VirtualHost>
If you want your PHP script to create a file in your server folder, whether default or a new server folder you've created, you need to make some changes. Follow this LINK.

Create File with PHP script in Linux : Permissions Issue Fix

I had a requirement where I had to create a file in my server folder through a PHP script.
Now, that's not as easy to implement in Linux as it is in Windows.

Trying to write a file in your server folder will give you "Permission Denied"; Even if you're logged in as root.

That's because PHP, which is trying to write the file, isn't running as root.

Follow the following steps to fix this issue:

1. Find out PHP is being run as which user by running the following script:

    <?php echo exec("whoami"); ?>
    In Fedora, you get it as "apache."
    ( You might get it as "www-data" or something similar. )
    This means that the user "apache" is running the PHP script.
    Hence, the user "apache" is trying to write the file in your server root folder, not "root".

    Say, I have shifted my server root folder to "/home/sahay/newRoot".
    So, "apache" should have WRITE access to this folder.
2. Check the permissions of "/home", and "/sahay" by running "ls -l".

    By default "/home" has a 755 permission and the owner is "root".

    Now, in Linux, a user is also treated as a group.
   So, 755 here means "root", as a user, can READ, WRITE and EXECUTE in "/home".
    Users part of the group "root" can READ and EXECUTE in "/home".
    Any other user can READ and EXECUTE in "/home".

    By default "/home/sahay" has a 700 permission and the owner is "sahay".

    700 here means "sahay", as a user, can READ, WRITE and EXECUTE in "/home/sahay".
    Users part of group "sahay" have no permissions.
    Other users have no permissions.

3. Change the group permissions for "/home" and "/home/sahay" folders:

    chmod 775 /home
    chmod 770 /home/sahay

    Now, any user which is part of the groups "root" and "sahay" will be able to READ, WRITE and EXECUTE in "/home" and "/home/sahay"

4. Add "apache" to the groups "root" and "sahay":

    usermod -aG root apache
    usermod -aG sahay apache

    "a" is used to append the list of groups the user already is in. Without "a" it will overwrite the existing group.

    Since, "apache" is part of "root" and "sahay" group, it will have access to READ, WRITE and EXECUTE on"/home" and "/home/sahay" respectively.

5. If you've got SELinux installed, edit the following the SELinux Config file like this:

      SELINUX=disabled

    In Fedora, it is stored in "/etc/selinux/config"
    This would require a restart after everything is done.

Finally, you're good to go. Now you'll be able to use function like file_put_contents() etc. on your server root folder.

Thursday, May 7, 2015

The Golden Age of Comic Book TV and Movie

We are living in an era which I like to refer to as
"The Golden Age of Comic Book TV and Movie".
I know - It's a mouthful. It's just how I like to refer it. It's simple and self explanatory.

The following is a list of recent Comic Book Live-Action series and Movies :

* Live-Action :
  1. Agents of S.H.I.E.L.D
  2. Agent Carter
  3. Powers
  4. Daredevil
  5. Arrow
  6. Gotham
  7. The Flash
  8. Constantine
  9. iZombie
* Movies (2010 onwards) :
  1. Iron Man 2
  2. Thor
  3. X-Men : First Class
  4. Captain America : The First Avenger
  5. Ghost Rider: Spirit of Vengeance
  6. The Avengers
  7. The Amazing Spider-Man
  8. Iron Man 3
  9. The Wolverine
  10. Thor: The Dark World
  11. Captain America: The Winter Soldier
  12. The Amazing Spider-Man
  13. The Amazing Spider-Man 2
  14. X-Men: Days of Future Past
  15. Guardians of the Galaxy
  16. Avengers: Age of Ultron
  17. Jonah Hex
  18. Green Lantern
  19. The Dark Knight Rises
  20. Man of Steel
  21. Teenage Mutant Ninja Turtles
  22. Kick Ass
  23. Kick Ass 2
As evident from the list above, we are living in a geek fantasy world. So many movies and series based on comic books. Let's analyse each category.
  1. Live-Action Series :

    Live-Action series have been there since the 1950s. A reminder of the good ol' days - Adam West, everybody !!!



    So what makes THIS time so SPECIAL??

    The answer is the number of Live-Action series that are being aired simultaneously. To prove my point I would be sharing some statistics.
    Marvel Live-Action Series


    DC Live-Action Series





    As you can see, there has never been a time when 9 Live-Action series have been aired at the same time.
    These shows are being watched all over the world, not just by the Comic Book fans but everyone. These shows are hits. Everyone's enjoying them.

    I believe that the creators of such superhero shows no longer focus on the "Nerdy" demographic, but everyone in general.

  2. Movies :

    There's no denying the fact that superhero movies are hot right now. But this wasn't the case before 2010. I say 2010 because that's when Iron Man 2 was released. That movie marked the beginning of this "Golden Age."
    Iron Man 2, as we all know, was a small part of the line up of superhero movies leading to The Avengers. After that another line up of movies leading to Avengers : Age of Ultron. Plus, the X-Men movies saw a reboot (Well, not exactly a REBOOT reboot. A prequel and a sequel leading to an all new X-Men universe. So, yes, a roboot.) Also, Gaurdians of the Galaxy was a huge hit. Other movies include Green Lantern, Dark Knight Rises and Man of Steel.

    After reading the above list of movies, you can see that Marvel has dominated so far. They're the ones who started this amazing era. DC tried to chip in with Green Lantern and Man of Steel. They OBVIOUSLY haven't been successful.

    How did the Golden Age for Movies come to be?


    Let's start from 2008. Iron Man came out that year. I was in Delhi when this movie was released. Boards exams were over and I was at my relatives' place in Delhi. Me and my cousins went to watch this movie in some movie theatre (I don't recall the name). During the intermission, my cousin, she asks me, "What's so special about Iron Man?" or something like that. And I tell her some information about Iron Man like - "Everyone knows who Iron Man is. Everyone knows his real identity." That's something that had always appealed to me. Do you know what she said?? She said and I'm quoting, "That's LAME."

    Now I ask you - Do you think Iron Man's LAME??

    Back in 2007, 90% (Don't qoute me on that number) of the Earth's population would've said a big "Yes" (Mostly because they wouldn't know who Iron Man was and if I told them that it's a comic book superhero, they would've called me a nerd and ignored me).

    Not a lot of people were fimiliar with Iron Man before that. That was Iron Man's 1st movie! You have to give credit to the director for making an awesome superhero action movie and Robert Downey Jr. for making Tony Stark's character his own. The movie was a huge hit. This got everyone waiting for Iron Man 2.

    This is when things get interesting. Iron Man 2 was more than just a sequel to Iron Man. It was but a small part of a way..... bigger plan - The Avengers. Each of the movies in the series, right from Iron Man 2 to Avengers : Age of Ultron, have given us awesome action and CGI effects. These movies would've been great even if they featured a Non-Marvel hero. But  they're all linked to one another as such that these movies have become so much more about the Marvel Universe. Kudos to Marvel for coming up with such an elaborate plan and executing it to perfection.

    DC tried to chip in with Green Lantern and Man of Steel. Unfortunately, they failed. Both the movies bombed at the box office. I don't consider Dark Knight Rises as part of this fad because this movie was part of Nolan's trilogy and it was supposed to come out anyways. It was just a matter of time.

    Marvel went as far as releasing a movie about a bunch of aliens, a talking tree and a racoon with a gun - Gaurdians of the Galaxy. You'd think they'd get away with it because of all this superhero craze. Guess again. They KILLED it !!! It was a huge success. It was the highest-grossing superhero film of 2014. And nobody, including me, had heard of it before.

So, why is it that suddenly everyone is into Superheroes?

Let's look at the key demographic of cinema audience today :


http://www.sawa.com/resources/audience
So the key demographic is ages 14 - 34 with most of the audience being above 25.
I believe, reader, you fall under this category. Lemme ask you this - What superheroes did you grow up watching??

I'm going to list down all the superheroes that I grew up watching. Maybe it'll jog your memory.

  1. Batman - The Animated Series
  2. Superman
  3. Justice League
  4. Batman Beyond
  5. X-Men
  6. Spiderman
  7. Iron Man
  8. Fantastic 4
  9. Silver Surfer
  10. RoboCop
  11. Teenage Mutant Ninja Turtles
Now, let's Math.


Equation 1 : We are the key demographic for cinema audience.
Equation 2 : We grew up watching the animated series of the above 
                  mentioned superheroes.
------------------------------------------------------------------------------------------------------

Solution    : Movies + Live-Action Series based on the superheroes we 
                  grew up watching.

Think about it. It makes sense.

You might say that I got to see these animated show at a latter time because these shows were aired in India when they went into syndication (when the show ended and was aired on different networks). But theses shows were originally aired between 1992 and 2004. So, probably I got to see these shows 2 - 3 years later. Doesn't make much of a difference.

The Upcoming Projects :


* Live-Action :
  1. A.K.A. Jessica Jones
  2. Luke Cage
  3. Iron Fist
  4. Defenders
  5. Supergirl
  6. Legends of Tomorrow
  7. Lucifer
  8. Preacher
  9. #4 Hero
* Movies :
  1. Ant-Man
  2. Fantastic Four
  3. Deadpool
  4. Captain America: Civil War
  5. X-Men: Apocalypse
  6. Gambit
  7. Doctor Strange
  8. Untitled Wolverine film
  9. Guardians of the Galaxy 2
  10. Untitled Fantastic Four sequel
  11. Untitled Spider-Man film
  12. Thor: Ragnarok
  13. Avengers: Infinity War Part 1
  14. Black Panther
  15. Captain Marvel
  16. Avengers: Infinity War Part 2
  17. Inhumans
  18. Batman v Superman: Dawn of Justice
  19. Suicide Squad
  20. Wonder Woman
  21. Justice League Part One
  22. The Flash
  23. Aquaman
  24. Shazam
  25. Justice League Part Two
  26. Cyborg
  27. Green Lantern

Yes. There are 9 new Live-Action series and 27 new Movies based on our favourite Comic Book Superheroes lined up. That too by 2020. Wow!!!


All this Superhero movie CRAZE has created a Comic Book Movie BUBBLE!!!

Yes, it's a bubble. And, it's going to pop one day. I predict that it'll pop in 2022. Let's see. I will be writing about it in another post.

                                      " Right time... it is NOT.... hmmmmm "

Tuesday, April 7, 2015

Comic Con 2015 !!!

Mark the date - 5th April, 2015; My dream came true. Literally, my dream came true.

I attended my 1st COMIC CON !!!



Ever since I was a kid, I wanted to go to a Comic Con and watch amazing Cosplays with my very own eyes. Yesterday, I did and now, I can't stop thinking about it.

It's only the 5th year Comic Con has been organized in India. And, I was told not to keep my hopes up high. But I had huge expectations. And Comic Con Bangalore did not disappoint.

We started our journey to the best day ever around 10:15AM. Got a FREE Ola cab ride. The guys at Comic Con really took care of everything. By the way, the Comic Con ride icon on the Ola cabs app comes up as a Bat Mobile. Just saying. I thought it was clever. So, this is how one of the best days of my life started.



When I was entering this huge Convention, the feeling was unreal. The banner over my head said "BANGALORE COMIC CON"!!! Couldn't believe it. So, I took a pic to remember the feeling. I do this. I take a pic to remember the feeling that I'm going through.

As I entered, there was loud music, almost everyone was wearing a superhero t-shirt, lots of comic books, comic books, anime & movie merchendise and whatnot. It was a geek's fantasy come true.

Then me and my friends decided to roam about and see what all Comic Con has to offer. I found a t-shirt with a "Batman : The Dark Knight Returns" comic book art on it. I got so excited. If that t-shirt was on on display anywhere but Comic Con, no one would but it. But at Comic Con, everyone knew it's value.

Moments later, my friend taps me on the shoulder and points to a shirtless guy wearing a blonde wig, with a metal right hand. OMG !! It was the lead character from Fullmetal Alchemist. I couldn't believe it. I had watched the complete series on Animax. How many people knew who this guy was cosplaying?? The answer is A LOT. It made me even happier. So, I run up to him to ask him for a pic. And, he politely agrees. I took a lot of pics with him. And just before leaving the convention, as I couldn't control my geek self, I went up to him and said that I really really liked his Cosplay, that I'm a huge fan of the show and wished him luck for the Cosplay contest.



After an hour or two, I saw him again. And this time I wanted to take a pic with him with both our hands down on the ground. When I asked him to do that pose, maybe he didn't hear me the first time. So, I was about to explain it to him, just like I would explain any of you who doesn't know the show. But just as I said, "Hands on the ground" clearly, he said, "I know.  I know what you mean."



He KNEW what I wanted him to do. He KNEW his character. He wan't paid to get dressed as a character and just show up. Just like every other Cosplayer there, he came as a Cosplayer because he was a FAN and he wanted to do it. It's their way of showing their love for the comics, anime and whatnot.

After that I took pics with SO MANY Cosplayers. Joker, V for Vendetta, Spoc, Obi Wan Kenobi, a lot of Naruto & Bleach characters, Mario & Luigi and the list goes on.....

Best of all I saw a couple cosplaying Inu Yasha and Kikyo. He even had his sword - Tetsusaiga / Tessaiga. I was such a big fan of that show.  I even remembered the sword's name. As a kid, I used to play with a stick pretending it to be Tetsusaiga. One thought in my head was, "Why Kikyo and NOT Kagome?" But somehow "Inu Yasha and Kikyo" felt right. They were meant to be together.



I was having the time of my life. But something hurt me yesterday. A Vulcan hurt me. There was this sweet girl cosplaying Spoc. When I saw her, I got all excited and ran up to her for a pic. After the pic she said something that really hurt me in a good way. She said, "How come you're not cosplaying?"

I take a vow right now that I will Cosplay next year.



Also, I felt so happy when Obi Wan said, "May the Force be with you."

And how can I possibly forget the Comic Book and Graphic Novel collections! They had everything. "The Killing Joke", "The Dark Knight Returns", "Knight Fall", "The New 52". All the issues of each title. So many iconic story lines. Wish I could buy all of them. I was in LOVE with that place. Didn't want to leave. Ever.

For the 2nd time in my life ( 1st time being, when I recently got to know a friend, Shruthi. Sorry for using your name. I don't usually do this. ), I felt better about myself. I was not an outcast there. I am a geek and I embrace it. And this place was full of them. I was among my own people. I was at home.

Everyone was so nice there. Even in such humid and crowded condition, everyone was having fun and smiling. I did not find ONE asshole. People were so nice. Maybe it was the type of gathering where everyone is nice. I don't know. Loved the convention and the people.

Oh yes, we danced on the stage to Xbox's Just Dance 3. And, yes you're correct, I did make a fool out of myself. Again. But this was one place, noone cared. Neither did I.

I'll never forget my 1st Comic Con. Never Ever.

I'll be sharing all my pics on Facebook. Now, I usually don't do this but this time it's different. It's COMIC CON !!!

Sunday, February 22, 2015

Last 2 Months

Hello, Everyone.

If you've read my last post, you know what this post is about. Or you might have guessed it from the title. Anyways....

I came to Hyderabad on December 20, 2014. It's been two whole months. But, it honestly doesn't feel that long. I've made such good friends here. When I came here, I did not expect to meet such good people. I have to say I'm lucky to have met them. So, let me start from the beginning.

Do you remember the first six months of your college? That's when you meet so many characters. And are you are desperate to make new friends. You come up to total strangers, shake their hands, introduce yourself, make friends with him / her and hope that the person you're talking to doesn't turn out to be a total asshole. After reaching my accommodation, I went through this phase once again. It's wonderful meeting new people. But this was different from college, at least for me it was. The reason being that I met such good people over here. I mean SMIT had such a negetive vibe when it came to it's crowd. But, here, it's so positive.

I made friends from different parts of India, and not just from Bihar and Jharkhand. Some of these places include Orissa, Delhi, Rajisthan, UP...... They're all such nice people. I know, I'm saying this A LOT. But that's truly how I feel.

This place and a new friend of mine have changed me for the better. I'm going out on weekends, shopping for myself, spending time with people rather than sleeping all time. *Today's an exception*. I feel like a different person and I'm loving it.

I bought 3 T-Shirts, 1 Shirt and 1 Jeans for myself. I also bought a new phone and a 1 TB HDD. The last time I bought something for myself, was in Nagpur when I went to Nagpur Central with a friend of mine. So, I'm changing for the better, I hope.

I've also gone through a tough emotional phase. I'm not going to mention the reason. I just wanted to say that it wasn't all fun.

Sometimes you have to make tough decisions. I used to think choosing between Pizza Hut and KFC was tough. But only a few weeks back I understood what hard decisions really are. I know no one's understanding what I'm blabbering about. So, I'm gonna stop.

I've learnt so much in the past 2 months, from C# to "almost" having fun. I used to think that sitting in front of a computer, coding and getting paid for doing so is all I want. But things have changed. It's not that I don't enjoy it anymore. I still love doing all that. But there's so much more to do.

The last 2 months have been the best. I'm going to miss this place and all my dear friends. ALL OF THEM. I don't wanna go. I really don't.

I wish I could mention my friends' names, but you know who you are. Love you all(Some more than others).
Thank you, Everyone.

Diary Entry - February 22, 2015.

Hi.


It's been quite some time since I've last posted anything.

There is a reason to it. Usually I would post something about a pattern I would've observed. But right now I don't have anything to talk about because my thoughts aren't clear. This might be due to the fact that I just woke up after a 12 hr sleep. Might be. But there can be other reasons too.

Hey! You know what? I just found myself a topic to talk about - "My Hyderabad Trip". Nah. The title sucks. I think I'll go with "HYD19 to HYD18". Nope. I don't want a cheezy title such as "My ILP Journey". So, what should I go with??? "Hyderabad : A New Beginning". Nah. Sounds like a terrible name for a novel. I think I got it -  "The Last 2 Months". It's apt because today's February 22, 2015 and my joining date was December 22, 2014. Makes perfect sense.

I think I'm going to remove the "The" from the title. I, desperately, want to make a "The Social Network" reference, but I can't think of a good line. So........ Forget about it.

It's my last week here in Hyderabad. So my time here is almost over. This is the perfect time to sum up my "Journey *eyeroll*", just before I leave.

Thanks for reading whatever I post.