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 […]

Read More

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

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

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

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

Configure exim4 smtp relay to use tls on connect (smtps)

Exim has seen many changes over the years and is up to date on modern standards such as the use of STARTSSL. This however leads to problems when using other protocols or standards such as smtps otherwise known as tls on connect. In this guide we configure exim4 to use the smtps protocol with a remote smarthost configuration.

Read More
exim 4 tty configuration screenshot

Fixing encrypted disc hibernation in Ubuntu with uswsusp

uswsusp A tool to enable encrypted hibernation on Ubuntu even when you use a encrypted LVM volume. By default ubuntu has no hibernation support at all, even worse when you use an LVM encrypted their is no way to enable hibernation in a simple way. However I have found a way to hibernate even with a LVM encrypted volume.

Read More
uswsusp adventure corrupt swap

Beaglebone Black wifi access point (AP)

Turn your beaglebone black cheap arm minicomputer into a wireless access point. This was something I always wanted to do. And as it turned out it was relatively easy and very cheap.

Read More
beaglebone black wireless access point

Borderlands 2 Fix not launching or showing up

[vc_row][vc_column width=”1/1″][vc_column_text] A common problem. A very common problem for borderlands 2 is to not continue after pressing start on the launcher, the game simply wont show up. But dont worry if you read this you will Fix borderlands 2 in no time. When does is crash ? after the launcher gives a call to initialize borderlands2.exe which will simply crash right after the second it was assigned process id (pid). most of the times not even a log file will be written. How to fix borderlands 2. There are many different type of fixes around, all which I found […]

Read More