Total inode count for a particular user in linux

Each file and directory on a Linux filesystem uses an inode. Shared hosting accounts are often limited on the number of inodes as well as on disk space, so an account can hit its limit with plenty of space left, usually because some cache or session folder has filled up with thousands of small files. This one-liner shows how many files and folders each directory holds, so you can see where they are. ...

February 17, 2020 · 3 min · Harshvardhan Malpani

Radio buttons CSS for wordpress elementor form markup

Radio buttons in an Elementor form use the browser’s default style, which rarely matches the rest of a site. This CSS hides the native radio circle and draws a custom one in front of each option’s label instead. The selected option gets a filled circle, and the option with keyboard focus gets an arrow after its label. It relies on the markup of the form widget in Elementor Pro, which outputs each option as an <input type="radio"> followed directly by its <label>. The + in the selectors (the adjacent sibling combinator) means “the label that comes right after the radio button”. ...

February 13, 2020 · 3 min · Harshvardhan Malpani

This unique date 02 02 2020 will come after 1010 years – WRONG MATH

In dd/mm/yyyy format, 2nd February 2020 (02 02 2020) is a palindrome: the digits 02022020 read the same backwards. In really common beliefs, WhatsApp forwards were filled with this number being so rare and unique. However it would be stupid to say that such a rare date will occur only after 1010 years. Here is how: In whole millennium (1000 years), first few years of first few centuries have many of such dates. Even if you consider MM/DD/YYYY format, you can find a lot of such numbers in first few centuries. ...

February 2, 2020 · 2 min · Harshvardhan Malpani

10 tips for better freelancing

How to improve yourself as a freelancer? Here are 10 points to take care of: Communication skills – convincing power. Clients hire people they understand and trust. Explaining clearly what you’ll do, asking the right questions and keeping the client updated matter as much as the work itself. Make yourself a brand. Your ethics will define your future in freelancing. Your reputation follows you from one project to the next, and it’s what brings repeat clients and referrals. This will help you in scaling also. Consistency, focus and dedication. Turn up regularly, finish what you start, and give each project your full attention. Productivity is gold. Know your value, do the math and target a monthly number: work out what you need to earn each month and how many hours you can realistically bill, and that tells you what to charge and how much work to take on. Read!! Know the client’s requirements in depth. If it is a small task, fix it already, without getting the project. Solving it before you’re hired shows the client you’ve understood the problem. This approach will consume time without paying, but it would probably make you better. Keep challenging yourself, keep improving. Stay away from template bids. Nobody wants to know which app you did 4 years ago if the project is not about an app. A copy-pasted proposal is easy to spot, so write each bid for the project in front of you and mention past work only when it’s relevant. Keep your portfolio updated, so clients see what you can do now, not what you did years ago. Take care of the clock. Predict and quote project timelines intelligently: estimate realistically, allow for surprises, and tell the client early if a deadline is at risk. Exceed the expectations of your client. Under-promise and over-deliver.

January 22, 2020 · 2 min · Harshvardhan Malpani

How to migrate Customers from Magento2 to WordPress?

Lets break it into 2 parts: a. Migrate Customer data b. Migrate Customer Passwords 1) Migrate Customer Data from Magento2 to WordPress This is rather easy to be honest, there are several plugins for importing data from CSV and then mapping the CSV fields. My recommended plugin is Customer/Order/Coupon CSV Import Suite by SkyVerge It basically does everything from customer email to customer address data. It also provides column mapping and custom attribute import for all users. Also comes with multiple configuration options. ...

January 1, 2020 · 2 min · Harshvardhan Malpani

How to solve MySQL server gone away error Maria Db update on cPanel and WHM?

This is related to new MariaDb upgrade from 10.1.41 to 10.1.42 and also for servers which were updated from 10.2.27 to 10.2.28 Go to solution ( Special Thanks to @Valetia ) You will see errors in following formats/messages: No file or input found MySQL Server has gone away Connection to MySQL Server failed sqlstate[hy000]: general error: 2013 lost connection to mysql server during query General error: 2006 MySQL server has gone away ERROR 2006 (HY000): MySQL server has gone away ERROR 2013 (HY000): Lost connection to MySQL server during query Log files (/var/lib/mysql/$hostname.err) will have or can have any of these errors: ...

November 6, 2019 · 1 min · Harshvardhan Malpani

A basic time difference calculator in google script js

I wanted a quick way to work out the number of hours between a start time and an end time in a Google Sheet, for a simple timesheet where a shift can run past midnight. Google Sheets lets you write your own spreadsheet functions in Google Apps Script, which is JavaScript, so I wrote a small custom function called dodiff. It takes two time cells and returns the gap in hours as a decimal, so 4 hours 30 minutes comes out as 4.500. ...

October 15, 2019 · 4 min · Harshvardhan Malpani

How to add Facebook Messenger for live chat on your website?

How to add facebook messenger in website so that users can chat live to your page? Requirements: Page ID – you need to know what is your page id Whitelisted Domain – you need to add website on which you want show widget in your page’s whitelist Access to add/edit code in your website 1 – Getting Page ID Go to your page, click on about, scroll down a bit and you will see Page ID ...

October 7, 2019 · 2 min · Harshvardhan Malpani

Convert dropdown attribute to text swatch in Magento2 Admin Panel

Magento 2 lets you change an existing Dropdown attribute into a Text Swatch from the admin, but the swatch text for each option isn’t filled in for you. The option labels end up in the Description fields, and the Swatch fields next to them need a value too. With a colour or size attribute that has dozens of options, typing them all in again by hand is slow and easy to get wrong. ...

September 24, 2019 · 2 min · Harshvardhan Malpani

How to change attribute dropdown type to multi-select in Magento 2?

You created a product attribute as a Dropdown, and later realised that a product needs to have more than one value for it, so it should have been a Multiple Select. When you edit the attribute in the admin, the input type can’t be switched to Multiple Select. Short Answer: Not possible via Magento2 Admin Backend. The two types store their values differently. A dropdown keeps one option ID per product in an integer column, while a multi-select keeps a comma-separated list of option IDs in a text column, and uses a different backend model to save it. ...

August 29, 2019 · 2 min · Harshvardhan Malpani