Sunday, 30 August 2015

5 Command Line Tips and Tricks in Linux

1. To audit the commands we’d run in past, we use history command. Here is a sample output of history command.
# history
Linux history Command Usage
history command example
Obvious from output, the history command do not output the time stamp with the log of last executed commands. Any solution for this? Yeah! Run the below command.
# HISTTIMEFORMAT="%d/%m/%y %T "
# history
If you want to permanently append this change, add the below line to ~/.bashrc.
export HISTTIMEFORMAT="%d/%m/%y %T "
and then, from terminal run,
# source ~/.bashrc
Explanation of commands and switches.
  1. history – GNU History Library
  2. HISTIMEFORMAT – Environmental Variable
  3. %d – Day
  4. %m – Month
  5. %y – Year
  6. %T – Time Stamp
  7. source – in short send the contents of file to shell
  8. .bashrc – is a shell script that BASH runs whenever it is started interactively.
history Command Logs
history Command Logs
2. The next gem in the list is – how to check disk write speed? Well one liner dd command script serves the purpose.
# dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img
dd Command Example
dd Command Example
Explanation of commands and switches.
  1. dd – Convert and Copy a file
  2. if=/dev/zero – Read the file and not stdin
  3. of=/tmp/output.img – Write to file and not stdout
  4. bs – Read and Write maximum upto M bytes, at one time
  5. count – Copy N input block
  6. conv – Convert the file as per comma separated symbol list.
  7. rm – Removes files and folder
  8. -rf – (-r) removes directories and contents recursively and (-f) Force the removal without prompt.
3. How will you check the top six files that are eating out your space? A simple one liner script made from du command, which is primarily used as file space usages.
# du -hsx * | sort -rh | head -6
Check Disk Space Usage
Check Disk Space Usage
Explanation of commands and switches.
  1. du – Estimate file space usages
  2. -hsx – (-h) Human Readable Format, (-s) Summaries Output, (-x) One File Format, skip directories on other file format.
  3. sort – Sort text file lines
  4. -rh – (-r) Reverse the result of comparison, (-h) for compare human readable format.
  5. head – output first n lines of file.
4. The next step involves statistics in terminal of a file of every kind. We can output the statistics related to a file with the help of stat (output file/fileSystem status) command.
# stat filename_ext  (viz., stat abc.pdf)
Check File Statistics
Check File Statistics
5. The next and last but not the least, this one line script is for those, who are newbies. If you are an experienced user you probably don’t need it, unless you want some fun out of it. Well newbies are Linux-command-line phobic and the below one liner will generate random man pages. The benefit is as a newbie you always get something to learn and never get bored.
# man $(ls /bin | shuf | head -1)
Generate Random Man Pages
Generate Random Man Pages
Explanation of commands and switches.
  1. man – Linux Man pages
  2. ls – Linux Listing Commands
  3. /bin – System Binary file Location
  4. shuf – Generate Random Permutation
  5. head – Output first n line of file.

Tuesday, 18 August 2015

Tips for buy a laptop


