Setting Timezone In Ubuntu Command Line

Hourglass In Rocks

You may have just setup your new Ubuntu Server setup, or perhaps you have a Virtual Private Server on Digital Ocean that sets up with the default UTC time zone. Regardless of your reasoning you should always have your server(s) and user(s) system time set with the appropriate time zone, and preferably synced entirely for devices that exist on the same network, check out the Cybersecurity Breakout below for more info on that, or skip it for find out how to set the time zone in Ubuntu.

Please note, these instructions should apply to most, if not all, Debian-based operating systems.

Cybersecurity Breakout

Cyber attackers have found every way feasible to successfully infiltrate their targets. This has included the use of date/time based attacks that attackers can use to create behaviour, often undesirable, in software, such as the creation of a race condition. Your Windows and MacOS computer has settings that you can configure to either manually or automatically set your time zone. Depending on your network, you may even have a device (like a router) that actually has a built-in time server known as a Network Time Protocol (NTP) server

The timedatectl Command

The timedatectl software controls your system’s date and time. It has a variety of commands, but we’ll only be touching the few that are relevant to our query. Check out the man pages for more. Without further ado, let’s get started.

How-To Set Time Zone in Ubuntu via Command Line

The following instructions assume that you already have command line access to your Ubuntu device.

Total Time Needed :

15

Minutes

Steps to Setting The Time Zone In Ubuntu Via Command Line

timedatectl software

Step 1 – Check Current Time Zone

