Use Docker-Compose To Start A Lightweight Virtual Machine Container of Locally Installed WordPress

I’m not a Docker guy because I don’t use it often. Basic commands such as “docker ps” are probably new to me, meaning I can’t easily remember them. Regardless, there are plenty of online resources for me to tap into regarding Docker, so I’m not too fretted about forgetting what command to use with Docker. Today, I found a fun Docker activity. Yep, you can already see I’m a Docker noob. Regardless, this activity is about creating a docker-compose file, then spinning up Docker to start all services that run a locally installed WordPress. This docker-compose file could be found on the Internet easily! I got a very fast Internet connection too, and so it took Docker about a minute or two, I think, to just pull the latest WordPress and MySQL 8 (or 5.7 if you want to use this version) images down to my local machine – and just a few more seconds to start the whole locally installed WordPress up.

Why is it fun to do this? Well, I’m not a PHP developer! This means I can’t just write any PHP script to take care of whatever itch I have with WordPress. WordPress is based on the PHP programming language. I am though love to code in Python, and so I thought — hmm… what if I want to Djangorize WordPress? This means, I want to export all WordPress blog posts I have on a WordPress website of mine to a Django blog web app that I will code soon – but I have way too many WordPress blog posts! The problem is I’m not also an XML guy, and so WordPress’s export file I downloaded gives me pause. Although XML’s basic rules aren’t hard – because it’s an extensive markup language – meaning tags are extensive (not restrictive like HTML) – meaning you can make up your own tags pretty much. For example, in HTML, you can only use a built-in tag such as <div></div>, but in XML you could just make up a tag like <friend></friend>. Anywho, but the XML file I downloaded from WordPress’s export (exported my WordPress blog posts) is so huge and long – one look at it I got confused. So, my original solution is to use docker to start a local WordPress up, import the export XML file from the WordPress XML file download earlier – and then just export all the blog posts to CSV. See, I can’t export WordPress blog posts directly to CSV earlier because I’m not hosting my own WordPress, but I’m using WordPress.com’s official WordPress hosting service; these guys don’t allow you to export your blog posts to any other format besides XML. Unfortunately, if I want to use local WordPress to import XML and then export to CSV file format, I have to pay for a WordPress plugin – which I don’t want to do! Regardless, it was fun to do docker-compose!

So, what now? I kick myself a bit because now I remember that Python got Pandas that can read XML files. So, I went to all the troubles with docker-compose for naught. On the plus side, I got a local backup of my current running WordPress blog. Hooray! Anyhow, I’ll use Python, Pandas, and BeautifulSoup to organize the XML blog post data to my liking in the future, and in this way, I’ll able to write a Python script that allows me to import WordPress blog posts to Django’s blog web app. For now, I’ll leave you with a fun docker-compose file that allows you to start up a docker container that contains essential running services like MySQL to let you play with a locally installed WordPress.

One more thing, you need to download Docker yourself before you can use this docker-compose file. Once downloaded and install Docker, create a new folder on a Windows machine and name it “wordpress-local”, but you can name this folder with whatever name you like. Copy and paste the docker-compose file below to a file in this “wordpress-local” folder – and save this file as “docker-compose.yml”. Open up Windows PowerShell terminal, change into the “wordpress-local” folder using commands like “cd C:\Users\your-user-name-here\wordpress-local“, make sure the “docker-compose.yml” file is in “wordpress-local” folder, and then you can do “docker-compose up -d” in the terminal. This will tell Docker to start pulling in images for the latest WordPress and whatever version MySQL you had coded in “docker-compose.yml” file, and then Docker will install these images, and start services to allow you to go to 127.0.0.1 to install WordPress locally. The volume Docker creates will be persisted, but you can do “docker-compose down --volume” in the terminal to delete all persisted Docker volumes. If you just do “docker-compose down”, then only Docker containers get deleted but not the volumes. It is fine that Docker containers get deleted because Docker is meant to be used this way – all it takes for you is to do “docker-compose up -d” to recreate and start the container again.

Docker compose file is below:

version: '2.12.2'

services:
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - wordpress_files:/var/www/html
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: abcdefg

   db:
     image: mysql:8
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: root-abcdefg
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: abcdefg
volumes:
    wordpress_files:
    db_data:

