11 Nov 2018
The goal is to create a simple solution to live stream a podcast.
This means I need a audio stream which combines the thing I hear and the
things I say.
To achieve this I mostly copied what makefu
does. The first step is to figure out what the name of your input and output device is.
You can find that with:
pacmd list-sources | grep -e device.string -e 'name:'
Which will provide you with output like this:
name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
device.string = "0"
name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
device.string = "front:0"
name: <alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1.monitor>
device.string = "1"
name: <alsa_output.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo.monitor>
device.string = "2"
name: <alsa_input.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo>
device.string = "front:2"
As we can see here my output device is: alsa_output.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo.monitor
and my input device is alsa_input.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo
.
Now my problem is that my input device is stereo but my microphone only records in mono. But this is
easy to fix, we can just remap our input to mono like this:
pactl load-module module-remap-source master=alsa_input.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo master_channel_map=front-left,front-right channels=2 channel_map=mono,mono
If we check the list of devices again we have a new input device called alsa_input.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo.remapped
. And this will be the input device we use.
Now we can just create a new stream and map input and output to it:
# create stream
pactl load-module module-null-sink sink_name=stream sink_properties=device.description="Streaming"
# map input and output
pactl load-module module-loopback source=alsa_output.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo.monitor sink=stream latency_msec=1
pactl load-module module-loopback source=alsa_input.usb-Focusrite_Scarlett_Solo_USB-00.analog-stereo.remapped sink=stream latency_msec=1
The only thing left is to have a darkice which is compiled with mp3 support and then you can stream
to any icecast server like this:
My config looks like this:
[general]
duration = 0
bufferSecs = 5
reconnect = yes
realtime = no
rtprio = 2
[input]
sampleRate = 44100
bitsPerSample = 16
channel = 2
device = pulseaudio
paSourceName = stream.monitor
[icecast2-0]
format=mp3
channel=2
bitrate=128
bitrateMode=cbr
quality=0.6
server=dns.name.or.ip.of.your.icecast.server
name=Testi test
description=Test test
public=yes
localDumpFile=dump.mp3
mountPoint=your_mountpoint.mp3
password=XXXXX
port=9000
And thats it, happy streaming!
27 Mar 2018
Monitore a HP 1810-24G Switch (J9450A) with telegraf, influxdb and grafana over snmp.
Sounds complicated and convoluted but it's not I swear.
Basically you need to do two things. (Well if you have a running telegraf, influxdb and grafana setup and your
HP switch has snmp enabled)
The plan was to use ifXTable
but for a reason unknown to me it didn't work. So here is the inputs.snmp
config I use:
[[inputs.snmp]]
agents = [ "SWITCH_IP:161" ]
community = "notpublic"
[[inputs.snmp.field]]
name = "hostname"
oid = "SNMPv2-MIB::sysName.0"
is_tag = true
# Port 01
[[inputs.snmp.field]]
name = "if_01_name"
oid = "IF-MIB::ifName.1"
[[inputs.snmp.field]]
name = "if_01_speed"
oid = "IF-MIB::ifSpeed.1"
[[inputs.snmp.field]]
name = "if_01_in_octets"
oid = "IF-MIB::ifInOctets.1"
[[inputs.snmp.field]]
name = "if_01_out_octets"
oid = "IF-MIB::ifOutOctets.1"
[[inputs.snmp.field]]
name = "if_01_in_error"
oid = "IF-MIB::ifInErrors.1"
[[inputs.snmp.field]]
name = "if_01_out_error"
oid = "IF-MIB::ifOutErrors.1"
....
# Port 24
[[inputs.snmp.field]]
name = "if_24_name"
oid = "IF-MIB::ifName.24"
[[inputs.snmp.field]]
name = "if_24_speed"
oid = "IF-MIB::ifSpeed.24"
[[inputs.snmp.field]]
name = "if_24_in_octets"
oid = "IF-MIB::ifInOctets.24"
[[inputs.snmp.field]]
name = "if_24_out_octets"
oid = "IF-MIB::ifOutOctets.24"
[[inputs.snmp.field]]
name = "if_24_in_error"
oid = "IF-MIB::ifInErrors.24"
[[inputs.snmp.field]]
name = "if_24_out_error"
oid = "IF-MIB::ifOutErrors.24"
The full config can be found here to copy & paste: fliiiix/2921c168182b27b27d8aca2bdb5f83b0
And then the second step is to create a the graph in grafana.

