Categories
Linux Open Source Technology Ubuntu

Raspberry PI4 upgrade to bullseye and LXC notes

So whilst guides like this one: https://www.tomshardware.com/how-to/upgrade-raspberry-pi-os-to-bullseye-from-buster are very useful there were a couple of extra things that I needed to fix.

  1. I needed to update /etc/apt/sources.list.d/raspi.list in addition to /etc/apt/sources.list – changing buster to bullseye
  2. LXC config for networking caused issues to the networking

Point 1 is explained above but point 2 took me a while to figure out what was wrong. And this is only really relevant if you are using LXC (Linux Containers – a lightweight precursor to Docker / K8s). I am documenting this for anyone else who might be seeing issues (or my forgetful future self!). Also note that trying to define the static IP via dhcpcd.conf didn’t work (although perhaps as I was trying to configure eth0 rather than lxcbr0?!)

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# attempting to configuring eth0 here 
# like the below will cause multiple errors!
auto eth0
iface eth0 static
    address 192.168.x.y
    netmask 255.255.255.0
    gateway 192.168.a.b
 
auto lxcbr0
iface lxcbr0 inet dhcp
    bridge_ports eth0
    bridge_fd 0
    bridge_maxwait 0
    
# wifi
allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid SSID
        wpa-psk KEY

What it needs to look like (the static IP part is configured within the LXC definition).

# interfaces(5) file used by ifup(8) and ifdown(8)



# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

#eth0 - built in ethernet is configured via the LXC bridge
# DO NOT CONFIGURE IT SEPERATELY OR networking and LXC will give errors

auto lxcbr0
iface lxcbr0 inet static
    bridge_ports eth0
    bridge_fd 0
    bridge_maxwait 0
    address 192.168.x.y
    netmask 255.255.255.0
    gateway 192.168.a.b

x.y and a.b are replaced by your actual addresses of course. Hope this helps someone (and I remember it if I need it again!)

Categories
Linux Open Source Ubuntu

Upgraded to Ubuntu Server 18.04 LTS

Was remarkably easy to upgrade over SSH (which is good as I am not in the Linux command line world as often these days!) https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes

Have also applied many of the hardening steps at:

https://blog.ubuntu.com/2018/07/30/national-cyber-security-centre-publish-ubuntu-18-04-lts-security-guide

Well worth a read if you are running Ubuntu and want to improve security. Not mentioned on there (probably as its more about using Ubuntu as an end user device rather than a server) is to review the SSH config and harden the SSH service.

Categories
Linux Open Source Sony Stuff Ubuntu

Streaming HD content to your TV via a PS3 from a Linux Server (or Windows PC)

Quick post – caveat haven’t had a chance to proof read this one and its late so it will have to do for now!

You may not be aware that you can use a Playstation 3 to act as a media streaming/playback client using a system called DNLA (also known as uPNP). This allows you to view content on your computer on your main TV in HD. Windows Media Player can act as the “Server” portion but its not ideal for connecting to the Playstation.

Crude diagram here, might expand this with my full setup when I get a chance:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I have been trying to get this working for a while. Essentially the plan is to get access to downloaded videos, videos from my camcorder (now HD) to save burning it to DVD or Blu-Ray and also access my photos and music collection from my Ubuntu Linux server that holds all my content (on a RAID 1 mirrored disk setup) to my TV and home cinema/HiFi setup.

Last time I tried to use a small command line utility and my PS3 was only connected via Wireless to the Server – the result was stuttering music let alone videos. So its something I gave up on for the time being.

Recently I have been able to overcome this as I have discovered flat gigabit ethernet cables that I can run out of my double glazed windows (even when shut!) so I have hacked a gigabit backbone that connects my TV and AV kit (including PS3) to my Linux Server (in fact the very one that served this blog page to you) that hold gigabytes of multimedia (now there’s a word you don’t hear much these days!)

Also discovered http://code.google.com/p/ps3mediaserver/ which is a great Java based server component for PNP based streaming – as the name suggests its specifically designed for connecting the PS3 up to content…

Screenshot of ps3mediaserver

 

 

 

 

 

 

 

 

Hey presto excellent quality video (including 1080p video) and music on the TV / HiFi!

