Terrified | Content | or Not

I am terrified that I am so content, and terrified that I am so not.



Database structure of user table for a web based application (generic)

Table name = users

first_ name // You don’t want to be called stupid
last _name // Definitely, you wouldn’t want to be called as
email // This is what we need
password // salted/hashed – you know, for security and all
IP address // Why? Why Mr. Anderson?
created // Help us identify the date you were wandering and got stuck
photo // How do you look (I know, I know – looks don’t matter, but still… smile please)
status // By default > Inactive | We want you to click on the link that we sent in the email when you register

email_verified // Default > 0 | When click on signup verification link or forgot password link | Account status is not as same as verified email
phone_verified // Default > 0 | When correct OTP is entered

id_facebook // Facebook profile ID
status_facebook // Default > 0 | In case you are registering with email
photo_facebook // In case you want to make yourself visible using your Facebook photo (really?)



forgot_password_hash // When you forgot your password, and we send you a link (which is unique, btw), we keep a copy of the hash in the system (of course, to uniquely identify the link that you will need to click to reset the password)
remember_me_hash // When you click the little checkbox that says “Remember Me” then we create a hash and store it in DB. The same hash is also saved in a cookie, so that when a session is not found (or expired) then before sending the user to login screen,

user_status // Default > 1
adviser_status // Default > 0

username // Adviser username



1. Register : Sign up > Send email with verification link > Click on email link to verify > Thank you page > Link to login + Automatic redirect to login page after some time (5 seconds)

2. Forgot Password : Sign up / Login > Forgot password > Enter email > Send link in email > Click on email link to enter new password and confirm password > After successful password change > Thank you page > Link to login + Automatic redirect to login page after some time (5 seconds)

3. Login : Email + Password > User Profile page

4. Remember me : If checked, then save hash in cookie > If logged out, but cookie hash is valid, then don’t redirect to login page, but login using the hash and send to User Profile page

5. Social Login : Get details from social network (FB / Twitter / Google+) > Type (Social type) + ID (Social ID) > Check if email is available from Social data already exists in system or not > If it exists, then update the Type and Social ID for that user, and login that user, if the social email does exists in our system, then create a new user record and login with that user.




Seven things

Do these, and ensure success:

  1. Become competitive (if not already)
  2. Finish things (don’t let them hanging – books, assignments, projects, chores)
  3. Ensure your super close circle is better than you(in whatever way you want to improve)
  4. Never let the mind rest
  5. Make sure other credible(successful) people give you credibility
  6. Learn more
  7. Obsess



CakePHP 2.x | Console | cake bake all | Windows + Linux

In CakePHP the “cake” (console) command can be used to bake scaffolding Model, View and Controller files (to quickly create content management system).

Following is the command
“cake bake all”

“cake” is the actual command.
“bake” and “all” are parameters (other options are available to selectively bake stuff – M/V/C).

“cake” is the Linux shell command.
It will not run on Windows, because it is a Linux shell command.

To run this on Windows you will need to use cake.php (available in the same folder – app/Console).

Since, by default, php path is not available in command line, so you will need to provide php path also.

So, the final command will be something like following:
(assuming, XAMPP is installed – and, you are already in c:\xampp\htdocs\cakeproject\app\Console)

c:\xampp\php\php.exe cake.php bake all


Basic Linux shell commands for new users

touch a.txt (to create a new blank file)
ll (to list all the files in this folder)
ll | grep john (to filter the files matching the pattern – john – in this case)
ll | grep tac

chmod 0777 test_file (to make the file fully writable for all users – not recommended for production environment)
chmod 0777 test_folder (if this is a folder, then the permissions are set for this particular folder only)
chmod -R 0777 test_folder (Applies the permissions to all the folders and sub-folders inside this folder)