How I created my own USB powered LED nightlight

If you wish to avoid tripping in a very dark room while not affecting sleep quality, then you can use a nightlight to succinctly lit up a portion of your room.

While there are many nightlight variations out there, it can be a meaningful exercise to try to create your own out of items that you already own or have in the house.

For example, instead of throwing away the Carrot Carotene Calming Water Pad container after the water pads ran out, I used it to create my nightlight.

Since it is translucent, this container can help dim the lights coming from the naked 5V Warm white LED light strip.

Given that, let us take a look at how I made use of the items that I already have to create a USB powered LED nightlight.

With some level of variations, you should be able to make your own USB powered LED nightlight too.

How to add an inline cord switch onto the cable of a USB powered device

Some time ago, I shared a post of how to make your own USB powered LED light. If you follow that post, you will be able to make your own USB powered LED light that can be attached to a USB 2.0 power adapter on your wall socket. When you turn on your wall socket, the lights will turn on. After you are done with using your light, you can turn off your wall socket to turn off the lights.

Sounds like common sense right?

However, your wall socket plug may be too far to reach at your convenience. In such a situation, you may want to add a switch onto the cable of your USB powered device.

Given that, this post discusses how we can add a switch to a 5V USB wire. In this post, I will use a white inline cord switch as an example to show how we can add an inline cord switch to a 5V USB wire.

Rendering multiple checkboxes with WTForms and Bootstrap

When you use WTForms and Bootstrap, you can quickly build up the dashboard for your own content management system with Python.

This is because WTForms provide several out-of-the-box implementations for rendering some basic fields that for capturing form data.

However, rendering multiple checkboxes can be open to different UI implementations based on users’ preferences. Therefore, different fields and widgets are available in WTForms to cater for different ways of displaying a form input to the user.

Given these points, let’s see how we can render multiple checkboxes with WTForms and Bootstrap.

How I repaired one of my corrupted git repository on gogs git server

While trying to commit my codes to my Raspberry Pi gogs git server, I got a rejection:

 ! [remote rejected] master -> master (missing necessary objects)
error: failed to push some refs to ''

In addition to that, I got a HTTP 500 when I try to view the repository details page via the dashboard.

Since I can view my other repositories on my gogs git server, something must be wrong with a-project.git.

Given that, here are the steps that I took to rectify the issue.

Installing Netflix app on a Chinese made projector device running Android

If you have access to Chinese e-commerce websites like Taobao or AliExpress, then you may be able to get devices at more affordable prices.

In order to watch Netflix films at the comfort of your bed, you may get a projector device.

Even though you got one running Android, you may not have the Netflix app or even the Google Play store.

Since we are all paying for Netflix subscription, Netflix provided an app just for such situations.

Given that, head over to this Netflix help article and follow the instructions.

How to minimise payment fraud on your e-commerce store

If you are running an e-commerce store, then you can accept payments from your customers through a payment gateway.

When you accept payments on your e-commerce store, you will also want to reduce or even prevent payment fraud.

Indeed, payment fraud can have huge financial impact on your business.

Therefore, it is important for you to look at how you can minimise payment fraud on your e-commerce store.

Given that, let us explore how we can reduce payment fraud on our e-commerce stores.

How to use your Raspberry Pi for Python development

Since its inception, the Raspberry Pi had progressed by leaps and bounds. Indeed, one of the reasons why we want to get a Raspberry Pi is its versatility. Apart from the huge selection of hardware, there are many Python libraries for you to build Raspberry Pi applications.

If you want to build something out of a Raspberry Pi, then you will benefit from setting up one for Python development.

Even if you do not build Raspberry Pi projects for a living, setting up a Raspberry Pi Python developer machine can be useful. For example, you may be a Solutions Engineer who build proof of concepts for demo purposes. In this case, you can build your demos with Python and run them on your Raspberry Pi.

If you are thinking of using Raspberry Pi for Python development, then this post is a reference for you.