You probably already know that the time zone is incorrect, but you need proof. Using the status command, you can find out how your current time is configured. (Running the timedatectl software without any commands will produce the same output.

bastion@server:~# timedatectl status

set-timezone command

Step 2 – Set A New Time Zone

The timedatectl software has a command called set-timezone that can be used to modify the time zone of your Ubuntu server without having to modify any files. You’ll need the appropriate time zone format for the time zone that your device exists in. Make sure that if you’re device is in Toronto, then is gets the America/Toronto time zone even if you live in Phoenix, Arizona. You’re setting the time zone for the device, not yourself. You can find a list of time zones on the Ubuntu man pages.

bastion@server:~# timedatectl set-timezone America/Toronto

The set-timezone command will update the time zone as found in /etc/timezone. After running the set-timezone command you can review that file to ensure the proper changes were made.

bastion@server:~# cat /etc/timezone
America/Toronto

show-timesync command

Step 3 – Turn On Time Sync

Setting your time zone is now done, but you may also wish to have your time synced with an external service like we mentioned previously. Not a problem, timedatectl, can help us with that too.
the show-timesync, and set-ntp commands will help us here.

bastion@server:~# timedatectl show-timesync

show-timesync provides you with details in regards to your current time sync configuration. You’ll want to confirm that you have servers listed under SystemNTPServers.

bastion@server:~# timedatectl set-ntp true

The set-ntp command turns time syncing with your NTP server, on.

Congratulations, you’re done! You don’t need to reboot for these changes to take effect, however, I always recommend you do so when making system changes.

What is Net Zero Emissions?

Thawing icebergs in the ocean.

My local paper, today, has a story about the U.S. and Canada working towards net-zero emissions by 2050; and it got me thinking, as everything does. What does achieving net-zero emissions? How is it done? and What does it achieve? Let’s chat.

As you can see it’s not as simple as it sounds, but it’s easier to do then it looks. Whether you’re a consumer, business or other organisation, we can all do something to help offset carbon and other greenhouse gas emissions.

If you’re interested in purchasing offsets as an individual, business, or other; check out Purchasing Carbon Offsets Guide for Canadians. Produced by the David Suzuki Foundation and The Pembina Institute, you’ll find a table on page 10 that provides a list of vendors along with assessed offset results.

References

https://en.wikipedia.org/wiki/Carbon_neutrality
https://www.offsetguide.org/understanding-carbon-offsets/
http://www.offsetguide.org/understanding-carbon-offsets/what-is-a-carbon-offset/
https://www.cbc.ca/news/technology/faq-carbon-offsets-1.5008339

WordPress Stuck in Maintenance Mode

WordPress Stuck in Maintenance Mode

This one caught me a little off guard. I was working on updating a client WordPress site this morning; it had 2 themes that we hadn’t removed that needed an update. Instead of deleting them, I chose to update them. Without thinking I clicked away to another part of of the WordPress administrator area and ended up getting stuck with the following on every load and reload of the page. I even restarted NGINX in a desire to find a quick fix.

I’ve now learned that WordPress has a built-in maintenance mode that it kicks itself into during updating of plugins and themes. We would rarely ever see a reference to it as updates typically go very quickly, and without a problem. Except when they don’t. Luckily, the WordPress developers built a very simple mechanism for driving this maintenance mode that anyone with access to the WordPress website files can access.

How To fix wordpress stuck in built-in maintenance mode

In order to fix this error you must have access to the underlying WordPress website files. You may have access to these files via File Transfer Protocol (FTP) or through your Web Hosts Control Panel.
The solution to this problem is to delete the .maintenance file from the root folder of your WordPress install, in other words, the top most directory on your web host with WordPress files.

Total Time Needed :

5

Minutes

Steps to remove .maintenance file from wordpress

Step 1 – Navigate to your WordPress Directory

Login to your Web Hosting Control Panel, FTP Client, or SSH Client and navigate to the top-most WordPress directory that is hosting your website. On my web host, my files are located at /<server_directories>/roguesecurity.ca/public_html/.

Step 2 – Delete .maintenance file

Look for a file called .maintenance (The period before the word is required). Once found, simply delete this file from the directory.
Once you delete this file, return to your web browser and clear your browser cache, and reload your website.

Congratulations. That’s it! If your website is still displaying a maintenance mode message after deleting this file, double check that you’ve cleared your browsers cache. You can also try a different browser. If it works in a different browser then we know the fix worked, and the not working browser will correct itself over time.

How Is The Texas Power Grid Failing?

2021-02-24 // Edit: Turns out that an unregulated power grid how more issues then I originally thought, check out the update at the bottom to find out about why some Texas residents are now dealing with extreme power bills like the one this person received for $16,752.

The United States as three power grids: the west coast power grid, the east coast power grid, and Texas. Texas is a large state and, at some point, in its history it decided that it should be on its own power grid that is separate from the rest of the U.S., and not all counties in Texas are being powered by that standalone grid.

Combining natural gas, nuclear and wind, it’s quite impressive. They’ve touted it for years. You may have heard a lot in the news about the cold temperatures freezing the wind turbines and preventing them from turning. They’re getting a lot of the blame. According to the Electric Reliability Council of Texas (ERCOT) themselves, wind and nuclear only accounts for 20% of electricity generation.

Turns out, the major issue in Texas right now is actually liquid in natural gas pipes freezing, and preventing the flow of gas and is likely the cause of brown-outs. This is a phenomena called freeze-off. Natural gas is non-renewable source of energy and is a significant and potent producer of greenhouse gas when released into the atmosphere.

Here comes an opinion; Texas is the leading producer of natural gas in the nation, and you know that an event like this, as well as a failure of this magnitude, will have lasting affects on an already strained industry.

Wind turbines aren’t just used in warmer climates. I wonder if anyone has considered calling someone up here in Canada and asking how we might handle our wind turbine farms? I’d be curious for someone to calculate the amount of Solar/Wind energy needed to power Texas, and then determine how much that would cost to operate. Then, compare that to operational costs of a complete Natural Gas solution. That’s a project for another day…

De-Regulated Power

Apparently the Texas power grid is more interesting then I realized. Somewhat like your mortgage, the residents of Texas are able to choose to pay wholesale prices (variable rate) for electricity, which is generally less expensive then standard pricing, but doesn’t necessarily have the same consumer protections. This leads to less costs when the price of electricity is down, but, as we now see, when the cost of producing electricity increases, so will these wholesale prices.

This isn’t much of an issue if you can afford it, but many can’t, and this includes a larger proportion of black, brown, Hispanic and other minorities. Inadvertently, this de-regulated energy producer is marginalizing its customers by not providing them with appropriate protections from situations that are out of their control.

mapping a network drive in Windows command line

Mapped Storage

My friend Randy was always on me about using the command line more, and I’m glad that I listened to him. A command line interface (CLI) are often times so much more powerful then its graphical user interface (GUI) cousin, with less errors. I’ve leaned more towards using the command line for technical work as oppose to the GUI and that includes administration within Windows. Sometimes I’ll use the built-in CMD, and other times I’ll use PowerShell.

Mapping a network drive in Windows through the command line interface is not hard and anyone willing to take one step at a time. Without further ado, let’s dig into it.

How to Map a Network drive in windows from the command line

You may wish to map a network drive in Windows via the command line if you are having issues mapping it via the GUI, or if you prefer to take control of your setup and learn a few things while you are at it. Perhaps you’re adding a new network storage device and testing out different configurations. You’ll very likely want to single-pane view of the command line interface.

Total Time Needed :

10

Minutes

Steps to Map a network drive in windows from the command line

Step 1

In Windows search, located in the Windows Taskbar, type ‘cmd’ (without the quotes). The Command Prompt app should pop-up in the start menu. You will want to then click, Run as administrator, in order to launch the command prompt window with the appropriate privileges.

Step 2

At the command prompt, which will display a flashing white cursor when the command prompt window is selected, type in the following command to view current mapped drives.

C:\Users\User> net use

Make a note of any drive letters that are already in use. This information will be located in the Local column. You can’t map a new drive to a drive letter that is already in use. If you’d like to delete a mapping to re-use the drive letter, you can use the following command:

C:\Users\User> net use <driveLetter>: /delete

for example, the following command would delete the mapping to drive letter S.

C:\Users\Justin> net use s: /delete

Step 3(a) – Drive Mapping (no credentials)

Now we can map our network drive. You only need to select one way of mapping your drives from the 4 that I’ve outlines here, (a) through (d) below.

C:\Users\User> net use <driveLetter>: \\<path>\<to>\<network>\<share>

The below command will map a network share that is located at \\Storage\Media\Movies to a new drive with the drive letter L.

C:\Users\Justin> net use L: \\Storage\Media\Movies

Step 3(b) – drive mapping with credentials

If you configured your shared drives to required a username and password, we can modify our command by adding the /user: switch.

C:\Users\User> net use <driveLetter>: \\<path>\<to>\<network>\<share> /user:<username> <password>

The below command will map a network share that is located at \\Storage\Media\Movies to a new drive with the drive letter L, using justin as the username, and supersecurepassword1 as the password.

C:\Users\Justin> net use L: \\Storage\Media\Movies /user:justin supersecurepassword1

Step 3(c) – drive mapping with persistence

You probably don’t want to have to keep mapping or logging in to your new drive every time that you boot up your computer. That’s where the /persistence flag comes in.

C:\Users\User> net use <driveLetter>: \\<path>\<to>\<network>\<share> /persistence: {yes|no}

Here is how the Microsoft Documentation describes the /persistence flag: (It) Controls the use of persistent network connections. The default is the setting used last. Deviceless connections are not persistent. Yes saves all connections as they are made, and restores them at next logon. No does not save the connection being made or subsequent connections. Existing connections are restored at the next logon. Use /delete to remove persistent connections.

The below command will map a network share that is located at \\Storage\Media\Movies to a new drive with the drive letter L, and maintain persistency across each reboot.

C:\Users\Justin> net use L: \\Storage\Media\Movies /persistent: yes

Step 3(d) – Complete drive mapping

In a perfect world you will want to have properly credentialed shares and any user that connects will do so with their own username and password, with persistency. Here is how we bring it all together.

C:\Users\User> net use <driveLetter>: \\<path>\<to>\<network>\<share> /user:<username> <password> /persistence: {yes|no}

The below command will map a network share that is located at \\Storage\Media\Movies to a new drive with the drive letter L. The connection will use justin as the username, and supersecurepassword1 as the password. Finally, the connection will be persistent so that user, justin, won’t have to login to the drive every time they log in and out of their Windows account.

C:\Users\Justin> net use L: \\Storage\Media\Movies /user:justin supersecurepassword1 /persistent: yes

That’s it! Once you’ve completed the steps you should be presented with a success message, and have your new drive mapped in Windows.

I hope you found this how-to helpful. If you did I’d love to hear about it. Leave a comment below!

Building an Outdoor Ice Rink No Liner, for Free (Part 1)

Family Chaos Ice Rink 2021

We only moved into our home in September, but I could already imagine the awesome ice rink that we were going to build around the fire pit in our backyard. I’ve never built an outdoor rink of any kind before, but I knew that I was going to have a significantly more time on my hands. I wanted to give myself something to do, and also an outlet for the kids to burn off some energy and get some exercise. We were not able to spend a dime on this thing so a $4,000 rink kit was out of the question, so I set out to build an outdoor ice rink without a liner, and it cost us absolutely nothing!

How to build an outdoor ice rink, no liner

Over the next several steps we’ll take you through building an outdoor ice rink without using a liner. This is done in two phases, 1) we use snow to create a slushy base that will freeze and become our “liner”, and 2) Flooding it and getting it smooth. Let’s get into it.

