Raspbian on RPi3 for NAS

Note: I have swapped the RPi3 for a RPi2 due to Ubuntu compatibility. Even the supported RPi2 with Ubuntu is proving problematic, I want to move to something more reliable.

20161025_134850
Using a Western Digital PiDrive Cable to power the setup.
  • Raspbian comes with default user:pass = pi:raspbian so this needs to be changed
  • I confirmed SSH was installed and working.
  • Following these instructions;
    • I installed ufw
      sudo apt-get install ufw
      sudo ufw allow ssh
      etc..
    • I confirmed NTP configuration.
  • Installed autoupdates, similar to this with different config.
  • Installed postfix, kind of like this.
  • the rest of the steps are basically the same that I used for Ubuntu – except that there isn’t a proper Ubuntu release for RPI3 yet.

rsync on a GoFlex Home NAS

So the GoFlex home UI is pretty crap, it sure as hell doesn’t have a rsync deamon. Until now. This summer…. etc

So I want to send Synology backups to the old GoFlex NAS.

Here’s how I did it:

Take Drive plastic off, replace 2TB drive with 3TB drive.

Reformat. (and gain SSH root).

Install  and config rsync .
      • Install package manager.
      • Add rsync:
        sudo ipkg install rsync
      • Config rsync daemon. In mine I set the path to a symlink for a users private shared folder, and added settings for that user.
        I started the daemon with
        sudo /opt/etc/init.d/S57rsyncd start
        and played with this until it was reachable from my Synology (some celebrations may have been had)
      • I made a symlink for the rsync opt init script in the system init folder:
        sudo ln -s /home/opt/etc/init.d/S57rsyncd /etc/rc.d/init.d/rsyncd
      • Then symlinked that with a startup link in runlevel 3.
        sudo ln -s /etc/rc.d/init.d/rsyncd /etc/rc.d/rc3.d/S57rsyncd
    • Holy Macrol, it appears to work!

 

RPi GPIO: Adding switches and lights

Goal:

Create a pair of LED’s and push buttons on my RPi which can run scripts. ?One will shut down the Pi (updated here), the other will rsync a directory to a USB. Also I will read the status of a UPS. This may/will become more complicated since the UPS doesn’t have any useful interface (requiring an Arduino to:

  • Watch the UPS battery voltage and tell the RPi to power down.
  • Monitor whether mains power is applied.
  • Once mains is re-powered, restart the RPi after a UPS shut down using the hardware reset pins on the Pi.)
Instructions:
  1. As in these RPi ubuntu instructions I installed python.. I removed sudo from the last command to make the command output happy
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip
pip install RPi.GPIO
  1. Initially I set up a breadboard as in this youtube video (using the linked files)
    from time import sleep
    import RPi.GPIO as GPIO
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(12, GPIO.OUT)
    while 1:
     GPIO.output(12, False)
     sleep(1)
     GPIO.output(12, True)
     sleep(1)

    Continue reading “RPi GPIO: Adding switches and lights”

Rooting my Galaxy S4 GT-i9505 running Lollipop

This process has so far hit a few hurdles – initially I tried to use the CyanogenMod instructions although these just lead me to a bunch of problems… (not updated for lollipop ((also this wouldn’t have necessarily rooted the phone)) etc), but it looks like I’ve got it successfully working. Here’s how:

  1. I used the latest ‘Odin’ which can set the device to load a recovery file.
  2. I moved the stable .zip release of SuperSU from here onto the phones SD card.
  3. Shut down the Galaxy, then boot to ‘download’ mode by holding the volume down + home key+ power key at the same time.
  4. I loaded philz touch recovery GT-I9505, from these instructions. I should really spin up a VM if I’m going to download random software from… dropbox :/
    • basically once the phone is connected to odin in download mode, click the AP button and select the philz touch file – probably should have found a better source for this file :/ . Also under options auto reboot was selected. This just means as soon as the file is loaded it will reboot. At this time you need to hold volume up+ home key+ power key at the same time to boot into the philz touch recovery
    • I accidentally read method 3 and applied step 7 from Method 3. Seems ok..
    • I loaded the SuperSU .zip from the SD card, noting that I downloaded SuperSU from here.. which doesn’t seem totally un-reputable
    • Rebooted the phone using the reboot option and installed SuperSU from google play (I also installed f.lux to help my sleeping pattern).

EDIT: looks like I broke wifi so I then installed cyanogen using the recovery boot with Odin (after a factory reset in recovery mode)
After Wifi broke I needed to perform a factory reset using recovery mode in order to get Cyanogen to work. Which I’m kinda stoked it did. Now I’m installing the google play store.

So that didn’t work.. Trying the latest cyogenmod (release version). Now for the corresponding Open Gapps.. keyboard doesn’t work (maybe could try a different Gapps version, or the latest nightly cyogen (more stable lol?))..
Now for Google Play Edition 5.1 | Untouched.. wipe system in recovery mode, install from .zip on SD card.. again.. reboot system.. and… ooh new loading screen. take that Telstra.

So far so good, although I’m assuming the phone will want to restart every-time the sim card is disconnected, which is usually a couple times per day.. Something that cyogenmod would allow me to ignore. New Sim in the mail, so we’ll see. I won’t be installing another SIM reader any time soon.

Grass is always greener, I kinda want cyogenmod now :/ hmm we’ll see.

Installing Ubuntu on a RPi

  1. I will be using  Ubuntu 16.04 LTS ‘classic’.
    On the RPi site they mention Rpi pic
    the Snappy version of Ubuntu for IoT. This is not the one I want, as it doesn’t use the normal Ubuntu method for getting software (apt-get). The classic Ubuntu image is linked here. This image has SSH pre-installed, so you can boot without ever using a monitor.
    Writing the image to an SD card on Windows can be done with Win32 Disk Imager
    Continue reading “Installing Ubuntu on a RPi”

configure Ubuntu to send mail (as an SMTP client using postfix)

    1. We will start with a trusty DigitalOcean instructional – at least step 1 of that instructional.
      sudo apt-get install mailutils
    2. I want to send mail using mailgun, which allows for ports 25, 587 and 465 (SSL/TLS). I’ll use 587 which is called submission in postfix terminology, I guess due to 587 being the proper port for TLS email submission. Because I want to use encryption (SASL) (or whatever), I need to setup Postfix accordingly. I changed my Postfix config file as such
       ubuntu@machine_name:~$ sudo nano /etc/postfix/main.cf
      #various stuff above
      relayhost = [smtp.mailgun.org]:submission
      mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
      mailbox_size_limit = 20000000
      recipient_delimiter = +
      inet_interfaces = all
      inet_protocols = all
      smtp_sasl_auth_enable = yes
      smtp_tls_security_level = encrypt
      smtp_sasl_security_options=noanonymous
      smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

      Some of these settings are related to the DigitalOcean instructional, such as custom mailbox_size_limit. Make sure all the smtp settings are there

Continue reading “configure Ubuntu to send mail (as an SMTP client using postfix)”