04 November, 2017

WordPress crash after theme update [solved]

After an update multimusen.dk became extremely slow, there was an error message. After some time I decided to do a table repair in PhpMyAdmin. So: problem solved.


26 October, 2017

Ubuntu 17.10 - how about screenshots? [Solved]

Well, just click the prnt scrn button. The screenshot is saved in Pictures! Easy, if you  know it ...


PhpMyAdmin - cannot run after Ubuntu 17.10 update [solved]

So far I'm not able to install the Ubuntu package from the repo. Solution:
  1. Download the binaries from the PhpMyAdmin website.
  2. Edit the file config.inc.php:
    1. Add a salt word (32 chars)
    2. Enable whatever features you want
I could not use the old phpmyadmin/ directory. Renamed and chowned to www-data. 

Had some problems with the foreign key bookmarks. This guide did the trick: http://foundationphp.com/tutorials/pma_config.php

Et voila.

25 October, 2017

Ubuntu 17.10

Just updated to Ubuntu 17.10. The new desktop seems ok, as far as I'm concerned. However there were a freeze or two on the desktop. So the distro is not totally stable yet.

Phpmyadmin and Adminer did not work. Tried to downgrade PHP. No luck. Tried to install via apt several times. Dropped it and went for a manual install. Now Adminer is up and running. I guess that Phpmyadmin will get the same treatment. The binaries are downloaded. So it's probably just a matter of a manual install.

Apart from that everything seems to work. The system feels a little bit faster. Perhaps the new Gnome-based desktop isn't as heavy as Unity. Perhaps a Gnome tweak tool will solve my lust for tampering with the system.

28 September, 2017

New book: WordPress in the Classroom

Frontpage: "WordPress in the Classroom" (2017)

Today we launch my new book about WordPress. Free download here: http://goo.gl/TXwmcF

The book is in two parts. In the first part I follow the developers working on the theme Twenty Seventeen. How do the open source developer organize the enigne behind 27% of all websites.

In the second part you can learn to build or tweak a theme. Towards the end you'll find introductions to REST API and the WP_CLI.

14 September, 2017

Linux: Skyprint up and running


So the work printers are up and running via Skyprint. I had to download the drivers from Konica Minolta. Found them via Google. There are two files in the folder. After some test prints I found that the top one was best.

Now I can print at home via the terminal or from whatever GUI I choose.

Q.E.D.

10 September, 2017

Easy Info Screen for Raspberry PI

Idea for an info screen on a Raspberry Pi or similar

  1. Install a LAMP server.
  2. Create slides in HTML (nodejs and even pandoc has several nice features). Make a slideshow that'll roll to the next slide all by itself.
  3. Install the chromium browser.
  4. Start the browser in kiosk mode.

How to run Chromium in kiosk mode

Let the browser run in kioskmode. Point the browser to your slideshow:


# chromium-browser --kiosk http://localhost/mySlides/

29 August, 2017

Philips Hue API


Experiments with the Philips Hue API. It's possible to control the lights in multiple ways. The json body is easy to understand. The color system is a challenge. How do you get a color picker for it? We'll see.

26 August, 2017

Koala GUI won't run on Ubuntu

Here is the recipe. And the solution is:

32bit: 
cd /lib/i386-linux-gnu/ or cd /usr/lib/
64bit: 
cd /lib/x86_64-linux-gnu/ or cd /usr/lib64/

sudo ln -s libudev.so.1 libudev.so.0

09 August, 2017

Appjar Evening Coding Session


During this evening's coding session I created a primitive GUI in Python with Appjar. I just wanted to try out Appjar. Using it is a charm compared to the GLADE GUI builder or Tkinter.

For the code: click here.

08 August, 2017

Appjar

radioAppjar.py - stream running

appJar GUI (very primitive, but WTH)

Notes from my first fumbling with appjar. I'm looking for something that's more intuitive than Tkinter or Glade. Appjar is promising, at least for those of us with web programming experience. The code is somehow akin to JavaScript or even CSS.

The images above is my first GUI made in appJar. The files are available on Github.

Appjar is not standard Python, so the first task is:

Install appjar



# pip install appjar

The First File

# import the library
from appJar import gui
# create a GUI variable called app
app = gui()

# add & configure widgets - widgets get a name, to help referencing them later
app.addLabel("title", "My first Apphar")
app.setLabelBg("title", "green")