When you need to buy a laptop, how do you select the right one? For most people, we believe, it starts with the processor. How many cores it has? Whether it is the Core i3 or Core i5? Then, people want to know what is the speed of the processor and how much RAM is installed in the laptop. Then comes the amount of internal storage (hard disk) available inside the laptop. Finally, it is down to the weight and looks.
If a consumer likes the processor, amount of RAM, available internal storage and finds looks of laptop appealing he buys it. Of course, if the price is right.
But this is a wrong way to buy a laptop.
Over the years, companies -- and their sales people -- have misled consumers a lot by talking about components like processor and RAM and asking them to buy laptops on the basis of whether it has a Core i3 or a Core i5. But it is time you stop listening to the sales people and get a bit more proactive in how you choose your laptops. We tell you what you need to look for in your next laptop.
What is not important
Processor: Unless you are looking for a specialised laptop like a gaming laptop or a machine on which you want to 3D modeling, processor is no longer all that important. In the last few years processors have become very powerful. Nowadays, most of the general-purpose programs like a web browser don't even use 20 per cent processing power of a lowly Core i3 processor. Machine like MacBook Air that are utterly fast use just dual-core processor running at 1.4GHz. While buying a laptop, don't worry about processor. Yes, Core i7 is usually better than Core i5. And Core i5 is better than Core i3. But even if you are getting Core i3, it is more than enough for a general-purpose machine.
Amount of RAM: Nowadays, all laptops have 4GB RAM. And that is all you need. If you can get more, go for it. But don't buy a laptop just because it has 8GB RAM. There are more important things that you should factor in instead of going after RAM.
Graphics card: Are you going to play demanding games like Battlefield 3 on your laptop? No. Ok, then don't worry about graphics card. There was a time when integrated graphics chip used to be really weak. A graphics card made sense at that time. Nowadays, if you are looking for a laptop on which you can browse web and watch videos, don't worry about graphics card.
Screen size: Don't buy a laptop just because it has a large screen. A large screen with poor quality display or low resolution is going to affect your computing experience negatively. Instead, go for a better screen even if the size is small.
How fast it starts: Almost all new laptops start in less than 30 seconds. The worst ones will take around 30 seconds, the best ones (with SSD) will take around 15 seconds. But that is only when they are new. Gradually, they will start taking longer because as you install more and more programs, the start-up process begins to clog up. But that is not the point. The point is that often the difference between the best and worst laptops when it comes to the boot process is around 5 to 10 seconds. Is it this such a big deal that it should influence your buying decision? Laptop companies will say yes. We say no.
Ultra-fast DVD drive:  Laptop makers love to hype up DVD drives in their machines. They use phrases like "super multi double layer". The reality is that it doesn't mean much. Whether super or not, almost all DVD drives in laptops nowadays write and read stuff at similar speed. Despite the grand words that describe them, these drives are dirt cheap and probably come out of same factories in China irrespective of their brand name.
Security features: Don't bother about fingerprint scanners etc in your laptop. Once you have bought your machine, just put a decent password on it and your data is all safe. That is if you are a mainstream user. If you deal with the nuclear launch codes, then it doesn't apply to you. In this case, trust your IT guys to give you the right machine.
What is important
Quality of screen: What is the most important component in a laptop? If you say processor, you are wrong. The most important component in a laptop is its screen. Reason: Screen is something that is going to define your computing experience. It is your window into computers and the work they do. A bad screen means bad experience.
Unfortunately, it is rather difficult to find laptops with good screens. Blame laptop manufacturers for this. They often hype processors but ignore screens.
If you are spending a lot of money on your laptop -- something like above Rs.75,000 -- try to get a laptop that has IPS screen. Most laptops have TN panel screens. What is the difference? Here is an easy way to understand: Have you noticed that your photos look better on a Galaxy tablet or on iPhone compared to how they look on most laptops? That is because most tablets and phones use IPS screens.
If you are not spending this kind of money, at least pay attention to the screen. Visit a laptop show and check out the specific laptop model you have in mind. Carry a pen drive full of some colourful photos with you. Plug this into the laptop and see how the colours look. Do the colours in your photographs look faded or do they look vibrant? Vibrant colours are good. Also, tilt the screen, move the laptop, change the angle of your view, and see how fast colours fade or darken. If the colours don't change much, the laptop has a good screen.
Equally important is the brightness of the screen, particularly if you are going to use the laptop outdoors. Ideally, 60 per cent brightness level should make the laptop screen look good. If you have to bump up the brightness to 80 or 90 percent, the screen is not bright enough.
Finally, watch out for the resolution of the screen. Higher resolution screens make images and text look sharper. Ideally, go for a laptop that has 1080P aka FullHD or 1600 X 900 pixels resolution.

