Total inode count for a particular user in linux

Inode usage for current working directory echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n" Use cd ~ to change pwd to current user home cd ~ Reference: Magesh from 2daygeek : https://www.2daygeek.com/linux-check-count-inode-usage/

February 17, 2020 · 1 min · Harshvardhan Malpani

Radio buttons CSS for wordpress elementor form markup

[type="radio"]:checked + label:before { background: #bc6060; box-shadow: 0 0 0 0.25em #000; } [type="radio"]:focus + label:after { content: '\0020\2190'; font-size: 1.5em; line-height: 1; vertical-align: -0.125em; } [type="radio"] { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } label { display: block; cursor: pointer; line-height: 2; font-size: 1.2em; } [type="radio"] + label { display: block; } [type="radio"] + label:before { content: ''; display: inline-block; width: 1em; height: 1em; vertical-align: -0.25em; border-radius: 1em; border: 0.125em solid #fff; box-shadow: 0 0 0 0.15em #000; margin-right: 0.75em; transition: 0.5s ease all; }

February 13, 2020 · 1 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 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 · 1 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 Make yourself a brand, your ethics will define your future in freelancing. This will help you in scaling also Consistency, Focus and Dedication Productivity is Gold, know your value, do math and target for a monthly number Read!! know clients requirements in depth, if it is small task, fix already without getting the project. This approach will consume time without paying, but would probably make you better keep challenging yourself, keep improving Stay away from template bids, no body wants to know which app you did 4 years ago if the project not about an app Keep your portfolio updated Take care of clock, predict and quote project timelines intelligently Exceed expectations of your Client, under-promise and over-deliver

January 22, 2020 · 1 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

In your Google Sheet, Click “Tools” and then choose “Script Editor“. Put the code given below. Don’t forget to use function in your result column as “=dodiff(cell1,cell2)“ function dodiff(a, b) { if (a) a = fix(a); if (b) b = fix(b); if (Array.isArray(a) && Array.isArray(b)) { if (b[1] > a[1]) m = b[1] - a[1]; else { m = b[1] - a[1] + 60; b[0]--; } if (b[0] >= a[0]) h = b[0] - a[0]; else { h = b[0] - a[0] + 12; } m = m / 60; return (h + m).toPrecision(4); } } function fix(a) { if (a) x = a.toString().replace(" ", '').replace("am", "").replace("pm", "").replace("PM", "").replace("AM", ""); x = x.split(":"); x[0] = parseInt(x[0]); x[1] = parseInt(x[1]); return x; }

October 15, 2019 · 1 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

Run the following code in console: $=new jQuery.noConflict(); $("#swatch-text-options-panel tr td:nth-child(4) input").each(function (e,el) { $(this).parent().parent().find("td:nth-child(3) input").val($(this).val());});

September 24, 2019 · 1 min · Harshvardhan Malpani

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

Short Answer: Not possible via Magento2 Admin Backend. Solution: You need to update eav_attribute table and edit information about backend_source, frontend_input etc. Simple query for that is: UPDATE `eav_attribute` SET `backend_model`="Magento\\\Eav\\\Model\\\Entity\\\Attribute\\\Backend\\\ArrayBackend", `backend_type`="varchar", `frontend_input`="multiselect", `source_model`=NULL WHERE `attribute_id`=YOUR_ATTRIBUTE_ID_INTEGER LIMIT 1 Replace YOUR_ATTRIBUTE_ID_INTEGER with your attribute_id like 355 Reference: https://stackoverflow.com/a/57701845/2229148

August 29, 2019 · 1 min · Harshvardhan Malpani