minimum requirements

Before you start building your outdoor ice rink, you should make sure that you can meet at least the following minimum needs.

– Cold weather (At least 0°C, but preferably colder)
– Snow (Around 20cm is good)
– A reliable water source
– A safe and appropriately sized location
– Shovels
– Garden hose and Nozzle
– Patience

Steps to building an outdoor ice rink without a liner

BEFORE YOU START

You only need a few basic tools to create an outdoor ice rink and can easily save yourself up to $4,000 on backyard ice rink kits. Once you know that you meet the minimum requirements above you can go ahead and get started on Step 1 below.

1. PREPARING THE AREA

Select an area in your yard that you wish to make your ice rink and then go a little bigger. The edges are always tough without a liner and boards so you’ll end up building up the snow “boards” quite a bit
You can begin preparing your ice rink before it gets cold enough, as long as you have some snow. You can begin by compacting the area of your ice rink in any way, shape or form. You really want to have a firm base of snow to start your rink. It doesn’t have to be completely level, but it should be relatively so. Water is self-level as it pools and freezes, but you don’t want a significant difference in grade or you won’t ever get it very flat.

This is a perfect time to elevate those low areas of your rink with snow and compact it down to make as level a surface as possible. Ideally 10 – 20 cm of snow will compact down to about 1 to 2cm of snow.

