Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is morphex@gmail.com.

I am leavingnorway.info.

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex

News
Me on Instagram
Slashdot

Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter



Older entries



Atom - Subscribe - Categories


Script to setup WiFi at boot

So, I've got a computer I can't easily access, so I have to set it up to use WiFi at boot. Different configuration options on different Linux distributions give unpredictable results. Today I also experienced a lot of dropped connections, so I had to add a test for network connectivity and setup part of the connection when it drops.

Here's the script, it is also available on https://blogologue.com/wpas.sh

#!/bin/bash
# Crontab entry: @reboot /root/wpas.sh
# Uncomment to kill any wpa_supplicant processes started automatically
#/usr/bin/killall wpa_supplicant
/sbin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &> /root/wpas.log &
/bin/sleep 5
while :
do
/bin/ping -c 2 blogologue.com
if [ $? -eq 2 ]
then
/usr/bin/killall -q dhclient
/bin/sleep 5s
/sbin/dhclient wlan0
fi
/bin/sleep 5
done




[Permalink] [By morphex] [Linux (Atom feed)] [23 Jan 15:09 Europe/Oslo]

Google Drive on Linux (ocamlfuse) and cp cannot create hardlink, function not implemented

So, I was copying a bunch of stuff from an old Windows partition, in case there was something there I needed, making a backup to my Google Drive.

Copying it all using Firefox or Chrome didn't work, the process just died away at some point. So I thought why not go for the command line, which could be setup to retry etc. whenever something fails.

I found google-drive-ocamlfuse, and installation and setup was straightforward. The installation command was

sudo add-apt-repository ppa:alessandro-strada/ppa && sudo apt-get update && sudo apt-get install google-drive-ocamlfuse

(all on one line).

After that, I created a directory google-drive in my home folder, with the command

mkdir google-drive

and setup that folder as a mount point to my google drive, using

google-drive-ocamlfuse google-drive/

It is worth mentioning that you have to close down the browser after authorizing gdfuse to access your google drive, otherwise you can sit and wait on the command line for a long time.

Voila, the google drive was mounted at /home/morphex/google-drive

Now, to mount my Windows partition and make it accessible for my regular user, I had to run

sudo mount -u uid=1000,gid=1000 /dev/sda3 /mnt

To mount the drive accessible to my regular user, so the copy command could read all files.

To copy all the files from the Windows partition, I had to use

cp -Ruvv --copy-contents /mnt /home/morphex/google-drive/ssd

It is worth mentioning that I figured out I had to use the --copy-contents argument, after cp said it couldn't create hardlink, function not implemented.

As an example, that was presumably that a file A existed, and file B was a pointer to the same file, with no contents of its own, and the ability to copy just the pointer was not implemented, so now file A and B exists in the google drive folder, each with their own set of data, taking up double the space.

It was a bit surprising that it took a bit of googling and thinking to figure out I could use the --copy-contents flag.


[Permalink] [By morphex] [Linux (Atom feed)] [05 Sep 15:59 Europe/Oslo]

Installing and using Fedora Linux 26 on my desktop computer

So, this week I got to buy a used bass guitar for cheap, after having put up an advertisement that I wanted to buy one.

I live in an apartment complex, so using any rig to play music is not such a good idea, so I thought why not go the cheap route here as well, and try to use a software-based amplifier which should give some of the same sound as an amplifier.

Well, I also bought a cheap USB-pluggable sound card a while ago, so I thought I'd use that.. but that didn't work out too well, so I decided to upgrade the Ubuntu installation from version 16 to 17..

And that was a mistake. I think the problem was that I had made some customization to the USB setup etc. a while ago - and when I upgraded to the new software and settings it didn't mix well with what I did earlier.

So.... after a bit of back and forth trying different options, the one I ended up with was wiping out the old Linux swap partition and installing Fedora 26 on it, which should be OK as I do have 16 GBs of RAM.

So yeah, I ended up doing that, the installation was straightforward and booted up in the new environment.

The environment didn't look too good, as the NVIDIA graphics drivers had to be installed manually, and the default settings for appearance of the desktop were towards fast and snappy rather than pretty.

Installing the NVIDIA drivers was a process in itself, and it's hard to understand that there is a good reason for having to do this, this way, in 2017. I saw something about NVIDIA being worried about knock-off cards etc. - but if it is so easy to knock off the product maybe this is more about brand and perceived value. Or maybe NVIDIA is favouring the Windows platform and making it a bit harder for Linux to compete. "Dollars, anyone?"

