Reset Lubuntu, Ubuntu or Any Debian Based Distro and Migrate to Other Distro

I was using Lubuntu since last two months on my laptop. But I had scrambled some PHP versions and had multiple apache2 installations. Moreover, my ibus based language input system was conflicting with a earlier installed version.

I was also not happy with the graphics and performance of Lubuntu. So I decided to have a fresh Ubuntu install.

I used Rufus first but the pen drive did not boot. Checked the boot priority, it was okay and the USB device was the first priority. Tried again and failed.

I don’t know why I enabled fast boot later but that totally removed the bios accessing system. Esc, F1, F12, Del… none of the keys helped.

So used the “Startup Disk Creator” tool of Lubuntu. I had some issues earlier last week when I tried to set up a IP Logging server and used “Unet bootin”. So did not try that one. Nothing was helping and it was 12 in the morning.

Then suddenly it clicked on my mind that Lubuntu is a variant of Ubuntu, so I might be able to migrate. So after a couple of searches. I found the commands. But despite following each and every step carefully, Lubuntu was still there.

At the end, I came to know about Resetter – an awesome tool to factory reset any Debian based distro.

It worked really quick and did the trick!

Here is the repo link of Resetter

https://github.com/gaining/Resetter

If you have any questions, please free to ask them in the comments section. I will try my best to help.

How to Renew Let’s Encrypt SSL

Recently I wrote a tutorial to install Let’s Encrypt SSL on a shared hosting. The SSL certificate of my site is about to expire next month and I got 2 notification emails. So I have renewed the certificate today.

Read More

How to Install Let’s Encrypt Free SSL on NameCheap Shared Hosting

Last year, I heard about Let’s Encrypts free SSL. But I was using WordPress.com to host my website. So I already had SSL on my site. So I did not pay much attention to it.

From 2017, I am quite serious about my site and have a plan to write regularly on my blog. I have a “bad reputation” for coming up with a new idea every morning. So yesterday I installed the free SSL certificate on my shared hosting and saved 10 USD!

So here’s how I did it.

  1. Searched for “Free SSL” on google. (I forgot the name Let’s Encrypt 😝 ).
  2. Then I found a couple of organizations and the name “Let’s Encrypt” clicked in my head! Because my boss mentioned this name earlier.
  3. Then I searched again “Let’s encrypt on a shared hosting” and opened another tab to check if NameCheap has any built-in support for Let’s Encrypt. So I searched again.
  4. Then I found this article: How To Install Free SSL From Let’s Encrypt On Shared Hosting
  5. Opened up the terminal on my MacBook and wrote
    ssh -p 21098 myUserName@sekander.pro
    Here  -p 20198 is the port number for shell access. I got the port number from NameCheap’s Support doc.
  6. Then I used my cPanel password as the shell password.

    But the terminal told me that I do not have shell access enabled on my hosting. So I contacted NameCheap support via live chat.

  7. So I logged in again and ran the commands following commands
    git clone https://github.com/kelunik/acme-client
    cd acme-client
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"; php composer-setup.php; php -r "unlink('composer-setup.php');"; php composer.phar install --no-dev
    php bin/acme setup --server letsencrypt --email your@email.com
    php bin/acme issue --domains yourdomain.com:www.youdomain.com --path /home/x123011738/public_html:/home/x123011738/public_html --server letsencrypt
    Requesting certificate ...
    Successfully issued certificate.
    See /home/x123011738/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/yourdomain.com
    cd /home/x123011738/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/yourdomain.com

    Then I copied the contents of the fullchain and key file using the commands below and saved on my desktop with the same name.

    cat fullchain.pem
    cat key.pem
  8. Then, I logged into the cPanel of my site and found the option to manage SSL Certificates. I selected the domain and uploaded the files I have made on my desktop.If your site has static HTML files, then you’re done till here. But mine is a WordPress powered site. So I had to change the URL structure from wp-admin → Settings → General. I have changed http://sekander.pro to https://sekander.pro and then saved the settings.
  9. But I was not happy yet. Because I found the SSL certificate on the single posts and pages. But it was not working on the homepage 😐
  10. So I had to google again “Setup SSL WordPress” and found that I need to paste something in my .htaccess file!
  11. I logged in to the cPanel again and good lord! There’s no .htacess file on the hosting root! How’s this possible! How can a WordPress site run without a .htacess file!
    Then my colleague, who luckily works on the Dokan plugin support team, told me that it could be hidden. So I enabled showing hidden files and voila! The file was there with hefty lines of rewrite rules and allowing file types to uploading.
  12. I pasted the following lines at the very end of the .htacess file
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
    </IfModule>

    This article has more detailed information: How to Add SSL and HTTPS in WordPress

    It helped me to redirect the traffic with http to redirect to https. So now I can see the green https on the home page 😄

  13. I have setup a cron job to renew the SSL certificate every month.

