Friday, April 29, 2022

Forward LMS to the net

I have a LMS installation at home and a shoutcast music stream public-ally available. Sometimes I want to join some friends online and allow them to queue music up from my LMS into the shoutcast stream.

I use darkice to stream what I'm listening to up to a shoutcast server. And then I forward the http of my LMS install to an intermediary host with this command:


ssh -R 8081:localhost:9000 -p 23 richard@my-intermediary-host.com


Then, on my-intermediary-host, I set up an apache proxy, and add in basic http auth to stop folks chancing apon it.


Listen 8008
<VirtualHost *:8008>
    ProxyPreserveHost On

    # Servers to proxy the connection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/
    # Example:
    ProxyPass / http://0.0.0.0:8081/
    ProxyPassReverse / http://0.0.0.0:8081/
    <Proxy *>
        Order deny,allow
        Allow from all
        Authtype Basic
        Authname "Password Required"
        AuthUserFile /etc/httpd/.htpasswd
        Require valid-user
    </Proxy>
</VirtualHost>

The next step here is to avoid using darkice and probably use LMS's mp3 streaming output to plug directly into shoutcast... probably using ssh forwarding for that as well.

Saturday, February 26, 2022

I recently discovered a friend had passed away. This is my history with this wonderful man.

I first met James in a competitive hockey game at the age of ~15. He played goalie, a position that required a disguise. I was left-back, not close enough to get a good look until we shook hands at the end of the game. I remember the game, so did James when we met three or four years later. It was away for me in south London. It was a home game for James.
 
Next time we met was at Cottam Side. We were both starting our second year of University and needed somewhere to live. He was studying Math and a language (may be Italian?). He introduced me to the super nintendo and Yoshie's Island. He brought a guitar and music to the house. He introduced me to the Meters. We smoked and drank together along with the others in the house. It was a busy house with lots of folks visiting. There were Mario Kart tournaments with players bring their own controller. He was an accomplished gamer. At one point the TV pitched forward and crushed the cartridge into the top of the Nintendo. The console survived but the game didn't.

James was part of the group I hung out with for the duration of my time at University. With the release of the N64 and Goldeneye, he garnered the nick name Dr Shit because of his unwavering choice of character. He was a scientist, wearing a brown suit. I have searched thought the characters but can't find it now. The year after the N64 was released, the PlayStation was released. We chipped ours and played FF VII on one TV while watching the test match on the other. James had cultivated kapoera expertise at this point and would arrive out our house in MHP through the window.

A year or two after parted ways at university, he came an played hockey with me at St Francis on a weekend. He played in goal and didn't let anything through. That evening, Laura invited me and James to a party in Brighton. It was fancy dress. I dress as an African King and James as something else (I don't remember). But I do remember he suggested that if he had a superman costume, he could borrow a wheelchair from his mum to make it complete. This was, and still is, a very funny and inappropriate image to me.
 
My girlfriend and I visited him for an evening in Surburburtan. He put us up for the night. We were on our way for a day at Kew Gardens. We met his girlfriend at the time, and played games and drank together. This was the era of the xbox. Outrun is the game I remember best.
 
I saw James last on the occasion at party immediately before my wedding. We were on a canal boat and on the Saturday evening James managed to locate us and appeared as if by magic. We hung out for a few hours before heading off. I needed to be reminded of this by my friend when we talked about James last weekend. The last correspondence I shared with him was in 2010. He wrote to me explaining his tardiness in replying to my previous message because his daughter Maisie had been born.

He is a great friend for me and I feel said to think that he is not somewhere on this world, doing something, waiting for a chance encounter to reconnect me with him.

Thursday, June 18, 2020

Some helpful stuff to make a party online:

https://github.com/theasp/docker-novnc

https://stackoverflow.com/questions/43312975/record-sound-on-ubuntu-docker-image

apt-get update
apt-get install pulseaudio socat
apt-get install alsa-utils

# Start the pulseaudio server
pulseaudio -D --exit-idle-time=-1

# Load the virtual sink and set it as default
pacmd load-module module-virtual-sink sink_name=v1
pacmd set-default-sink v1

# set the monitor of v1 sink to be the default source
pacmd set-default-source v1.monitor
 
 
 
Then use darkice and darksnow to send to icecast2. 

Wednesday, May 6, 2020

CentOS8 and vpnc

VPNC packages are missing from CentOS8 and EPEL 8. Furthermore, recent RPMs from Fedora will not install on CentOS8 because rpm is apparently missing zlib compression support. For this reason, if you want to connect to vpnc I suggest you rebuild the SRPMs. I used:

  NetworkManager-vpnc-1.2.6-4.fc32.src.rpm
and
  vpnc-0.5.3-37.svn550.fc32.src.rpm

And those packages got everything working for me from the command line on CentOS8.

Thursday, April 2, 2020

wiimms tools compile on AArch64 with Fedora 33...

I've downloaded a recent version of Wiimms tools to manipulate WBFS and wii images. https://wit.wiimm.de/

make all failes unless I added this to the LDFLAGS in the Makefile:


-Wl,--allow-multiple-definition
 
 
Thanks to this post: https://github.com/onsi/ginkgo/issues/435

Wednesday, August 21, 2019

Rename export from JB7, Brennan

I found myself having to migrate a MP3 collection off a Brennan JB7. This was good new as the JB7 wasn't fit for purpose in this case. I exported the MP3s, and the catalogue to a text file. I was surprised to discover the JB7 does not apparently use MP3 ID3 tags.

The script below corrects this by applying the catalogue data from the text file to the MP3 metadata. Use at your own risk!

import re
import eyed3
from pathlib import Path

if __name__ == "__main__":

    file = open('jb7_catalogue.txt', 'r')
    big_list = file.read().split('\n')
    cd_dict = {}
    lineno = 1    for line in big_list:
        m = re.match('^(\d)+$', line)
        if m:
            title = big_list[lineno - 2]
            if re.match('^(\d|[A-Z])+$', title):
                title = big_list[lineno - 3]
            artist = title
            if '/' in title:
                artist = title.split(' / ')[0]
                title = title.split(' / ')[1]
            if artist not in cd_dict:
                cd_dict[artist] = {}
            cd_dict[artist][title] = big_list[lineno:lineno+int(line)]
        lineno += 1
    processed = 0    for artist, album in cd_dict.items():
        print("processing {} of {}: {} .".format(processed, len(cd_dict.keys()), artist))
        for title, tracks in album.items():
            print("processing album {}".format(title))
            trackcounter = 0            for track in tracks:
                for f in list(Path("/path/to/brennan/exported/mp3/directory/").rglob("{}.mp3".format(track))):
                    if artist in str(f) and title in str(f):
                        trackcounter += 1                        mp3file = eyed3.load(f)
                        mp3file.initTag()
                        mp3file.tag.artist = artist
                        mp3file.tag.album = title
                        mp3file.tag.title = track
                        mp3file.tag.track_num = trackcounter
                        mp3file.tag.save()
        processed += 1    print("Done" )

Tuesday, October 23, 2018

pycharm debug detecting

I use pycharm. I have a program that works through tasks in parallel. When I'm debugging, however, I want to work though tasks in series. So I have this check to know if I'm running in debug:

    IS_DEBUG = True if __loader__.path.endswith('pydev/pydevd.py') else False

or, you can just use:

 __debug__