Anyway, I found instructions for installing the graphic drivers here:

https://www.if-not-true-then-false.com/2015/fedora-nvidia-gu...

Which were straightforward. After tweaking the settings a bit, the desktop looks OK and here's a screenshot:

Screenshot of Fedora 26 Desktop with KDE Plasma

Another thing I had to deal with was the sound setup; I have multiple soundcards in my machine, one is built-in into the [Edit: replaced soundcard with motherboard] motherboard, another is in the NVIDIA graphics card and the third is in my USB gaming headset, the Razer Megalodon.

When I bought the headset about a year ago used, it was a bit of a process to set it up on Linux, but eventually it worked.

So I was a bit surprised when it worked out of the box after the installation, but when I tried playing music there was no sound; the system automatically preferred another sound card even though the Megalodon was the default sound card. After oogling and googling a bit, I found that I could disable the other sound cards by blacklisting their driver module in the kernel, adding "blacklist snd_hda_intel" to /etc/modprobe.d/sound.blacklist.conf.

So although the installation process is OK, the user-friendliness of Fedora is still a bit half-assed, no regular computer user can easily figure out how to blacklist a sound card, and it is difficult to setup the graphical appearance in the most appealing way.

[Update 2017-09-24] I decided to try out some gaming as well, and installing the Steam client looked like a good choice. However, even using the RPM Fusion repository, the Steam client failed with different errors. The fix for that was downgrading (...) the NVIDIA drivers from 384.90 to 375.82.

[Permalink] [By morphex] [Linux (Atom feed)] [23 Sep 14:14 Europe/Oslo]

Android everywhere for anyone

So, I've been using Android phones and tablets for a while now.. My HTC One X Android phone stopped working properly last week and this week I got around to delivering it in for repair.

I've been happy with the HTC One X, the only thing I have that is a bit annoying is that it sucks a lot of battery and needs to get charged during the day. Which might be partly because of lots of different apps pushing and polling over the network, but how hard can it be to get something going with good power management?

I think I'll buy a thicker phone, with a bigger battery, next time.

So yeah, I delivered the phone for repair and got a HUAWEI Ascend Y100. A snug little phone that runs Android. But typing things on it is a real pain, the keyboard and screen is much too small.

As I use different Android devices it is nice that they run the same icons, system etc. If I know one Android Phone I know them all.

I think that will be a good thing for Android, that you can go between devices and have calendaring and contacts sync over different models and that for example resetting a borrowed phone is the same on different models and easy as going through a couple of menus (privacy tab in settings).

[Permalink] [By morphex] [Android (Atom feed)] [16 Nov 15:04 Europe/Oslo]

Spotify without Wine

So, after firing up Spotify in Wine a couple of times I got the message that I was running Spotify on an unsupported platform (with a link).

I opened the link and found that Spotify for Linux is in technology preview state. Fine, got some instructions on how to install it and followed them and voila, Spotify for Linux installed. Of course it was debian-package based which seems like the way most software organizations distribute software for Linux these days.

It works very well, looks a bit better than Spotify in Wine. Music sounds good etc. so it's a win. :)

[Permalink] [By morphex] [Linux (Atom feed)] [10 Nov 19:57 Europe/Oslo]

Spotify with Wine

So I try different things now and then, Linux, Windows a little bit of Apple. These days I'm keen on playing around with Linux again, and have Ubuntu Studio running as my main desktop.

I like music. I love music. So I thought I'd get Spotify installed using the Crossover "Windows-for-Linux" plugin, as I got a free 12-month deal on Halloween on the CrossOver plugin.

So yeah, installed CrossOver and downloaded the Spotify installer, but the installation process hung and I exited.

Thought I'd try regular Wine (1.4) instead, located the Spotify installer in /tmp and installed. And yes, it works fine. :)

Maybe we'll see more and more developers more aware of the Linux platform and developing in a way where Windows apps work transparently on Linux with Wine, that would be nice.

I leave you with this: spotify:track:4er8NyQ8cFnZ2b643Tjc44

[Update..] Here's how Spotify looks on Linux: http://blogologue.com/spotify.png

[Permalink] [By morphex] [Wine (Atom feed)] [08 Nov 19:27 Europe/Oslo]