# start the GUI
app.go()

Get a value from a widget

  • .getEntry(title)
    This will return the contents of the specified entry box.
    NB. numericEntries always return a float.
  • .getAllEntries()
    This will return the contents of all entries in the app, as a dictionary.
    NB. numericEntries always return a float.

01 August, 2017

Libre Office - stop writing I when I want i

Yep! It's so annoying that Libre Office "corrects" all my i-s to I-s when I write in Danish. Here's the cure: funktioner / inststillinger / sprog / standardsprog for dokumenter:

Remember to set the language to Dansk.

28 July, 2017

Reset Facebook Cache

Problem: Facebook won't show the correct social media tile.

Solution: You can reset the FB cache here:

https://developers.facebook.com/tools/debug/?hc_location=ufi

Related: http://ogp.me/



Error: App Id Missing

developers.facebook.com is a valuable tool. I got the error, that the app id was missing. The solution is to create an app in the Facebook Developer. Use the id from the app in the markup, e.g.


 <meta property="fb:app_id" content="123456789012345">

16 July, 2017

Lens Sweet Spot

Aaarhus seen from my kitchen window today.

During the hollidays I'd like my DSLR pictures to be sharp from the foreground to infinity. Most lenses has a sweet spot, where pictures are better. When you've found that it's a matter of point and shoot.

Some rules of thumb if you want a sharp picture from foreground to infinity. 

When in doubt, try F8 - else try:
  • 24mm ~ >= f11 <= f16.
  • 35mm ~ f16 (street photo, 2m -> infinity sharp).
  • 50mm ~ >= f22 (2m -> infinity sharp).
  • > 80mm (no sharp foreground) f5.6 (from 100 m. -> infinity).
For most lenses the general rule is low f-stop + 2. 
  • e.g. 1.8/50 ~ f4.
If you want to find the real sweet spot for a lens, try settings as above. Shoot several pictures, and compare the sharpness on the PC. For every new picture add an f-stop. 

Source, see this article.

A nice calculator is found here. Here is the result of the hyperfocal calculator:


From: http://www.cambridgeincolour.com/tutorials/hyperfocal-distance.htm 

Hyperfocal Distance

On Wikipedia you can see the formula for hyperfocal distance:




"In optics and photography, hyperfocal distance is a distance beyond which all objects can be brought into an "acceptable" focus." (from: Wikipedia)
In theory we could create an app for the calculations, but ... in the field you just need something that works. I guess the rules of thumb will do the trick.