This is all I have done to activate SSL on this site. If you get confused or need any clarification from me, feel free to comment below 🙂

Use Two Different Language in WordPress – One for Admin Another for Readers

Have you ever wondered how can you use two different languages in WordPress? Well I don’t know about others, but I personally don’t like the Bengali translation that much in dashboard. Coincidentally one of my Facebook friend asked me about using English in dashboard and Bengali in front!

I have never tried doing this, but my sharp little brain instantly got a witty hack idea! If you are a developer, and worked with the internationalization of WordPress, then you may know, we can set the language of WordPress from wp-admin → Settings → General. But that language works on both front and back.

I have set the language to English (United States) from settings. So both front end and back end is showing English.

The theme is responsible for the front end interface. So I have translated the theme into Bengali (Bangladesh) and put the file in `wp-content/languages/themes/`.

If you are wondering why I did not put the file on wp-content/themes/myTheme/languages/, because the translation file will be erased upon update.

What’s the hack?

The theme translation file contains the translation for Bengali (Bangladesh). So the file name should be `mytheme-bn_BD.mo` but I have named the file `mytheme-en_US.mo`. Because WordPress is set to load the English language. If I name the file for Bengali, it will not work.

Is this legal?

NO! This is completely offensive and might piss off some “Standards Nazis”. This is never a recommended way. I personally never recommend this kind of hipster configuration and alteration. But hackers never worked in conventional ways 😉

If you really feel witty today and thinking about using different languages, then you may test on your localhost.

You can’t curse me for using this trick on your live site. Go ahead, but on your own risk!

Change texts in WordPress without touching the code!

 

Last Updated: [last-modified]

Want to change a label or wording of a WordPress plugin or theme? Want to whitelabel the entire WordPress environment for your client? This tutorial is for you!

In this post, we will learn how to change any text within the WordPress environment without touching any code!

Read More

রান্না না জেনেও রেস্টুরেন্ট খুলে লাখপতি হবার উপায় – না পড়লে মিস!

ভারতীয় নাটক, জামা, জুয়েলারি থেকে শুরু করে এমন কিছু নেই যা আমাদের প্রিয় না। আর ঢাকার ইন্ডিয়ান খাবারের তো জুড়ি মেলা ভার! তারই ফিরিস্তি দিচ্ছি আজকের পোস্টে।

সপ্তাহে ২-১ দিন রান্না ঘরে থাকা আর লাইফস্টাইল চ্যানেল গুলোর সুবাদে সব মশলাই কম বেশি চেনা। খাবার মুখে দিলে আন্দাজ করতে পারি কি কি ব্যাবহার করা হয়েছে। সেই আলোকে আজকে কিছু রেসিপি দিচ্ছি; কলিজায় জোর কম থাকলে বাসায় বসে অল্প পরিচিত ফ্রেন্ডদের সাথে বিরক্তিকর আত্মীয়দের সাথে ট্রাই করতে পারেন 😜

Read More

How to add external products to Easy Digital Downloads

Easy Digital Downloads does not have external product listing feature on their core. So if you want to do affiliate marketing or list your products which are being sold from another domain, you need to install a plugin.

A free plugin is available on WordPress.org to add this feature. Read More

How to install WP CLI in OSX El Capitan

I recently got a MacBook Pro from my office. If you have read any of my blog posts before, you already know that I make my living from WordPress.

So this morning I thought I would install WP-CLI to save some time and “take some vaab” in front of my other colleagues ?. Here Are the steps I have followed-

Read More