Programming
Programming

While testing the Uppy.io file uploader I struggled with some CORS-errors. Almost the whole day was wasted troubleshooting and debugging. Trying different headers, debugging network-traffic and reading stack overflow. The browser returned a CORS-error and Uppy itself returned a network traffic error. 99% of all issues and google-results pointed to an api/server issue with my headers. The weird part was …

Found some great docker-images to use in local projects. It’s well documentet in github here: https://github.com/sebastienheyd/docker-self-signed-proxy-companion Here is an example of docker-compose from the github repo: This guide can help you to add the certificate in Chrome: https://www.pico.net/kb/how-do-you-get-chrome-to-accept-a-self-signed-certificate/

My girlfriend has a horse. The horse needed a house. So we built a house (stable). The stable is about 10 meters from our house. To smartify the stable (controlling lights and monitoring temperature, humidity and CO2) I needed cabled network and a new smarthome-gateway. I already have Home Assistant and a Z-wave network in the house, but the stable is …

Using default git-commands are easy enough (if you are used to it), but this month I have started up two new projects on a clean computer. Setting up git for the first time is not a big issue, but I always start Googling – so this is a simple «from scratch» guide for starting with git on a clean Windows-computer …

One of the drawbacks of using MySQL community is the lack of tools to analyze the server and queries, but with a little help from the Percona Toolkit, this gets a little bit easier.

21.01.2016 Telldus announced a closed beta for their Local API on the ZNet Lite. 24.05.2016 they opened the Local API to public beta. Local API let’s you connect and fetch data directly from the Tellstick ZNet without going through Telldus Live, which can be a huge advantage as it’s faster and more stable.

Just to make it easier for me to find, I’m posting a Jquery boilerplate from Stefan Gabos.

My setup: Webserver: Ubuntu 16.04 with default Apache2, PHP7 and MySQL. The webserver also has a local issued certificate with HTTPS. UniFi Controller: 4.8.18 (Running on a Windows 10 client) Laptop with wireless, running Windows 10, for testing. This article will focus more on debugging than on the setup itself, as there are multiple of howto-guides everywhere on the Internet. My guest …

Install the Let’s Encrypt client $ git clone https://github.com/letsencrypt/letsencrypt $ cd letsencrypt I didn’t have git installed, so I just downloaded it from Github and added it under /opt/letsencrypt on the server. So to the Centos 6 «fix» You’ll need to run the client in Pyhon 2.7. $ yum install centos-release-SCL $ yum install python27 Your python version should …
I will use this post to update some simple Powershell commands. A cheatsheet that I can share with others 🙂 To get the serial number from a computer run the following PowerShell command: gwmi win32_bios | fl SerialNumber To get more information e.g. bios version and manufacturer just run: gwmi win32_bios

Just wasted a couple of hours troubleshooting the PHP error: AH00052: child pid 2460 exit signal Segmentation fault (11). The browser (Google Chrome) just returned: ERR_EMPTY_RESPONSE. The /var/log/httpd/my_virtual_domain-error_log didn’t say anything. But the default /var/log/httpd/error_log printed this error [core:notice] [pid 1400] AH00052: child pid 2682 exit signal Segmentation fault (11) for every page request. The problem was actually a PHP recursive error, which …

In progress… This post will be updated if I get any more information/fixes… I currently have a web-server (Centos6) hosted at a third-party. Today the Inodes usage was 100% for the second time in 3 months. It looks like it’s the PHP sessions that fills up. Last time I tried to edit the session-settings in php.ini, but didn’t seem to have any affect, …
I have been aware of what PHP Composer has been for a long time, but I never used it before these last days. My goal was to «install» Adldap2 and replace it with the first deprecated version. This wasn’t as straight forward as I thought, because of bad or not relevant documentation everywhere. Almost every documentation about PHP Composer shows what …

Here is a little function to find Norwegian holidays in PHP. The holidays are returned in array with Unix timestamp as key and name of the day as value.

When a webserver uses 100% of the diskspace, there is not enough space to create a session in PHP. In other words people cannot login to your web-application. I had some problems with the httpd logs (/var/log/httpd) over some time with one single webserver. The access log can take up to mulitple gigabytes. After deleting the logs, everything worked fine. After …

Today I installed and tested Fedora Server 23. This version of Fedora comes with cockpit, which are a web-interface for server monitoring. I have mostly used CentOS up to now, but Fedora looks more interesting for the reasons I will mention below. To add my CentOS servers to the Cockpit monitoring, I need to install Cockpit on them as well. Setting up …

We decided to try the ConiuGo GSM LAN Modem (dead link – removed) at my workplace, as the USB-devices we use now, is a bit tricky running on virtual machines and the virtual COM-ports isn’t always stable. Diafaan has also written a review about this modem. This article is an expanded version of the Diafaan review, with all the details I struggled with. …

Shell script for backing up MySQL database. I am running this on a Centos 7 DB-server with MariaDB, but should work on most OS and MySQL installations. This is only an example, and the script is without any warranty. Create a .sh file Edit the .sh file The basics Delete old backups in folder: Where +3 is number of days. …

We just bought some Netatmo devices (Weather station components) at work, to monitor the air-quality in our office. After using it for 3 days, I am a bit stunned over how much you can use this devices for. The data itself are interesting enough, but when integrating this data in to a smarthome, you can actually «see» where the people …

If you want to control your garage doors with Telldus, you need a wireless receiver and connect it with your garagedoor-motor push-button input. I bought RX-multi from portspesialisten in Norway.

Just found a PHP Benchmark page that can be helpful when writing PHP. In most cases you don’t gain much if your writing a while-loop instead of a foreach, but you can gain some in bigger applications. See PHP Benchmark results here: http://www.phpbench.com/ (Be aware that these results are live, so they will change in every refresh).

We have a portal/intranet-webpage at my work, running with Apache, PHP and MySQL. In 2011, a colleague and me sat 16 hours (without a break) and configured kerberos authentication with the Linux webserver. Now in 2015 we needed kerberos with a new webserver. We did write a doc back in 2011, but when you sit for 16 hours – the …

I followed the tutorial on phpdoc.org: http://phpdoc.org/docs/latest/getting-started/installing.html#system-requirements. The phpdoc.org documentation isn’t exactly a beginners tutorial, so I wrote this tutorial for my self and others benifits 🙂 CentOS Server is used in this tutorial! Requirements are PHP 5.3.3 Intl extension for PHP Graphviz To check for your PHP version, type the following in SSH: To install Intl extension for PHP, type …

This tutorial will guide you through the install of an SMS server on a Windows 2008 R2 server (I have also tested it successfully on W7, W8 and 2012 server).

Starte med webutvikling? Video Treehouse Treehouse har video-kurs med både tekstbaserte- og kode oppgaver. Lenke: https://teamtreehouse.com/ Pris: $25 hver måned Språk: Engelsk W3Cschools Denne siden kan du både bruke som referanse for å finne ut hva ting er for noe, gå gjennom enkle leksjoner, samt prøve kodesnutter. Lenke: http://www.w3schools.com/ Pris: Gratis Språk: Engelsk YouTube, «Hjemmeside» Deler: HTML / CSS Hvordan kode HTML …
