Dynamically adding models to sqlalchemy declarative_base

This is a Python tutorial showing how models can dynamically be added to an instance of declarative_base without trigger pep8 unused import. This example works best if the project uses a directory structure similar to the following (__init__.py has been omitted): database database_manager.py models example1.py example2.py The problem from this structure arises as the same instance of declarative_base needs to be imported by both example1.py and example2.py. While at the same time the database_manager.py would create the database with all its associated tables & relationships. The simplest solution is for the database_manager.py to have the instance declared and all the […]

  • Interested in the entire article?
  • Read More

Getting started with RISC-V

So you have heard of this RISC-V thing typically talked about in the context of microprocessors and to a lesser degree also for desktop processors. RISC-V is an open-source hardware instruction set architecture (ISA). Similarly to how X86 for Intel and AMD is a closed source ISA. Being an open-source ISA any manufacturer can develop new processors which implement it. Allowing many of the development tools to be reused across different manufacturers. This has the potential to drastically change the computing landscape. Especially with large companies like Western Digital already investing in the development of this new technology. Now, lets […]

Read More
Official RISC-V logo

xrandr – treat multiple monitors as single screen

Many window managers such as xfce, gnome or kde have graphical utilities to help configure a multi monitor setup. However, almost none if any support configuring multiple monitors as a single screen. In the past technologies such as AMD eyefinity or Nvidia Mosaic enabled these features but they are vendor specific. Problems around Linux compatibility and using closed source drivers aside these technologies are relatively complicated to configure on Linux. An alternative to these vendor technologies is Xorg TwinView. Unfortunately TwinView requires a convoluted configuration procedure by writing Xorg config files. These configuration files are read during the start up […]

Read More

Why the Epic Games store is bad for consumers

Epic Games has made the best games of every 90’s kids childhood with the ever popular Unreal Tournament even though before Fortnite Epic was no longer releasing games regularly they still develop one of the best game engines known as Unreal Engine. However, ever since the release of Fortnite things have taken a turn for the worse. Epic has released a new online game store similar to platforms such as Steam and Origin and although there is nothing wrong with that their approach is outright damaging to the entire industry. The Epic Games store offers a lower share on producers […]

Read More

Fix disappearing emails send with WordPress

Email complexity has increased drastically since its first release. The now ever growing stack of email components no longer just consist of SMTP, MTA, MTP and MDA. Over the years technologies such as POP & IMAP were introduced along with security features such as SMTPS & STARTSSL. Now a days almost every addition to email is a security feature with recent introduction such as SPF and DKIM. And it is precisely their were Wordpress bites a bitter bullet. Wordpress uses the phpmailer backend and fails to correctly set the return-path parameter in the mail it sends. The return-path parameter is critical to pass SPF email protection mechanism and as a result any decent email server such as those of Google or Microsoft will reject the email send by Wordpress.

Read More
email-fail

Encrypted swap partition that enables upon boot with dm-crypt

Setup an encrypted swap partition that automatically gets unlocked and enabled upon boot. Normally setting up a secure swap outside a logical volume is not supported out of the box by most Linux distributions, these few lines of shellcode allow for quickly setting up an encrypted swap.

Read More

Installing Manjaro 18 with Nvidia GTX 1050 TI

Manjaro its bleeding edge releases cause installation problems while using an GTX 1050 TI graphics card, these instructions allow Manjaro to install and successfully boot with an 1050 TI even if you are using Linux 4.16. Detailed instructions are provided for the unexperienced Linux users and a short step-by-step list is also available for the more seasoned veterans.

Read More
manjaro grub add modeset

Simplified dm-crypt & btrfs disc creation

Most Linux users recognize the importance of data protection and security. Many of us will be familiar with encrypted partitions, almost all of the time these encrypted partitions will be managed, mounted and created with dm-crypt. A key or password will be used to decrypt the partition and mount the contents within. In an ideal world the data would be safe against many forms of unfortunate and maleficent intent. However traditional filesystems like Ext3, Ext4, NTFS, and HFS+ have a serious flaw. This flaw can lead to incorrect or damaged files being treated as undamaged and correct files. These filesystems fail to account for the physical phenomena known as bit-rot. Bit-rot is when bits on physical media or ssd’s flip from 0 to 1 or from 1 to 0 over time. In modern filesystems this is accounted for by creating checksums

Read More
Btrfs logo

Installing Ubuntu on Acer Spin UEFI devices

Installing Ubuntu on the Acer Spin 1 has been proving to be quite the hassle to me. Fortunately; following these steps allows other to easily install Ubuntu on the Acer Spin 1 and possible many other Acer UEFI devices. Installing the bootloader will likely fail steps are provided to recover from this and perform bootloader repair. The steps require a 4gb usb drive for the Ubuntu live usb and later for installing rEFInd.

Read More
Typical rEFInd boot splash screen with 2 possbile operating systems found

Short demonstration of raid10 with btrfs

Short demonstration of modern software raid options using btrfs. In this example raid10 is used to show what happens when a whole disc is lost. We use common btrfs commands to repare the raid10 architecture and as a result can see that no data is lost.

Read More
btrfs raid10