Next to work out how to get my iTunes (stuff that only plays on iTunes rather than MP3s) music across and available to the PS3. I have moved and shared the my iTunes media folder (as have that on the network too – as per these instructions – http://lifehacker.com/230605/hack-attack-share-your-itunes-music-library-over-your-home-network - so I can re-use iTunes across different machines – and keep it backed up).

Categories
Linux Open Source Technology Ubuntu

This blog is now running on new hardware & software!

Recently changed the server this blog runs on to a low power Dual Core Intel Atom in a smaller form factor case (mini ITX). In an attempt to reduce my environmental and electricity footprint. Took the opportunity to upgrade Ubuntu Server to 10.04 LTS which comes with MySQL 5.1 and WordPress is now 3.0.1 ( which was a very easy upgrade – one click from within the web based admin – well done WordPress team for that!).

The Dual Core Opteron box this blog used to run on will now only be powered up when I am experimenting with Server Operating systems (will be re-built as VMware ESX host).

Getting in some IT geekery before my life gets turned upside down!

Categories
Linux Ubuntu

Adventures to fix Ubuntu & RAID boot up

Yeah finally fixed an annoying issue with my Linux Server at home (nice to flex my Linux admin skills!) documenting it here in case I ever need the commands again or its useful to others:

Problem:

Ubuntu 9.04 no longer booted after a minor update (from .15 to .16) with my Software RAID setup as described in these reported bugs:

https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/330298

https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/158918

Fix:

Following the instructions on https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/136252/comments/5 fixed the problem but you need to run update-initfs -u so it updates.

Amazing what you learn when having to fix this kind of stuff – for one I now understand the memory based file system that linux uses during boot better.

Categories
Linux Open Source Ubuntu

Running Windows via Linux to improve performance (fixing VirtualBox on Ubuntu 9.04)

Screenshot of VirtualBox running XP under Ubuntu
Recently I’ve started using Virtualisation – for those who don’t know this is running an Operating System or OS for short (such as Windows) as an application (so you could think of it as running a computer within a computer). I’ve started doing this as I’ve got frustrated with Windows slowing down after being installed for a few months. This way I can run Linux which is very stable and performs consistantly as the main Operating System (or the “Host”) and then run various “Guest” OS installations – such as Windows. You can take snapshots or save the state of the Guest machines – which is ideal if you want to go back to how your Windows install used to be (but unlike reinstalling all your applications and settings are as they were).

Generally Windows runs at the same speed as it does normally – so long as you don’t run too much stuff on the Host OS at the same time – but of course there are limitation – eg Games or software that needs access to devices that can’t be provided via VirtualBox. And of course you could run the reverse setup – if you fancy trying Linux as a Guest OS but keeping the safety net of Windows as your main Operating System.

Anyway I’m posting this as I’ve been using VirtualBox on Ubuntu Linux to run Windows XP. On a recent upgrade from Ubuntu 8.10 to the latest version 9.04 VirtualBox failed to run. This was fixed by running the command given in the error message (its nice to get a very useful error message in software!)

The command I had to run was sudo /etc/init.d/vboxdrv setup

Once VirtualBox was working again I noticed that the Host key (which is the key used in different combinations to switch between the Host and the Guest OS) was not working. Instead it was flashing the Ubuntu desktop and pulsed some circles – like radar – from the cursor. At first I didn’t twig that it was simply the new mouse settings in the latest version of Ubuntu. By default it now seems the tickbox below in System->Preferences->Mouse for “Show position of pointer when the Control key is pressed” :

Mouse Settings in Ubuntu
Mouse Settings in Ubuntu

Hey presto – the host key works again! Hopefully this is helpful for anyone else confused by this one!

Also note the position of the sliders in the above screenshot for acceleration and sensitivity – I find these settings make the touchpad on my Vaio behave in a similar way to Windows (previously my mouse felt too sluggish).

I’m now actually using Windows less and less now at home (Evolution is a decent email client and of course Firefox offer pretty much the same browsing experience – apart from some differences with fonts, and OpenOffice allows for opening the odd Office attachment). The true acid test though is how much the wife moans as previously she’s never been happy without the familarity of Windows…! (But then it is still available in a couple of clicks).

I’m sure there will be more on my adventures of using Ubuntu on the desktop in due course – if I find time I’ll share anything I think others might find useful…

Categories
Technology Ubuntu Web Development

Fix for Firefox Addons error…

If your not having any joy when installing addons in Firefox 3 (sorry can’t remember the specific error message) – but nothing seem to fix it – even re-installing) we managed to confirm the fix today at work. Note that involves completely clearing all Firefox related info (so settings, bookmarks etc will be gone)…

* Uninstall Firefox
* Then make sure that the C:\Program Files\Mozilla Firefox is completely gone
* Also clear out the C:\Documents and Settings\<<username>>\Application Data\Mozilla folder (it will probably still contain Firefox and Extensions directories)
* Re-install

Voila – you can install extensions again (like the brilliant FireBug)

This also works for Linux (had a similar issue at home with the Latest version of Ubuntu).

Categories
Open Source PHP Technology Ubuntu

Installing Zend Core PHP on Ubuntu Linux (8.04)

Warning! Techy post – if your not into Web development you’ll want to skip this one…