Keyboard and touchpad:
Two very important parts in a laptop but often overlooked by consumers. Good laptops have typing keys that are firm, don't rattle and give a kind of clicky or pushy feedback when they are pressed. Also, the keyboard should not flex and the size of keys should be big enough to make typing comfortable. Ideally, type 100 to 200 words on a laptop that you want to buy to get a feel of the keyboard. Buy it only if the keys feel right to you.
Touchpad in a laptop has to be responsive. It should make the cursor on the screen move smoothly when you use it. It should feel smooth and responsive to your fingers. If you are spending lot of money on your laptop, go for a machine that has glass touchpad (hint: MacBooks have glass touchpad).
Good quality of keyboard and touchpad is often a sign of overall quality of the laptop. There is a chance that if a laptop has a good keyboard and smooth touchpad, it is likely to have good overall build quality.
Build quality: Don't go by looks. Pick up a laptop and see how it feels in hands. Is the plastic used in it good? Is it sturdy? Do the screen hinges feel durable? Does the screen flex (it shouldn't)? See the finishing of the laptop. The build quality of a laptop is very important because that will determine how long it is going to last.
Ideally, go for laptops that have bodies made of metal like aluminum or magnesium alloy. Carbon fibre bodies are also fine. But these are expensive. If you are looking for plastic body laptops, go for those that feel sturdy and have impeccable finishing.
Speakers: Before you a buy a laptop, go to a store with a pen drive full of your favourite songs. Play these songs on the machine you want to buy. If your laptop has a good set of speakers, it will help you enjoy the YouTube videos. Don't you want that?
Weight: This is particularly important if you want to carry around your laptop. Go for lighter laptops -- under 2kg -- if you are going to carry it around in your bag.
Battery life: Very important. Go for laptops that offer to claim better battery life. Unfortunately, except Apple no one really advertises true battery figures for their laptops. But still if someone claims to give 10 hours battery life in a laptop, it is likely that the machine will last for at least 7 hours, which is better than the laptops claiming to give 6 or 7 hours of battery life.
SSD or embedded flash storage: If you don't need tons of storage (hint: you don't if you are not going to store movies) go for laptops that have SSDs. A SSD really makes a difference to how well a laptop responds. A laptop with Core i3 processor and a SSD will feel faster compared to a laptop with Core i7 and a 1TB hard disk. If SSD-equipped laptop is out of question, go for a machine that has embedded flash storage (around 20GB or more). The embedded storage helps laptop feel faster. This type of laptop won't be as fast as one with SSD, but it will be quite close.

One last thing:
When it comes to buying a laptop, don't go by the specification sheet that a salesman will give to you when you walk into a store. Go by what you see. The components like screen, keyboard, touchpad and the laptop body that you can see are more important. The internal hardware is more or less same in every laptop in a particular price bracket.

Sunday, 9 August 2015

How to Get Clear Skin at Home



How to Get Clear Skin at Home

Every woman wants picture-perfect, flawless skin. Clear and beautiful skin is one of the main elements of a person’s beauty. Healthy skin helps you feel beautiful as well.
Your skin care regimen and lifestyle habits are the primary predictors of your skin’s health. Some of the leading factors that take a toll on the quality and texture of your skin are stress, lack of sleep, poor nutrition, pollution, damage from the sun’s ultraviolet rays, excessive smoking and drinking alcohol.
There are thousands of skin and beauty care products that promise to give you clear and glowing skin. Instead of relying on these products, you can try some simple and easy home remedies to improve the overall health and appearance of your skin.

how to get clear skin at home

1. Lemon

Lemon is one of the best ingredients that you can use to promote clear skin. The citric acid present in lemon helps keep the skin clear by removing dead cells, and its vitamin C content helps reduce dark spots by increasing the cell renewal process. Lemon also has bleaching properties that will help improve your overall skin complexion.
  • Apply fresh-squeezed lemon juice to your entire face and neck. Leave it on for 10 minutes and then wash it off with lukewarm water. After this, rub cucumber slices on your skin to soften and moisturize it. Do this daily or every other day.
  • Another option is squeeze the juice of one-half lemon and mix one to two tablespoons of raw honey in it. Apply it on your face, leave it on for 15 to 20 minutes and then rinse it off.
  • To exfoliate your skin, mix two teaspoons each of lemon juice and sugar. Apply the mixture on your face, neck and hands. Scrub in a circular motion and leave it on for 10 minutes. Then rinse it off with lukewarm water. Follow this remedy once a week to enjoy glowing skin.

2. Turmeric

Turmeric is an excellent antiseptic and skin-lightening agent that helps minimize scars and other marks. Plus, turmeric can alleviate allergic, inflammatory and infectious skin disorders that make your skin look dull and lifeless.
Home reemdy to get clear skin
  • Mix one tablespoon of turmeric powder with enough pineapple juice to make a paste. Apply the paste to your face and neck. Leave it on until the paste dries completely. Then wash it off with lukewarm water. Follow this remedy two or three times a week to reduce the appearance of spots on skin.
  • Make a paste by mixing equal amounts of turmeric powder and gram flour with a little water or milk. Apply it evenly on your skin and leave it on until it dries. Wash it off with lukewarm water, scrubbing your skin gently in a circular motion. Follow this remedy once a week to lighten your skin tone and remove scars.

3. Honey