Top ten

VG, I guess the biggest newspaper in Norway, both in print and online, have a top-ten list over good reasons to choosing Linux:

  http://www1.vg.no/teknologi/artikkel.php?artid=175791

Guess you don't need a big marketing budget when the product.. sells itself through word of mouth. :)

[Permalink] [By morphex] [Ubuntu (Atom feed)] [19 Oct 02:56 Europe/Oslo]

On second thought

I read a very interesting comment on /.:

http://linux.slashdot.org/comments.pl?sid=325553&thresho...

and giving it some thought, I think those at the top @ Microsoft might know that there are holes in the dam and that the desktop monopoly is about to bust. Maybe it is just about buying time to entrench other markets and earn some more money on the desktop bit while they can..

[Permalink] [By morphex] [I <3 my Linux (Atom feed)] [11 Oct 23:55 Europe/Oslo]

I <3 my Linux

Yesterday I bought myself a printer; I haven't had one for years as I've been trying to go "paperless".. but, things being what they are, you have to print documents at times, sign them and get them scanned in some cases.

That's why I bought an all-in-one printer from HP (Officejet) which supports printing, scanning and faxing.

Yesterday the printer was setup, and setting up the printer on Linux was peaches; just search for a printer, and there it was found - on the network.

Today though I had to scan some things as well, and XSane couldn't find the scanner, so I had to download and run the HPLIP installer:

  http://hplip.sourceforge.net/index.html

it asked a bunch of questions, un-installed the default HPLIP installation and installed itself. Easy enough, but maybe not that easy for mortal users.

So, now I have a printer and scanner on the network, and it's working quite well. I remember the days where setting up a printer in Linux could be quite a job, with kernel compiling, library dependencies, special applications and whatnot.

Linux sure has come a long way, and in some areas it is better than Windows, even though Linux is Free.. it's interesting to see Ballmer the monkey scream and jump around about how Linux infringes on their intellectual property, trying to scare people and organizations from using it and getting a cut.

Sure, some things in Linux are copied or pretty similar to what's in Windows, but then again, how much has Microsoft copied from others without paying a dime? And how many dirty tricks has Microsoft used throughout the years to build and maintain their monopoly?

The distaste for Microsoft grows for each day, and even if they come up with cool things every now and then, it just doesn't appeal to me, getting or using something that is tainted by their past and current antics.

What would the world have looked like today, without Microsoft? One can only wonder..

[Permalink] [By morphex] [Ubuntu (Atom feed)] [11 Oct 17:44 Europe/Oslo]

Re-installing Ubuntu

A while ago I managed to screw up my Ubuntu installation by upgrading to an experimental version, and as a result of that I ended up running Windows XP for a while, because I didn't want to spend time fixing my Ubuntu installation.

But, lately I've been having problems with my Windows installation lagging and being irritatingly slow, so I'm back to Ubuntu Linux again. At least with Linux, I know when it is my fault when something breaks.

I'm actually blogging this from the computer I'm currently installing on, which is in itself a very cool thing. Wireless and everything works out of the box.

[Permalink] [By morphex] [Ubuntu (Atom feed)] [10 Oct 16:35 Europe/Oslo]

Screen shot

A screenshot of an uncluttered desktop:

No description available

This is another excellent mandolux background.  Right click
the image an click on "view image" or something similar
to get the full-size picture.


[Permalink] [By morphex] [Sweetness (Atom feed)] [17 Jan 01:46 Europe/Oslo]

Some desktop backgrounds

Here you'll find some desktop backgrounds for your screen setup. Most backgrounds fit for 2 screens, some even for 3:

  http://www.mandolux.com/


[Permalink] [By morphex] [Sweetness (Atom feed)] [15 Jan 17:51 Europe/Oslo]

Sweetness

After playing around a bit with the X configuration on Ubuntu, I've finally got a dual screen setup working.

It is running Gnome, and the best part is that I not only have a dual screen setup, those dual screens work on each virtual desktop as well! On virtual desktop 1 I have Rhytmbox running in the left screen and various internet messaging tools in the right screen. On the second virtual desktop I have Thunderbird at the left and Firefox at the right.

This, people, is going to rock!

Here's a (poor) shot:

No description available


[Permalink] [By morphex] [Ubuntu (Atom feed)] [11 Jan 04:13 Europe/Oslo]