2. start spraying water… slowly

Patience is key, especially in the beginning. Start the first few sprays by just waving the nozzle around the entire area so that just the very top most millimeters of snow get wet. Each time you add a layer of light sprays, the water will sink through the top layer onto the next layer until the compacted snow is frozen. Mother nature is going to do most of the work during this stage.

You are not going to have a flat, shimmery surface for a while so don’t be dreaming of that. We’re attempting to use the snow to create the ice so that we’re not using as much water. Since we’re not using a rink liner, the water doesn’t have any place to go if we add too much.

If the weather is closer to 0°C then you’ll want to wait a few hours between each spray. If you find you are losing too much snow, then ease up. The water will freeze fast with colder temperatures and you should be okay to go out every hour or so.

go low and go slow

Too much water, too quickly will melt the snow as opposed to turning it to slush for mother nature to freeze it. Until you’ve created a solid bed a ice, with no holes, you simply won’t be able to do any significant flooding (where the water pools and moves around). It really and truly is important for you to go low and go slow with the water at this point. Don’t rush it or you’ll hate yourself later when you need to be adding more snow back on to the ice to patch holes.

3. Keep It Clean; Build up Your Walls and Patch Some Holes

You’ll appreciate keeping it clean as even the smallest droplet of snow could freeze and be something to trip over. Take the time to push the snow out towards the sides of your ice rink. This gives your rink some definition, but also creates a bowl-like structure whereby water will eventually be able to collect without running off of the sides.

It’s going to be worth patching any holes or building up low areas as you go. Your future self will appreciate you. You patch holes exactly the way that you created your rink; add some snow, make it slushy and let it freeze.

Water will self-level itself so you only need to worry about creating enough slush for mother nature to freeze into a solid (without holes) piece of ice.

Stay Tuned. In Part 2, we’ll talk more about patching and flooding…

Our Family Minecraft Server Setup

If you haven’t heard of Minecraft you may want to check and make sure that you are not under a rock. All three of the kids in my household enjoy playing Minecraft, but I really don’t like them joining some of these random online servers. With some research it wasn’t difficult to put together a nice, safe, alternative that we host ourselves.

Server Info

VPS Specifications

We currently have a VPS setup on Digital Ocean with the following specifications:

  • Ubuntu 18.04 (LTS) x64
  • 2 GB Memory
  • 50 GB Disk Space

CLI Arguments for Minecraft Java on Digital Ocean