The line where the “docker-compose.yml” file said “version: ‘2.12.2’, you can change it to your docker-compose version. In the terminal, do “docker-compose --version” to see your current docker-compose version. The password for WORDPRESS_DB_PASSWORD and MYSQL_PASSWORD needs to be the same – because the former one is for environment settings and the latter one is the actual password that you want to set with MySQL database. You can also change the password for MYSQL_ROOT_PASSWORD to something else if you like. Oh, I almost forgot, when trying to import WordPress blog posts from the download of WordPress’s export XML file, if your file is too big, WordPress may refuse to import the blog posts. This can be fixed easily.

First, you need to install nano or vim for the Docker container. You do not need to stop the running Docker container to do this. In the terminal, do “docker ps” to see the Docker’s CONTAINER ID. In the terminal, do docker exec -it enter-the-container-id-here bash -c "apt-get update && apt-get install -y nano". Once everything is done, you can do “docker exec -it enter-the-container-id-here /bin/sh“. This allows you to mimic how you would ssh into a Linux server, but in our case, we go inside the container. Now, you can do “nano .htaccess“. Go to the very end of the file (.htaccess), and type in two lines:

php_value upload_max_filesize 256M
php_value post_max_size 256M

Save the .htaccess file. You can also create phpinfo.php file by doing “nano phpinfo.php“.

<?php
        phpinfo();
?>

Save the phpinfo.php file. Exit the container’s ssh-like environment by doing Ctrl-d on the keyboard. Now, you can go to 127.0.0.1/phpinfo.php to see if upload_max_filesize and post_max_size are actually 256 Megabytes. You can always increase the Megabytes sizes for these two php_values so WordPress can allow the importation of larger WordPress exported files. That’s it! Go ahead and import your blog posts to a local container and play around with locally installed WordPress using Docker. Have fun!

Foldable Phones Don’t Matter, 5G Does!

What do I think about foldable phones? I think foldable phones don’t matter! Foldable phones remind me of flip phones back in time, but now instead of flipping a phone in style, we can unfold a phone into a tablet. Since foldable phones are so expensive, I guess using the tablet and unfoldable phone I already have will be just fine!

Although foldable phones are not that important, the 5G technology that gets to debut on these foldable phones is really important! Since 5G allows communication over the air almost instantaneously, and so this could allow innovations in the Internet of Things sector to thrive big time.

One company right now is leading the pack in term of 5G is of course none other than the Chinese giant, Huawei. Right now, Huawei is getting a lot of heat from the United States. Huawei’s CFO Meng Wanzhou, the daughter of the founder of Huawei, is being under house arrest in Canada in the behest of the United States’ extradition agreement with Canada. Furthermore, the United States is increasingly persuading other countries to not use Huawei’s 5G technology.

5G can be really useful for whatever purposes that demand faster wireless communication. I may not know what purposes would demand 5G the most, but I do know that 5G will be great for commercial purposes such as the Internet of Things devices. Furthermore, 5G will accelerate the use of driverless cars and other automated vehicles.

5G can allow driverless cars to see each other instantaneously and also communicate with smart roads and highways instantaneously. 4G technology is definitely too slow and less reliable than 5G when it comes to deploying the technology on a massive scale to allow crucial transit system to work in a smarter way. So I think 5G will definitely be a game changer in wireless communication.

Anyhow, I guess it’s going to be expensive to build a massive backbone system that could support the 5G wireless system. It seems though, this isn’t the problem for Huawei. Huawei seems to be able to deploy 5G network for various platforms in China already! For an example, a 5G network is now already up and running for Qingdao Port in Eastern China.

China is leading the way to deploy 5G network not only in China but across the world. Huawei is at the forefront of this 5G expansion from China. I’m not sure why the United States is really scared about how China is leading in 5G, but my guess is that whoever leads the 5G network deployment across the world gets to call the shot for making a standard for 5G chipsets and much more. This means big money and market cornering.

Since 5G technology will change how wireless communication permeates throughout the global economy, new and old markets could churn out a lot of new money for the global economy. For an example, driverless cars will become more reliable, encouraging people to spend more money on driverless cars. Dumb cars without the support of 5G technology might get left behind, collecting dust somewhere while driverless cars sell like hotcakes.

Is China Leading In Building An AI Driven Future With 5G?

5G will be the thing of the coming years. If I’m understanding what is really going on, 5G can actually allow the plethora of devices to communicate with each other effortlessly. A quick search on Google yields that 5G is 20 times faster than 4G. Whether this is true or not, one thing is true is that devices can speak to each other way faster than before. This opens up more innovation and infrastructure demands.