To enjoy clear skin, your need to keep your skin well moisturized. Honey is a great moisturizer and also has antibacterial properties that help ward off infection.
  • Apply raw honey directly on your skin. Let it dry naturally and then rinse it off with lukewarm water. The water content in honey will deeply moisturize the skin, making it soft and supple. Do this simple remedy once daily or every other day.
  • Alternatively, mix two teaspoons of milk and one teaspoon of honey. Then add one teaspoon of gram flour and mix it in well. Apply it all over your face. Leave it on for 20 minutes and then rinse it off with warm water. Use this face mask once a week to enjoy radiant and clear skin.

4. Aloe Vera

Aloe vera has many benefits for the skin. It has antibacterial properties that help kill bacteria that cause acne, anti-inflammatory properties that help soothe irritated skin, and astringent properties that help heal scars. Plus, aloe vera moisturizes the skin and stimulates new skin cell growth.
  1. Extract the gel from an aloe vera leaf.
  2. Apply the gel on your face using a cotton ball.
  3. Allow it to dry on its own for about half an hour, and then rinse it off with lukewarm water.
  4. Follow this remedy daily or several times per week.

5. Baking Soda

Baking soda balances pH levels of the skin, which is very important to maintain clear skin. Plus, its mild antiseptic and anti-inflammatory properties help deal with problems like acne, pimples and spots. It also works as an excellent exfoliating agent to keep the skin free from dirt, impurities and dead skin cells.
  • Mix one teaspoon of baking soda with one teaspoon of water or lemon juice to make a paste. Cleanse your face and use the paste to gently exfoliate the skin. Finally rinse your face with lukewarm water and pat it dry with a towel. Follow this remedy two or three times a week.
  • Alternatively, mix one teaspoon each of baking soda and raw honey. Apply this mixture onto damp skin and massage gently for just one minute. Then wash with lukewarm water. Finally, splash some cold water on your face to close the pores. Follow this remedy once a week.

6. Cucumber

Cucumbers contain hydrating, nourishing and astringent properties that are very good for skin. They can improve the overall appearance of your skin by repairing damaged skin cells, removing dead skin cells and adding a fresh glow.
  • Cut a fresh cucumber into thick slices, and rub them thoroughly all over your face. Leave it on overnight and rinse with warm water in the morning. Do this daily before going to bed.
  • Alternatively, make a mixture with equal amounts of cucumber juice and lemon juice. Apply this mixture to your skin, allow it to dry completely, and then wash it off with warm water. Do this daily.
  • 7. Papaya

    papaya
    Papaya can be used to improve your skin’s texture and maintain clear skin. It has natural bleaching properties that help reduce the appearance of scars. Plus, the enzyme papain present in papaya has antibacterial and wound healing abilities and also aids in removing dead, damaged skin.
  • Chop a ripe papaya into small pieces.
  • Combine the papaya with one teaspoon each of sandalwood powder and honey. Grind these ingredients into a paste.
  • Apply the paste all over your face and neck.
  • Leave it on for half an hour. Then rinse it off with cool water and pat dry your skin.
  • Finally apply some rose water on your face.
  • Follow this remedy once a week to notice a visible change in your skin tone.

8. Walnut

walnut
Walnuts can bring a beautiful glow to dull, dry and lifeless skin. Walnuts have antioxidants that help repair skin cells and promote radiant skin. Walnut in powder form can be used to exfoliate your skin and remove impurities and dirt that an ordinary cleansing product cannot do.
  • Mix two teaspoons of walnut powder with two tablespoons of plain yogurt to make a paste. Apply this paste on your face and neck. When the paste dries, scrub the mixture around your face and then rinse it off with lukewarm water. Use this face mask once a week.
  • Soak three walnuts in water overnight. In the morning, mix in one teaspoon of rose water to make a paste. Apply the paste on your face. Leave it on for an hour and then rinse it off with lukewarm water. Follow this remedy once a week.
  • You can also eat two or three walnuts with a glass of milk every morning.

Tips to Simplify Your Web Design

Simplicity rules! It makes a websites look sleek, reduce nagivation confusion and it helps achieving desired goals and results (I.e., more signups, subscribers and sales). But too often it seems elusive to simplify your website design. No matter how hard you try, you can’t make your work look like Apple’s. So what does a website designer really needs to do? Fret not, for there are 5 starting points to simplify your website design.

1. Focus Only On Essential Elements :-