java -Xms1024M -Xmx1536M -d64 -server -XX:+AggressiveOpts -XX:ParallelGCThreads=3 -XX:+UseConcMarkSweepGC -XX:NewSize=84m -XX:+UnlockExperimentalVMOptions -XX:+UseParNewGC -XX:+ExplicitGCInvokesConcurrent -XX:MaxGCPauseMillis=10 -XX:GCPauseIntervalMillis=50 -XX:+UseFastAccessorMethods -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:NewRatio=3 -Dfml.readTimeout=90 -Ddeployment.trace=true -Ddeployment.log=true -Ddeployment.trace.level=all -jar /<path>/<to>/<minecraft>/papermc.jar nogui

Server Software

In order to run the Minecraft server (and keep it running) we employ some additional software that was pretty easy to install.

PaperMC

There are plenty of different servers available for Minecraft Java. We went with PaperMC due to its stability and its mods compatibility with Bukkit and Spigot.

Crafty Controller

We’re also using an open source, secure by default software called Crafty Controller for the administration of our Minecraft worlds. I love the app, although I’m having some issues with keeping my world from crashing. I suspect this is because I setup the world outside of Crafty. I’ll create a new server and move over the save, eventually.

Plugins

We’re not doing much with plugins yet as I don’t take much time to set them up properly, but here are the plugins that we currently have running on our server.

Essentials
LuckPerms
Multiverse-Core, Multiverse-Inventories, Multiverse-NetherPortals, and Multiverse-Portals
Vault
WorldEdit
Dynmap
Epic Quest

In total, it costs us about $15 a month to operate a pretty custom Minecraft server with very little maintenance.

How To Get Every Android App for Free by Using Google Opinion Rewards

You too, will never have to spend a dime on apps with a little bit of time and a little bit of patience. By completing surveys in the Google Opinion Rewards app, you’ll be able to collect Google Play Store credit (or actual moola if you’re an iOS user) that will be completely usable for everything available in the Play Store including apps, books, movies, and in-app purchases. No more buying Robux for the kids!

So How, Exactly, Does It Work?

Google collects our data. Yeah, sorry to be a downer, but this is one occasion where we can get some value back out of that data. Our Android phones collect location data, search data, and even videos that we watch on YouTube. This data is sent to Google where they use it to provide you with better and more personalized services (except when they don’t, I recommend reviewing the privacy and security on your Google Account every year.)

You’ll be receiving surveys based on that data so an example might be that I receive a survey because my location was set close enough to a Home Depot, and Home Depot contracted with Google to obtain opinions from its customers.

Getting started

installing and setting up google opinion rewards

Step 1

From your mobile device, open the app store and search for Google Opinion Rewards. Install the app once you find it.

Step 2

After installing the app, run it and you’ll be asked to login to your Google account, as well as fill out some basic information. You’ll also want to have Location History turned on in order to take the most advantage of opportunities.

Step 3

Wait for surveys. The app will notify you when you have a survey available. Most of the surveys that I’ve done have come from locations that I’ve visited. So start living your life.

Conclusion

I’ve been using this method to not pay for Android apps for many years now. I’ve earned more than $100 in Play Store credit since I started doing these surveys back in 2016. That’s money that I didn’t have to spend, while providing a little bit of Dopamine for my beautiful brain. Isn’t it satisfying getting to itch that Dopamine scratch without wasting all of your money? It’s a literal two-for-one!

Mixed-Member Proportional vs First-Past-The-Post Voting in Prince Edward Island

Mixed Member Proportional

I was reading an article in my local newspaper, and I realized how much that I appreciate and consider myself very lucky to live in a free and democratic society. It isn’t uncommon in countries such as Russia and China where governments want to silence views that don’t match that of their own.


Putin is in his third of a maximum two terms (Yeah, you read that right). Electoral reform isn’t just a conversation here on P.E.I., but all over the world. The people will be heard.


I’d like to see mixed-member proportional (MMP) representation replace first-past-the-post (FPTP). Other than being easy to understand, FPTP has so many disadvantages including being unrepresentative of what the people actually want, and can be unknowingly manipulated by tactical voting.


There is an idea (Duverger’s law) that constituencies that use FPTP will lead to two-party systems, given enough time. Wondering why we keep seeing the same two-parties being elected in our elections? That’s FPTP. There ends up being a lot of wasted votes, so our elected officials are actually only receiving a small percentage of the vote. How is that “representative”?


MMP would almost certainly lead to more consistent majority reversals. Diversity in our government is important, and doesn’t lead to more difference. Our, former, minority government was still able to get decisions done because our representatives are able to put aside indifference and make decisions those that they represent.


Wow… That article really got me thinking. 😅