The video above shows that China is heading in the direction where more machines will replace humans in labor-intensive jobs. The day when we need an extra pair of human hands may be over sooner than later because smarter machines with AI capability can actually think for themselves and carry themselves in jobs effortlessly. Nonetheless, AI machines without 5G will be like a pony just starts learning how to walk.

5G will allow AI machines to transfer data fast and constantly so that things can speed up even more for decision making, planning, communication and so much more. I think with 5G, self-driving car technology is much more believable since you can have many self-driving cars detect each other easier at once with reliable faster 5G data transfer. Furthermore, smart highways and roads are going to get better and more fitting for self-driving cars because 5G will allow faster communication between the cars and the traffic infrastructures.

If you’re guessing I don’t know what I’m talking about, you may be right. After all, 5G is so new and I haven’t seen it firsthand or use it in real life. Nonetheless, according to the information I could Google, 5G is 20 times faster than 4G. Right now I’m using 4G on my smartphone but I think 4G is already quite fast. I can imagine how crazier it could get if I got 5G.

A day ago I briefly encountered an article which described how 5G could destroy the need for the cloud. Then I briefly read over the article’s comments that displeased how the article’s author was too lacking of knowledge since the commenters didn’t see how 5G could destroy the cloud since the cloud is about centralization of data storage.

Personally though, I don’t see how centralizing storage like the cloud could go away since data redundancy is always a priority, especially in the age of AI which is driven by data. Of course, all bets are off when AI becomes self-conscious since such AI needs no human data to drive its own logic. Until then, the cloud stays important.

I also think that 5G could allow the decentralization of networks to become a thing too! How come? Local devices and storages will be able to talk faster to any other storage and device across the world — destroying the needs of having to plan and engineer a network that is catering to the importance of distance. Although we already in the age of information where distance isn’t as relevant as the 19th century for communication, but 5G may make distance even more irrelevant when it comes to data communication.

Basically, instead of waiting for minutes for a movie to be downloaded onto your device, you may only have to wait for a few seconds to have your movie when you use the 5G network. 5G data can cross secure communication channel much faster and more reliable since faster data transfer allows faster data integrity check and whatnot. Perhaps, we could see shopping, banking, and other important financial related activities across the world on the world wide web to be more reliable and faster — better experience overall!

In summary, I think 5G will be awesome! I would love to see not only cellular network but also home network to be able to transfer speed that is as fast as 5G or better. This way, everything will be on the same pace and everyone will be using faster Internet speed. What’s not to like when you can get a whole 4K movie to be downloaded in a few seconds, right?

Equifax Got Hacked, Affecting 100 Million Plus Consumers!

Hot off the press, hackers were able to gain unauthorized access to Equifax’s consumer data, potentially affecting almost half the United States population, roughly around 143 million consumers.  Equifax promises to allow affected consumers free credit protection.  I don’t know the extent of such protection.  Will such protection help consumers fight bad credits due to nefarious activities through this hack?  Equifax is also cooperating with the authorities to figure out the mastermind behinds this hack.  Also, Equifax has hired professionals to help them tighten up the security and clean up whatever might be left behind in their system by the hackers.  Anyhow, Equifax’s CEO is explaining and assuring his customers in the video right after the break.

12,000 Startups Are Being Created Every Day In China by Internet Loans

Internet loan companies like Prosper are very few in the United States, but in China these companies are too numerous to count.  These loan companies are less regulated in China, and so the growth of the Internet loan sector is incredible.  Basically, these less regulated Internet loan companies are responsible for at least 12,000 startups every day in China.  Sometimes, it takes as fewer than few minutes to find the funding for a loan.  Some loans can also go up to millions of dollars.  The risks for these loans are there even though the Internet loan companies are doing fine at the moment.  Nonetheless, as we all know the world is full of uncertainties, and so risks are risks.  Sometimes, scam could be created from scammers who target loan companies to bilk out money from everyday investors.  In short, these Internet loan companies rely on Chinese citizens’ greed to provide the funds for both new and old, big and small businesses.  Some struggling businesses, whether they’re big or small, got a second chance through these Internet loans, because traditional banks couldn’t handle the appetite for such risks.  Anyway, check out the video after the break to see the details on how Internet loan companies in China are growing.  Enjoy!