Tagged: tutorial

Hakology – Zeya linux installation (HTML5 streaming music)

*repost for archiving purposes*

# Notes:
# Requirements
# Python 2.5+ (2.6+ recommended) tested on 2.7 (worked fine)
# python-tagpy (critical : boost lib)
# python-simplejson (critical : boost lib)
# oggenc (critical : ogg encoder for streaming)
# mpg123 (optional : for decoding MP3 files) (you will want this)
# flac (optional : for decoding FLAC files) (you might want this)

echo "Hakology - Zeya installation script for linux."
echo "Zeya is a client for streaming audio from a central servernto any device that supports html5"
echo "Zeya - web.psung.name/zeya/"
echo "Hakology - youtube.com/hakology"
echo "Visit the youtube channel for more coolness"

cd ~
sudo apt-get install python git mpg123 flac python-tagpy vorbis-tools faad python-simplejson
sudo git clone http://web.psung.name/git/zeya.git

echo "############################################"
echo "Installation complete"
echo "############################################"
echo "To run :";
echo "./zeya.py --path=/path/to/music";
echo "To add to crontab (crontab -e) add the following to start on reboot";
echo "@reboot /full/path/to/zeya.py --path=/path/to/music";
echo "You should add a htaccess file to use this on the web";
echo "./zeya.py --basic_auth_file=/path/to/.htpasswd --path=/to/your/music/";
echo "You can also run on a different port";
echo "./zeya.py --port=9000";
exit

Pfsense behind a router

Ok so here’s my setup:
192.168.1.1 - current adsl / cable router
255.255.255.0 - router subnet

1. Install pfsense

2. Assign interfaces
1 for lan
1 for wan

Plug the WAN port into you ADSL / cable router
Plug the LAN port into eg. an un-managed switch.

3. Assign IPs
LAN IP - 192.168.2.1
Subnet - 255.255.255.0/24
Gateway - 192.168.2.1
Enable DHCP
IPRange - 192.168.2.50 to 192.168.2.100

WAN IP - 192.168.1.10 (static)
subnet 255.255.255.0/24
Gateway - 192.168.1.1

4. Configure web front end
Go to 192.168.2.1 (pfsense box) in your browser
Login using : admin pfsense
DNS1 : 8.8.8.8
DNS1 : 8.8.4.4
Allow router to override DNS
Allow 192/172/10 addresses (b/c pfsense is running on your lan)
(Click next, next, next)
Set the web gui password

5. Configure your router (cable/adsl modem)

Set a rule to route:
192.168.2.0 255.255.255.0 192.168.1.10

Go to the routers firewall rules and add this …
Ports : 1-65534
Protocol : ALL
Destination : 192.168.1.10

Or alternatively add the server to your DMZ

6. Load up your web browser and check you can get google.com

7. Enjoy … take a break and come back and install some ubercool packages.

Trouble shooting:
Can pfsense ping router – NO WAN config error
Can pfsense ping pfsense client – NO – LAN config error / Client firewall
Can pfsense client ping pfsense – NO – LAN config error / Client firewall
Can pfsense ping 8.8.8.8 – NO – ASDL/CABLE router config error
Can pfsense client ping router – NO – NAT error
Can pfsense client ping 8.8.8.8 – NO – NAT error / ADSL / CABLE config error
Can pfsense client ping 8.8.8.8 – YES – All good
Can pfsense client load a website – NO – DNS Error – Check everything above is OK
Can pfsense client load a website – YES – Everything is working

If you are having issue make sure you disable any firewalls you have running on the pfsense client boxes … once you have your network configured you can enable them later.

ENSURE YOUR FIREWALL RULES ARE CORRECT BEFORE CONTINUING TO SETUP THE REST OF THE NETWORK

Connecting to a serial device over usb in debian / linux

First of all you’ll need a USB to serial cable, mine came with a driver disk but I didn’t use it. I’m running debian jessie and it detected it without any issues. If you want to check to see the device is working and detected just run lsusb and look for your device in the list.

Look for something like this
Bus 003 Device 003: ID 063b:2837 Prolific Technology, Inc. PL2303 Serial Port

Next check the device is accessible run the following:
sudo ls /dev | grep USB

Look for something like this …
/dev/ttyUSB0

Next check you have screen installed by running
sudo apt-get install screen

Connect to the device over serial using :
sudo screen /dev/ttyUSB0

You should now be connected to your device.
This is what I used to configure a HP2626 Pro-Curve switch over serial.
When I first connected I had to hit enter a few times to establish a connection / shell.
Have fun hacking
Peace
Tea