Friday, March 10, 2017

Converting youtube videos to mp3 in Plex Raspberry Pi

See title.That was the goal.

Solution? Youtube-dl. But, there was some fiddling to do. I used pip.

sudo apt-get install pip python-pip
sudo pip install -U pip setuptools ##just in case
sudo pip install --upgrade youtube-dl
sudo apt-get install avconv
sudo apt-get install libavcodec-extra-56 #or libavcodec-extra- - tab for it
sudo apt-get install libav-tools


Then you can use youtube-dl:

sudo youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=wyguBEc2dw4

As I mostly only stream music over the Pi, the new 128 GB USB key is ample space. It is mounted automatically at boot to /mnt/usb, so I change to that directory and download mp3 files directly to the proper folder and change the tags in Plex.

Wednesday, March 08, 2017

Weekly Post - New Raspberry Pi

Somehow it's been 10 days since the last post. I'll put it down to lots of work, and also to the fact that my next project is a bit bigger than a media server.

After consulting with colleagues, I will try to successfully install VMWare ESXi on my new laptop. There may be issues with removable devices getting recognized. However, the biggest roadblock I encountered was that small-capacity USB devices (e.g. 1 GB) can't be used to install ESXi, so I had to wait until a small 16-GB USB device would arrive (plus this one has FAT32 like all sub-32 GB devices so it can be used for random systems that can't handle exFAT for instance). I'll place ESXi on this one and go from there.

Along with the USB device above I got another USB device of 128 GB size for about $35, with a smaller form factor. This should be enough for all my music and whatever videos I'd like to be wifi-streamable. I will try to combine this Plex server with bluetooth functionality to try to stream it to a bluetooth speaker, but most likely a DLNA solution would be needed, plus a "remote control" by phone probably, so I might just hold off on this whole idea. Although perhaps I could stream from Plex over wifi on a phone then send that to a bluetooth speaker.....?

In other news, I've begun to make sauerkraut. The first batch was interesting. This next batch will take more time to get through:


Somehow I missed the recent release of the Raspberry Pi Zero with wifi. It's out of stock of course, but does give one an idea of how small can you make a usable pentesting platform. Could also be useful to make an even smaller Plex server. Or you could just get a Bash Bunny.

Below, the one reason why I keep several pots of Hippeastrum bulb with nothing but some leaves most of the year:


Tuesday, February 28, 2017

HTTPS Update (1)

Options Indexes FollowSymLinks if you want to have directory indexing working on a site where SSL has been enabled and you need a directory open.

Otherwise it redirects to a 403.

Upgraded wifi speeds are great

So I recently upgraded to 100+ MBit/s internet access, after navigating Comcast's purchasing process. However, not everything can support those sorts of speeds. So, I purchased an Intel PCI card that can handle gigabit speeds, for my old XPS-8300, and also a new wireless adapter (AC, dual-band). The PCI card has been a disappointment, not being able to pull down more than 20 Mbits/s, but the wifi has been much better, getting an average of 114 Mbit/s down and the same ~5 mbits/s up. It also has Bluetooth, which is fun to use for the first time ever.

Unfortunately, there have been strange issues with maintaining access to the network on the new cards. Sometimes connections get dropped on the 5 GHz network. For now, I'm attempting to alleviate that issue by restricting the 5GHz connection to 20 MHz spread instead of 40, which drops the speed to around 80 Mbits/s but also gives me channel 165 (center frequency 5825 MHz) all to myself to avoid interference from neighboring traffic.

The new Lenovo Thinkpad T460p laptop also has a persistent issue across several Linux kernels, in that the wireless chip is not supported by a recent kernel version (4.6 or 4.7), leading to the wifi just dropping out unexpectedly for a few moments, every six-seven minutes. That's unacceptable. There are some fixes, but they're not good enough, so I've been trying out different OSes, keeping in mind potentially putting VMWare Workstation on the final result. For now Fedora KDE is installed, but I may try debian as the fix to the iwlwifi driver there might work better.

Worst comes to worst, I'll try RHEL and put VMWare workstation on it for the VMs. I purchased the machine for pentesting in VMs, for general VM practice, and not much else, therefore it doesn't matter what runs underneath.

Thursday, February 23, 2017

Building a better home network

After long, stressful hours, I like to spend time imagining what a better home network would be like. The more I read about labs, and the more services I put on the network, and also after discovering the homelab subreddit, the more I understand that a better network is a must.

Currently, there is a consumer-grade EA7500 device performing four layers-worth of functions, connected to the modem. An 8-port switch is connected to it, and all the Raspberry Pis, of which there are now five, are plugged into that. One of the Raspberry Pis is a tor relay, separated with a DMZ setting on the EA7500 router device, attached to the switch as well. My workstation for personal and work computers uses wireless connection, because they are physically separate from the rest of the equipment.

I'd like to simultaneously expand the reach of network cabling (in an apartment), separate out the EA 7500 device's functions into a router, firewall, and two Wireless APs, and build a network capable of supporting everything plus a home lab area, all in one.

Goals:

  • 2 APs for best coverage
  • Network cabling attached to the walls to provide access to fun stuff (e.g. Raspberry Pis), workstation area (several computers), and home-lab area
  • Have enough capacity for expansion
  • Implement external and internal firewall solution because it's the sane way and because I'd be able to have a proper DMZ
  • Minimize collision and broadcast domains

Here's a preliminary drawing, open to suggestions:


Yes, I know, tall orders all around. Some more things:

  • Received my new laptop. It's a Thinkpad 460P, with an upgraded 500 GB SSD and upgraded 32 GB RAM. It will form the foundation of the lab, as I can add VMs there more easily.
  • This new laptop will also be a personal laptop, which means I may occasionally plug it into a different area (workstation section).
  • Everything after the second router (or firewall) would be separate VLANs for practice, and use iptables to manage everything.

I'd love to integrate Troy Hunt's fascinating journey with Ubiquiti, since an smooth-looking interface for all the data would be deeee-licious. If I'm already fiddling with everything else on a daily basis, working with OpenWRT or DDWRT is not interesting, plus I'd really love to see data flows across the network. (The five-port Edgerouter from Ubiquiti that I'd bought earlier has a similar beautiful interface.)

To practice wireless testing I'd most likely stand up an ad-hoc non-Internet-enabled wifi network with an old linksys router.