Raspbian, OpenELEC, Retropie on Raspberry Pi 3 – notes

Recently, I bought myself a new Raspberry Pi 3 Model B. I had a Model B from the first iteration previously, but I managed to make USB ports unusable by, well, connecting a power supply to the audio port. It was even blinking some LEDs for some time 馃槈

My plan for the new one was as follows:

  1. Have a working Raspbian instance that I could take i.e. for a trip with a small foldable keyboard, mouse and HDMI cable and connect to a TV at a hotel
  2. Be able to use XBMC (now called Kodi) to watch media
  3. Be able to use RetroPie – the most important is SNES support (Aerobiz Supersonic!), I’d be happy too to play some Pokemon franchise games and try out PSX support. I have two no-name joypads bought for about 2 euros each at a supermarket.

My first approach was to combine it all in one Raspbian instance. I installed Raspbian on a 16GB microSD card and it booted up without any issues. WiFi connection worked when I connected an HDMI cable the sound was also working fine.

It was possible to install Kodi simply by using apt-get. I added a Youtube addon from the repositories to check out if it works fine. It did, but I was surprised by the long waiting times. When I entered a string in search section, it took about a minute to find the videos.

The playback worked fine, though.

Side note – on Raspbian there are several programming environments that aim to help young people find programming interesting. I checked the Java ones and based on that, I think it certainly won’t help them find Java programming interesting 馃槈

There’s also Minecraft!

With Retropie, the issue was bigger. I followed the official guide of installing RetroPie on Raspbian only to find out that my version of Raspbian is too new and isn’t supported yet. I tried to comment out lines that blocked installation, in this case, to find out if it could work.

After several hours of compilation and two total freezes, I woke up next morning to see that 6 of the packages, including the core one, had compilation errors. During the compilation, the RAM was fully occupied.

After consulting with colleagues that have Raspberry Pis, instead of buying a second card especially to install RetroPie, I tried out BerryBoot which is a bootloader for Raspberry Pi. I needed to wait for some time while the images were downloading and installing.

It worked out of the box, though. For Kodi, I chose OpenELEC which is a distro that wraps Kodi, has a web interface and SAMBA sharing.

RetroPie also worked fine. I was surprised that it discovered my joypads correctly (except for the fact that analog gauges seem to be working the same as left side buttons – but I suspect this is an issue with my joypad, not RetroPie) and it had all the emulators on board. Soon I was able to see this.

I tried out several of the simulators. PSX, for instance, works fine, while Nintendo 64 works like this.

Overall, it looks like Raspberry Pi is a good media/fun center for the TV. Full HD movies are playing fine, classic games are playable, and BerryBoot helps in having a working operating system on the same SD card.

Bash: rename all files matching regex in directory and change their content to match new names

Let’s assume I have a directory full of files that have names containing聽index.php@ which I want to replace with聽index.html.聽.

Adding one more issue: all those files are actually HTML that contains links to each other.

I’d like to rename them and keep all the links working. Bash to the rescue:

for old in ./index.php*; do new=$(echo $old | sed -e 's/.php@/.html./'); mv -v "$old" "$new"; done
find . -type f -exec sed -i 's/php@/html./g' {} ';'

Did it work? It looks so:

Thank you, StackOverflow! [1] [2]

Lifelog #5: Kopenhaga i 4 liga szwedzka

Ko艅c贸wka wyjazdu do Kopenhagi i Malm枚 to spacer po samym centrum Kopenhagi (z ma艂ym zahaczeniem o Christiani臋, gdzie jednak jest zakaz fotografowania). Sama Christiania by艂a jednym z ciekawszych punkt贸w wyjazdu – pierwszy raz widzia艂em bazarek, na kt贸rym kompletnie publicznie sta艂y stoiska z jointami – 50 koron du艅skich za jednego. By艂o to te偶 jedno z bardzo niewielu miejsc tego wyjazdu, gdzie nie mo偶na by艂o p艂aci膰 kart膮. Po powrocie do Szwecji poszed艂em na mecz czwartej ligi na stadionie, kt贸ry go艣ci艂 Mistrzostwa 艢wiata w 1958 i Mistrzostwa Europy w 1992 roku. Mecz odby艂 si臋 mi臋dzy dru偶ynami IFK Malm枚 i 脰sterlen FF – gospodarze wygrali 3-0.