I’ve been wanting to try out Zend Core (Zend’s standard PHP stack / extension or “Reliable PHP made easy”) for a while but as Ubuntu isn’t officially supported I’ve held off. A problem with some code running on the Ubuntu version of PHP 5 forced my hand – I discovered that its actually not that hard to get ZC up and running on Ubuntu. Thought I’d share in case this is helpful to anyone…

  1. Download, unpack and run the ./install command as per usual
  2. I opted to stick with the version of Apache already installed (as its slightly newer than the Zend bundled one)
  3. My experience of Zend attempting to configure Apache varied – one some boxes it almost worked, others it didn’t. If you find the installer crashing out just untick the configure Apache option and try again.
  4. Once Zend Core has completed you’ll need to tweak things abit…

PHP5 Module

The ZC installer will have probably left your Apache configured with 2 LoadModule php5_module entries (one in /etc/apache2/apache2.conf – thanks to ZC and the other Ubuntu one in /etc/apache2/mods-enabled/php5.load). So you can either do a sudo a2dismod php5 to remove the Ubuntu one or modify the Ubuntu one to the following:

LoadModule php5_module /usr/local/Zend/Core/modules/apache22/libphp5.so

In fact you can be cunning here by commenting out the Ubuntu PHP5 extension and adding the ZC one in this file – allowing you to effectively switch between the 2 different extensions should you need to.

MySQL extension – if you’re using MySQL then you’ll need to watch out for the fact that the bundled MySQL extensions look for the MySQL socket file in /tmp/mysql.sock rather than the Debian / Ubuntu location which is /var/run/mysqld/mysqld.sock

In most cases changing in php.ini:

mysql.default_socket =
to
mysql.default_socket = /var/run/mysqld/mysqld.sock

Does the trick; but alas not in all cases it seems (eg MySQL PDO). Really hacky fix to this (please do let me know if you have something better – other than editing the socket in the /etc/my.cnf file) is to run a scheduled (using crontab) symlink of /var/run/mysqld/mysql.sock to /tmp/mysql.sock

To do this run: sudo crontab -e
and add the following line:

 5 * * * * ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

And for now that works for me. If you want a copy of some of the relevant config files / snippets (including the extra bit that ZC adds to the apache2.conf) then I have zipped them up for ease.

Zend Core itself looks like a good product – being able to access to php.ini options via web based tool is pretty useful, as is knowing you are working on a consistent & tested version of PHP. Its a shame MySQL doesn’t offer a similar free / unsupported version of their MySQL Enterprise in a similar way really…

Categories
Open Source PHP Ubuntu Web Development Zend Framework

Zend Framework to be bundled with Ubuntu Hardy (8.04)

Interesting & good news – Zend Framework is being bundled as part of Ubuntu Linux: http://devzone.zend.com/article/3232–Zend-Framework-to-be-part-of-Ubuntu

Direct link to article: http://andigutmans.blogspot.com/2008/02/zend-framework-to-be-part-of-ubuntu.html

Also found an interesting presentation on version 1.5 of the Zend Framework.

Categories
Linux Open Source Sony Stuff Technology Ubuntu

Ubuntu Hardy Heron (8.04 alpha), Sony Vaio Memory Stick slot reader

Desktop of Hardy HeronBit of a techy one here (so skip this if your not into Linux!) but sometimes these posts are useful to others!!!

Whilst trying to get my Sony memory stick slot (Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD) working on my Vaio under Ubuntu 7.10 (Gutsy) I came across this bug report where someone recommended trying the live CD of the latest release (Hardy Heron) to see if that fixed the issue.

Not sure is progress on the issue with the memory stick reader has been made – instead of:

[10321.605008] tifm_core: MemoryStick card detected in socket 0:0
[10321.611165] tifm_ms: Unknown symbol tifm_has_ms_pif

I now get:

tifm_core: MemoryStick card detected in socket 0:0

Which is possibly a bit of a backwards step!

However what I did discover is that the alpha (development) version of Hardy – the new 8.04 version of Ubuntu which is due for release next month – is pretty stable. So I have decided to take the plunge and did a dist upgrade (changing the /etc/apt/sources to reference hardy rather than gutsy and then running upgrade-manager -d). So far working well (hopefully not famous last words!!) writing this from it.

This thread (SONY VAIO MEMORY STICK: tifm_7xx1: sd card detected in socket 0)
and another on Ubuntu Forums discusses a similar issue / mounting SD cards and the latter suggests using

sudo mount /dev/tfa0 <mount point>

but this doesn’t work for me – if anyone knows how you look up what a device is likely to be listed as I’d be keen to know (need to do a bit of digging on this). I think I need to resolve the tifm_ms bit first.

I have been contributing the bug report (feels good to give something back after all the years of being a Linux user – now on the way to becoming a tester / bug reporter – who knows one day I might write some code for it!!)

Hardy comes with Firefox 3 beta 3 which seems really good also (hope I won’t be eating my words!) unfortunately Firebug and Google Brower sync (two plugins I can’t live without!) don’t seem to be available for it yet – so I am mostly using FF2 still.