Monday, April 17, 2017

Starting slackware 14.2 in a virtual machine.

Started with Slackware linux and decided to go back and look at it.  In this case, I plan to use qemu to build a virtual machine. You will need to have a stable internet access for this project. You also need to have a fast machine with over a gig of memory.  You will not need to download and burn a cd or dvd.  You will need a floppy, usb, cd, or a network interface card that supports gpxe (ipxe).

You will want to go to romomatic,net to build your image to put on your boot device. Though with Qemu you can just use the image without creating boot media,  Though I do recommend using 256 megabytes of ram. Be sure to set up the virtual drive for your install.

Once you have everything the way you want then you can launch the install.

Eventually you will get to a login and the you can start the the good old install;

AAh, at home again.

Slackware pxeboot script:

dhcp any
chain load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nomodeset SLACK_KERNEL=huge.s


Normally I am not fond of canned software, but this one might be an exception. Motioneyeos is a raspberry pi implementation for the program Motion. Motion is software to control video capture devices. All control is done via the web. For purposes of this project we used an original raspberry pi. ( There are several releases depending on the unit you have.

First I tried a logitech usb camera clone. The system recognized it immediately. Not like a certain other operating system where you have to load the drivers for almost everything.

Then we added an ipcamera (network ready). After adding the network camera file, it worked just like you would expect. The documentation for the camera did not have the description of the file. Fortunately the Motion software site did have that information.  ( Again no additional drivers were required.

Actual picture is much clearer. For a novice user it is pretty simple. Only exception is shutting the unit down, I did not see a visible icon. Also security could be greater, but for the price of free you can not beat it.

installing motion from scratch:

Let's get your system up to date (might take a while if you have not updated very recently).

$ sudo apt-get update ; sudo apt-get upgrade
$ sudo apt-get dist-upgrade

Now let's install Motion

$ sudo apt-get install motion.

Does the RPi see your camera?  (aka list usb devices attached.)

$ lsusb

Bus 001 Device 004: ID 046d:08a9 Logitech, Inc. Notebook Deluxe

if not, you may need to get a more mainstream camera. usually Logitech sets the standard. I just used a cheap refurbished knickoff. Your output will vary..

Do a little configuration:

$ sudo nano /etc/motion/motion.conf
In here there are a few basic changes that you need to perform:
  • Daemon = OFF to ON
  • webcam_localhost = ON to OFF
You can change other settings but it’s recommend you don’t take more than 2 frames, and you been the default frame pixel size, for stability.

To ensure that the motion service will actually start as a daemon we need to change another configuration setting, so enter the following:

sudo nano /etc/default/motion

Then change the value “start_motion_daemon=no” to “yes”

Let's get started:

Finally you can start the motion service to stream the web cam images

sudo service motion start
Then after about 30 seconds browse to the new web interface, which should be at the below URL (where is your Raspberry PI’s IP address yours may vary)

Hint: if you do not have direct access to your RPi, you can use to find it on the network. Frequently I will hook up the RPi to the network without a keyboard, mouse, or monitor and then remote into the unit,


Note if you want to use an ipcamera it is easy but you have to know about the camera. I ended up going to the zoneminder wiki and found the answer for my camera. Setup is the same, but you have to add two lines to motion.conf.

 netcam_userpass user:password

For us  it was:

 netcam_userpass user:password

I have ZM installed on my Media Server that runs multiple programs including Apache, email server, and Mysql with no issues. I don't know if the earlier stages of Zm was picky like that but its more friendly now neat! do this to my room!
Cool. I also thought of maybe using this for a pod casting setup also.
Awesome. I was easily able to set up a video surveillance system at home and at work.
There are also instructions for installing from source:

Sunday, April 9, 2017

Basic pi setup.


Basic setup


install jessie os
do updates
install vim mc


Check Ethernet & Wifi Before continuing make sure the Ethernet cable is connected in and you can ping out from the Pi:


You will also want to set up your WiFi dongle. run

sudo shutdown -h

now and then plug in the WiFi module when the Pi is off so you don't cause a power surge.

If you have a Pi 3, or any other Pi with built in WiFi, an external WiFi adapter is not required but you can use one if you need a bigger/external antenna.  When it comes back up check with ifconfig -a that you see wlan0 - the WiFi module.

Install software

Next up we install the software onto the Pi that will act as the 'hostap' (host access point). You need internet access for this step so make sure that Ethernet connection is up!

sudo apt-get update
sudo apt-get install hostapd isc-dhcp-server

(You may need to sudo apt-get update if the Pi can't seem to get to the apt-get

repositories) (text above shows udhcpd but that doesnt work as well as isc-dhcp-server, still, the output should look similar) Also install a nice iptables manager with

sudo apt-get install iptables-persistent

You'll get two 'config' screens, say Yes to both

Set up DHCP server

Next we will edit /etc/dhcp/dhcpd.conf, a file that sets up our DHCP server - this allows wifi connections to automatically get IP addresses, DNS, etc. Run this command to edit the file

sudo nano /etc/dhcp/dhcpd.conf

Find the lines that say

option domain-name "";
option domain-name-servers,;

and change them to add a # in the beginning so they say

#option domain-name "";
#option domain-name-servers,;

Find the lines that say

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.

and remove the # so it says

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.

Then scroll down to the bottom and add the following lines

subnet netmask {
option broadcast-address;
option routers;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers,;

Save the file by typing in Control-X then Y then return  Run

sudo nano /etc/default/isc-dhcp-server

and scroll down to


and update it to say


Or whatever the name of your wifi adapter is! close and save the file  Set up wlan0 for static IP If you happen to have wlan0 active because you set it up,  run

sudo ifdown wlan0

There's no harm in running it if you're not sure Next we will set up the wlan0 connection to be static and incoming. Run

sudo nano /etc/network/interfaces to edit the file

Find the line auto wlan0 and add a # in front of the line, and in front of every line afterwards. If you don't have that line, just make sure it looks like the screenshot below in the end! Basically just remove any old wlan0 configuration settings, we'll be changing them up Depending on your existing setup/distribution there might be more or less text and it may vary a little bit  Add the lines

iface wlan0 inet static

After allow-hotplug wlan0 - see below for an example of what it should look like. Any

other lines afterwards should have a # in front to disable them Save the file (Control-X Y ) Assign a static IP address to the wifi adapter by running

sudo ifconfig wlan0

Configure Access Point

Now we can configure the access point details. We will set up a password-protected

network so only people with the password can connect. Create a new file by running

sudo nano /etc/hostapd/hostapd.conf

Paste the following in, you can change the text afterssid= to another name, that will be the network broadcast name. The password can be changed with the text after


















If you are not using the Adafruit wifi adapters, you may have to change the

driver=rtl871xdrv to say driver=nl80211 or something If you are using the Raspberry Pi 3's internal WiFi adapter, comment out thedriver=rtl871xdrv

 line altogether: Save as usual. Make sure each line has no extra spaces or tabs at the end or beginning - this file is pretty picky!  Now we will tell the Pi where to find this configuration file. Run

sudo nano /etc/default/hostapd

Find the line #DAEMON_CONF="" and edit it so it says


Don't forget to remove the # in front to activate it!

Then save the file

Likewise, run

sudo nano /etc/init.d/hostapd

and find the line


and change it to


Configure Network Address Translation Setting up NAT will allow multiple clients to connect to the WiFi and have all the data 'tunneled' through the single Ethernet IP. (But you should do it even if only one client is going to connect) Run

sudo nano /etc/sysctl.conf

Scroll to the bottom and add


on a new line. Save the file. This will start IP forwarding on boot up Also run

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward "

to activate it immediately  Run the following commands to create the network translation between the ethernet port  eth0 and the wifi port wlan0

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT

sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

You can check to see whats in the tables with

sudo iptables -t nat -S

sudo iptables -S

To make this happen on reboot (so you don't have to type it every time) run

sudo sh -c "iptables-save > /etc/iptables/rules.v4"

The iptables-persistent tool you installed at the beginning will automagically reload the configuration on boot for you. update hostapd (maybe) If you are running Raspberry pi kernel 4.4.13-v7+ or greater (check your kernel version with uname -a), you do not need to do this step. if you are using the Raspberry Pi 3 built-in WiFi or are not using RTL8192-like WiFiadapter, then skip this step! before we can run the access point software, we have to update it to a version that supports the WiFi adapter. First get the new version by typing in


Then install it.

Apache2 web server and php:

sudo apt-get install apache2 -y

sudo apt-get install php5 libapache2-mod-php5 -y


Install MariaDB on Raspbian

With the new version of Raspbian, MariaDB is now present in the official repositories, which until now was not the case! To install it, nothing more simple therefore, you just need to run the following command:

sudo apt-get install mariadb-server

If you already have MySQL installed, it is likely that the package manager notifies you of a conflict and asks if it needs to uninstall MySQL. In this case, answer yes. During the installation, MariaDB will configure itself. It’s up to you to provide the administrator account for the database.  This done, it should ask you if you are sure to want to go under MariaDB. Again, answer yes. Once the installation is complete, you will be able to access MariaDB as you did with MySQL, simply with the following command:

mysql -u user -p

Setup gui

sudo apt-get install xinit

sudo apt-get install lxde-core lxterminal lxappearance

sudo apt-get install lightdm

sudo reboot

Web database admin

sudo apt-get install phpmyadmin

Add your own passwords

Remote desktop

sudo apt-get install xrdp


Make sure system sees the bluetooth device


upgrade the system software:

    sudo apt-get update
    sudo apt-get upgrade

Install the bluetooth software:

sudo apt-get install bluetooth blueman bluez python-gobject python-gobject-2

Open a Terminal window and edit the /etc/rc.local file with:

    sudo nano /etc/rc.local

And add the following to the end of the file, just before the exit 0 line:

    sudo hidd -i hci0 --connect 00:07:61:B4:7E:81

replacing the MAC address with the MAC address of your keyboard or computer.