This first step probably seems forehead-slapping obvious: of course I should put the focus on the essential elements in my site, what am I, an idiot? But a surprising number of websites fail to achieve this and the result is a big mess of important and unimportant elements spewed onto a page. I’m as guilty of doing this in the past as anybody. It’s hard to be objective and prioritize what’s important or not, because everything seems essential. If you want your website design to be simpler, identify what needs to be focus, just like with any good visual design or piece of art. And that means putting the focus only on the essential elements.


Use the 80-20 rule

What 20% of what’s on a page gives 80% of the value and content that people go there for? It could be the copy, some social proof (review snippets, testimonials, media badges), and a signup form or call-to-action button, for example. That’s the 20% right there. On your website, as well as on each individual page, focus on displaying only the 20% of site elements that are delivering 80% of that usefulness.
This isn’t a technical step but a principle that you can use as your guide to simplify your website design constantly. The 80-20 rule will help simplify your website design by pushing you to trim your site elements down to the essentials. What’s really cool is that the 80-20 rule can also help increase your desired results that you hope to achieve on your website. For example, an increased conversion rate in visitors subscribing, signing up, or buying. How? You’re making it so there are less distractions and things for visitors to click on to leave the page.
As we all know, we’re always looking for an excuse not to purchase something at the final step, and any reason to navigate away is a good one. Reduce those reasons and click-away options with the 80-20 rule.
Chris Pearson, creator of the popular Thesis WordPress theme framework, says this is exactly what helped increase sales on his website.


2. Get Rid of All Unnecessary Elements

We’re continuing with the 80-20 rule here.
Now that you’ve identified the 20% of website elements that will get you 80% of your desired results, it’s time to get rid of all unnecessary elements. In other words, the 80% of website elements that will get you only 20% of results. It could be social media sharing widgets, sidebar elements, blog post meta details (date, time, author, number of comments, etc), or links in the footer (this is especially a huge culprit a lot of the times, particularly when the visitor is looking for the aforementioned excuse to navigate away from the page).

3. Reduce the Number of Pages

A large part of simplifying your website design is to simply have fewer places to explore and click around. You can do that by trimming the page count. Either get rid of unnecessary pages that deep down inside you know aren’t needed, or at the very least, fuse multiple pages into one. I mean, you don’t really need to separate "about the site" and "about me" pages.
Firstly, get in the mindset of the visitor – if you were to arrive on your website, what are the key things would you want to do? For instance find out what your stuff is about? Or contact you? Next, make sure that your pages facilitate what is necessary and nothing more. Don’t keep unnecessary pages on your website because you think you need to, or because other websites have them. When you reduce the number of pages on your website, not only it is easier for your visitors to focus on your content because there’s less places to click around, but your navigation menu is simpler too.
We’ve all been on websites with too many nav menu items. We don’t know where to start navigating because we get overwhelmed by the choices. And when we get overwhelmed by being presented with too many choices, we go with choosing nothing. By having as few nav menu items as possible, you make your website not only simpler but more inviting and friendlier to visitors.

4. Get More Content Above the Fold

Studies have shown that a majority of people spend most of their time above the fold on web pages (what shows up on the screen without scrolling down). So if you want to increase the effectiveness of your website, have the main content and call-to-action elements above the fold. You can do something as simple as shortening the header height if you have a logo and a navigation menu at the top of your website.

This involves nothing more than changing the header’s "height" value in your stylesheet (typically style.css or stylesheet.css). Also, see if a sign-up form or button is below the fold. Move that element higher up in the page so it’s the first thing a visitor sees. After all, that is your desired call-to-action of the visitor, so decrease the work needed to get to it (ie. scrolling).

5. Limit Your Color Scheme

It’s easy to get carried away with colors. Why settle on 2 or 3 colors when you can have 12 or 13? But in order to simplify your website design visually, you need to limit your color scheme. When in doubt, use fewer colors. It’ll vary based on your design of course, but try sticking with no more than 2 or 3 colors to start off. If you need more subtlety and texture to your visual design, use shades of the same color – light blue for the background and darker blue for header and menu items.
I’m as guilty as anyone with getting wild with colors in the past. I’ll add this color, then another, and another – and before I know it, it looks like a rainbow diarrhea all over my website. You can have your website constructively simplified, but if the colors distract the eyes when you look at it rather than complimenting the content, then all that effort was for naught. So use fewer colors with your website design instead.
Having trouble choosing a color to start with? Before & After magazine has a useful free e-book on how to find the perfect color here. Need help with picking a color scheme? Try out this handy color scheme generator.