Note: it's times 8 because the value you get over snmp is octets. And don't forget to change the Unit to bits/sec on the Units tab.
If you are lazy and need all 24 ports on one dashboard here you can find my config. Don't forget to search and replace my hostname (atlas.l33t.network
) with your hostname.
18 Mar 2018
What is tautulli? From there site: "Tautulli is a 3rd party application that you can run alongside your Plex Media Server to monitor activity and track various statistics."
And if you where already a plexpy user, it's the same but better. And here is how you migrate
your existing plexpy installation to tautulli.
The first thing is to install it:
Note: I'm not sure if this port is already in the quarterly package repos since I build
my own packages.
Update the /etc/rc.conf
to (tautulli_user
is by default nobody):
tautulli_enable="YES"
tautulli_user="plex"
Stop plexpy and copy the config and database.
Make sure config.ini
and tautulli.db
are owned by the tautulli_user
you use!
service plexpy stop
cp /usr/local/plexpz/config.ini /var/db/tautulli/config.ini
cp /usr/local/plexpz/plexpy.db /var/db/tautulli/tautulli.db
And that's it you can start tautulli and enjoy the cool new interface.
28 Feb 2018
Apparently it is too hard to ship with a default configuration, that works well with HiDPI displays.
And my Dell XPS 13 has a HiDPI display. But fear not, it's not that hard to configure
when you know which files you should change. So here is what's working for me with i3
as window manager. (This should probably work for everything using XServer.)
The first file we need is ~/.Xresources
Xft.dpi: 192
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
I don't think all these options are needed, but as I said, works for me™️.
To finally get ~/.Xresources
loaded you need the ~/.xinitrc
file.
xrdb -merge ~/.Xresources
Btw: this is also part of my dotfiles.
04 Feb 2018
A long time ago in a galaxy far, far away I wrote my last blog post. Since then much has changed and is still the same.
But this blog post is about something which happened also a long time ago. I upgraded my Lenovo Yoga to a Dell XPS 13.
And this change meant that I stopped using the linux on my Lenovo Yoga. Which was very convenient at the time
because my dual boot stopped working. The reason for that was that my grub.cfg got corrupted and I was only able to boot windows.
Since the Dell XPS 13 picked up all my daily linux tasks, there was no need to do something about it.
But today this changes! I told my self, mostly because I plan to convert that thing to a windows only laptop.
Yeah I know windows buuuhh me.
Rebuild Grub
So here is how I rebuilt my grub config:
Step one download and create a live Fedora usb stick. Yes I still use and love Fedora deal with it :D
Boot it and open a console and find out who the boss is (hopefully you!).
Apparently I had a luks setup back in the days. So here is how to decrypt and mount it:
sudo cryptsetup luksOpen /dev/sda8 rootfs
sudo mount /dev/mapper/rootfs /mnt
mount: /mnt: unknown filesystem type 'swap'.
Well maybe it would help not to pick the swap partion, so close it fast before someone realizes sudo cryptsetup luksClose rootfs
. So here is what
happens when you actually select the right partition:
[liveuser@localhost ~]$ sudo cryptsetup luksOpen /dev/sda9 rootfs
Enter passphrase for /dev/sda9:
[liveuser@localhost ~]$ sudo mount /dev/mapper/rootfs /mnt
[liveuser@localhost ~]$ ls /mnt/
1 bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var
Almost done my /boot
and the efi
life on different partitions so I need to mount them as well:
mount /dev/sda7 /mnt/boot
mount /dev/sda2 /mnt/boot/efi
Some bind mount magic:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
chroot and build a new config
chroot /mnt
grub2-mkconfig --output=/boot/efi/EFI/fedora/grub.cfg
Reboot and hurray everything worked fine. It's just sad that I don't have anything on that laptop that I still need.
What a waste of time.