Sony a58
Change the autofocus area to 1/3 (probably it's in the center). Then you  should have the correct focus, provided that the f-stop is on the sweet spot. Set aperture between >= 8 and <= 11, and set ISO to auto. Then it's a matter of "point-and-shoot". That would be a good street or landscape setting.


Tamron B018S
Look at this site for specifications.

There's a video with a german photographer using apertures ranging from 5 - 11, but more than often 5 or 8. 

Tip: 

  • Try manual focus.
  • Use A on your camera's settings ring. 

14 July, 2017

High CPU speed reduced via BIOS

Low CPU usage after new BIOS settings (htop).


On Ubuntu the average CPU speed was around 30%, which seemed a bit over the top. After some research I found a thread, arguing that the reason might be the power management. In the BIOS I set the low power management to off.

Ubuntu's system monitor. Browser open, listening to Spotify.

01 July, 2017

Swappiness

Swappiness: note that swap = 0 (htop).

Noted that the swap disk often was active. But the system had sufficient RAM. Research suggested, that the swappiness should change to 10. Tried it, and now the system seems to behave as I want i to.

Swappiness values:


  • 0 => only use swap if all RAM is used.
  • 10 => use swap if needed if around 80 - 90% of the RAM is used.
  • 100 => swap is on always.
100 may be a solution on old systems, if you cannot upgrade RAM the swap can save the day. Whether this is heathy for the harddisk, I don't know.

27 June, 2017

Linux: Where are the Applications? How can I launch my own hacks?

Q: So where are the Applications in Linux?
A: /usr/share/applications/

Create a shortcut to this folder in your file manager, and you've got something like the Mac Applications folder.

/usr/share/applications
Q: That's fine - but how about my own homemade hacks.
A: Yeah, create a hidden folder in your home directory. Add a launcher there.
Q: Launcher?
A: A file with the extension .desktop - like this:

[Desktop Entry]
Name=YourHack
Exec=/pathTo/yourHack
Icon=tux.png
Type=Application
Categories=GTK;GNOME;Utility;

A: Save your hack as, say myHack.desktop. Make the file executable:

# chmod a+x myHack.desktop

A: Now you should be able to see the icon in the folder. The last step is simple - in say Ubuntu just drag the file to the panel. Other windows managers may add the app launcher in other ways.

26 June, 2017

MySQL Workbench

MySQL Workbench is a GUI for database development. Perhaps it's a better tool when teaching databases than the PhpMyAdmin.

MySQL Workbench

The workflow could be:

  1. Pen & paper for the first drafts (alternative: Dia, if you want something on a screen).
  2. ER-D and database development in MySQL Workbench
  3. Implement the database in PHP via MySQLi.
  4. Visualize the data in creative UX solutions ...

20 June, 2017

Experiments in C

So i had a holliday. I've programmed for years, but strangely enough never in C. Why not try it out? I used:


  • gcc as a compiler
  • nano as the editor
So much for the software architecture. I followed these tutorials, and found that the learning curve to C is akin to PHP and JavaScript. The variables are defined in a different way. But loops are pretty much the same thing. Here's a sample from one of the tutorials.

#include
 
int main () {

   int a;
   /* for loop execution */
   for( a = 10; a < 20; a = a + 1 ){
      printf("value of a: %d\n", a);
   }
 
   return 0;
}

The main difference is compiling. So save the code above in say myForLoop.c. Then compile the file, like this:

# gcc -o myForLoop myForLoop.c

Now you can execute the file in a Linux terminal:

# ./myForLoop


Virtualbox: shared folders and Linux

Linux Mint in Virtualbox: shared folder with a dummy file (# touch x)

  1. Add a shared folder via Virtualbox / Settings / Shared folders
  2. The folder will mount in /media/yourSharedFolder
If you then try to mount the folder, there will be a message like "missing permissions". So the folder is there, but only the root user will have access to this paradise. The solution is this shell command:

# sudo usermod -G vboxsf -a YourUserNameHere

You'll have to reboot the system. Then lo and behold, you can try this in a terminal window:

# touch /media/yourSharedFolder/x.txt

If the file is created the hidden entrance to the palace of the king is open. Of course you could just open the folder, and add a file. But that solution is so last century.


18 June, 2017

Ubuntu: failed to connect fo lvmetad

Phew ... all's well that ends well.

Had this error: "Ubuntu: failed to connect fo lvmetad". Ubuntu booted into a shell. The /home partition was not mounted. I tried to edit the fstab, but the /home share would not mount on boot.

However it was possible to mount the drive, like:

# mount -a

In the failsafe Ubuntu version I cound boot into a menu, with several options. If a fsck was run, the /home would mount, and the boot process could continue.

An error message stated, that there was an error on the /dev/sda5 - and Ubuntu recommended a "manual fsck".

So I booted into the shell, and ran fsck. There were tons of errors, Basicly the prompt asked "shall I repair this or that error". I answered "y" every time. Fsck found some 30 - 40 errors. Then fsck stated, that the system was clean.

I booted ... and ...

to my great surprise everything worked. As in: OK!

During the failsafe mode the CPU ran like hell: 50% or more all the time. The temperature was not a problem. But of course the fans ran like hell. Now everything is back to normal. The CPUs run around 20% when I use a browser, Spotify and what not.

So we're back to normal after a weird trip to shell-land.

27 May, 2017

Shotwell - well?

I just can't figure out how to import pictures ... so I googled. Just to find out: I'm not alone.

27 April, 2017

Mobile and Web - use the USB!

It's faster, and possibly more secure to use the USB rather than the WiFi-option. You'll need a cord. So what. The upside is the speed.

29 March, 2017

mplayer and .pls

A SomaFM stream in the shell.


Here's a how to play SomaFM's playlist "Groove Salad":

# mplayer -cache 1000 -cache-min 80 \
# -playlist http://somafm.com/groovesalad256.pls

NB: In the terminal it's just one line of code. The "\" marks the linebreak.

25 March, 2017

OGP test

My link on Blogger:

http://multimusen.dk/

Compared to pasting my link on Twitter:



For some reason the image isn't visible on Facebook.

Unfortunately Blogger doesn't use the OGP. Or at least so it seems.

01 March, 2017

Strange Pandoc Error Message

Got the error message: "Reference book not found" from citeproc. However the problem was not the reference. The problem was a code section. By mistake I had only three tildes. So I looked for the error, where the error was not.

26 February, 2017

g180 Orion Spectrum

Got this Logitech keyboard. Looking for Linux drivers for the keys. A workaround used by many: configure the keys via Windows. Perhaps wine? So far I'm looking for a better solution than Redmond's.

Installation on Ubuntu

Install this library: https://github.com/MatMoul/g810-led

Make sure, that dependencies are met. I had to:

# sudo apt install libhidapi-dev
# make
# sudo make install

Then g810-led ran by:

# g810-led

Load a profile

#g810-led -pp < /etc/g810-led/profile

This will load a profile. You can write your own. Here's a bash file:

# Profil: 20170227
# Tastatur G810 Orion Spectrum
#
g810-led -g logo 330033
g810-led -g indicators 4c9900
g810-led -g fkeys 990000
g810-led -g modifiers 990000
g810-led -g multimedia 4c9900
g810-led -g arrows 003300
g810-led -g functions ffffff
g810-led -g keys 4c0099
g810-led -g numeric ffffff
#
# save settings
g810-led -c

But it's more elegant to load a profile, the format is:

# Vars
var brun 993300
var groen 009933
var blaa 330099

# All green
a 006600

# Groups
# Set key groups
g logo $brun
g indicators $groen
g mute $brun
g multimedia $brun
g fkeys $blaa
g arrows $brun

# Keys
k space $brun
k win_left $brun
k alt_right $brun
k num5 $brun

# commit
c

The last c is important. It will execute the orders. Note the usage of variables. It's quite handy.


Load the g810-led keyboard on boot

This can be done in sevearal ways. It may be deprecated, but creating:

/etc/rc.local

With this content does the trick:

g810-led -pp < /etc/g810-led/profile

You can even restart the file as a service:

sudo service g810-led restart

So basicly this is all you need in order to have a cool layout at the boot time.


Issues

The library works .. that is sort of. Sometimes a key or two will miss. Restarting the service helps. So the library is still in a process of development.

Solution

I started the programs by rc.local. But that's a bad idea. Using the same code in the Ubuntu menu for upstart programs work like a charm!

g810-led -pp < /etc/g810-led/profile

Ubuntu's Startup Application.


Using the keyboard

It's high quality. You'll get addicted pretty fast. I really like this keyboard.

14 January, 2017

Could not mount shared folder on VirtualBox

Workaround: created a ssh connection with the host in Ubuntu's file manager:

ssh://192.168.0.xxx

There were many complex solutions. This is easy. The result is the same: you'll get files in and out of the box.

09 January, 2017

Screendump: Ubuntu 16.10 and partitions
During the weekend I've build a PC:


  • GA-Z170N-Wifi
  • Seasonic X-Series 750w Power Supply
  • 8GB RAM
The OS is Ubuntu 16.10 booting from a 120GB SSD and whith /home/ on a 2TB WD harddisk.


The Moderboard in the box 
CPU


Unboxing the motherbard

Antenna, SATA-cables, shield 
The motherboard


The CPU mounted on the board

Cooler

The cooler fan mounted

Oh, and with foreground RAM. Notice the nice bokeh.

The cabinet

The cabinet and wires

Here the shield is mounted on the cabinet.

The power supply. Seasonic X.

Harddisks

The cabinet with sides mounted

The first trialboot. Linux Mint worked from a DVD. But not on the harddrive.

Ubuntu ran like a charm.

The finished PC. Booted with Linux. To the left my trusty work laptop.

All systems up and running. Alertlevel Green.

08 January, 2017

Linux

Trying to config a new PC. Linux runs from a DVD, but the Mint / Ubuntu install crashes. I've tried all sorts of UEFI enable, diable and what not. Now I'm trying another distro: Ubuntu Studio.

Linux Mint kept crashing.

So I turned to Ubuntu 16.10. Noproblemo. Everything worked. However I did not set up the 2TB backup drive yet. That's for tomorrow.

The plan is to move /home/ to the 2GB drive.

Solution: drop mint, use Ubuntu 16.10