Skip to content

Instantly share code, notes, and snippets.

View BillyNate's full-sized avatar

Nate BillyNate

  • The Netherlands
View GitHub Profile

Portable Headless Wi-Fi Raspberry Pi LAMP Web Server

Here's documented how a portable headless webserver could be made out of a Raspberry Pi. This guide has been made in case the setup needs to be redone, for whatever reason. It is written for Raspbian Jessie Lite, but should work for any Raspbian. Other ditros might need different commands and/or different file locations.

This guide describes how to set up a Raspberry Pi as a webserver (Apache with PHP and MariaDB/MySQL) which you can attach to any network without the need of a display (ever) nor a network cable. It also contains steps to set up a Samba share (to easily access the web server files from a work station), set up X11 (to get graphical interfaces on your workstation of applications running on the Pi) and make the Pi easily discoverable on the network by its hostname, including subdomains (to host multiple websites on the Pi).

The following hardware is assumed:

  1. Stage the files for commit (git add the files)
  2. Write the tree (this only creates a tree object, returning the SHA of the new tree): git write-tree
    • Optionally: examine the new tree: git ls-tree [SHA]
  3. Create the commit: git commit-tree [SHA] -p [PARENT-SHA] -m "Commit message" (add as many seperate -p [PARENT-SHA] as you want (makes it look like a merge))
    The SHA of the new commit will be given to you on succes
  4. Finally, merge the new commit into you branch git merge [NEW-SHA]
  1. Create a new gear on OpenShift
  2. Copy the GIT url of the gear
  3. Start up Orion and open up the Git tab
  4. Get yourself a SSH key from lagmonster.org/keygen.php
  5. Go to your OpenShift settings and add a new public key (name it Orion for example)
  6. At Orion add a new Git project using the url of your OpenShift gear and the private key

Installing Logitech Media Server on the Raspberry Pi

(The commands have been copied over from raspberry-at-home.com/logitech-media-server, and updated when necessary. Tested on Raspbian Jessie)

  1. sudo apt-get update && sudo apt-get dist-upgrade
  2. sudo apt-get install libsox-fmt-all libflac-dev libfaad2 libmad0
    wget http://downloads.slimdevices.com/nightly/7.9/sc/481dece/logitechmediaserver_7.9.0~1485931015_arm.deb
    sudo dpkg -i logitechmediaserver_7.9.0~1485931015_arm.deb
@BillyNate
BillyNate / Kodi (OSMC) on Raspberry Pi 2 with Squeezelite, TVHeadend and proper CEC-on-off.md
Last active June 21, 2019 03:14
Kodi (OSMC) on Raspberry Pi 2 with Squeezelite, TVHeadend and proper CEC-on-off

This is a description on how I got my Kodi (OSMC to be specific) set up on my Raspberry Pi. Documented here in case anything goes wrong and I got to do it all over again. Obviously this is not a headless installation, so a screen and a way to do some input it assumed 😉

Setup

  1. Get the latest RPi2 disk image from OSMC.tv, write the image to an (Micro)SD-card, put the card in the Pi and boot
  2. After the first boot it will ask to input the language, timezone, optionally a device name, SSH access (best to be turned on), network settings and what skin you like (I prefer to start with Classic). MySQL settings for the master profile can be set already as well
  3. Go to My OSMC -> Updates -> Manual controls, start a scan for updates and install if necessary
  4. Go to My OSMC -> Network to set a static ip if not done at first boot
  5. Go to System (settings) -> Live TV Settings -> Playback and disable Start playback minimised
@BillyNate
BillyNate / key-to-kodi.py
Created June 25, 2017 13:49
Send keystrokes to a remote Kodi eventserver
#!/usr/bin/env python
# This script takes keyboard input and uses it to send events to the Kodi eventserver,
# it can be installed on any small pc like a Pi.
# To use an ordinary remote one could a Flirc.
# (the eventserver will be started automaticly when Kodi starts)
# It is assumed the keyboard is at /dev/input/event0
# The IP address connected to need to be adjusted to your Kodi installation
# The XBMCClient class is used and can be found in the official Kodi repo
# To get the evdev library you'll need pip: apt-get install python-pip python dev
@BillyNate
BillyNate / GitExtensions file editor.md
Created January 14, 2019 18:24
Setting GitExtensions file editor as default editor without installing / overriding all other git configurations
  1. Download the portable version of GitExtensions
  2. Unpack the downloaded file to a sensible location (C:\Program Files (x86)\ for example)
  3. Apply configuration to git: git config --global core.editor "\"C:\path\to\GitExtensions.exe\" fileeditor"
@BillyNate
BillyNate / git-user-auto-check.md
Last active July 23, 2021 09:19
Per git repository name/email config
  1. Make sure your git-templates directory is correctly set: git config --global init.templatedir "~/.git-templates"
  2. Create a .git-templates directory in your user directory (C:\Users\username on Windows)
  3. Add a subdirectory hooks
  4. Download the pre-commit file to the created directory

On every git init and git commit the hooks will be copied over to the new repository.
Whenever a git commit is issued, the pre-commit hook will check if the user.name and user.email are set, if not, it will ask for input.

@BillyNate
BillyNate / Pi running Sonarr, Radarr and Lidarr on piCore.md
Last active September 20, 2020 09:26
Pi running Sonarr, Radarr & Lidarr in RAM (on piCore)

Pi running Sonarr, Radarr & Lidarr in RAM (on piCore)

These are the steps taken to have Sonarr, Radarr & Lidarr on piCore 9.0.3 running Mono 4.4.2
Newer version might work as well (or maybe even better), but have not been tested.

Set up piCore

  1. Download the piCore image
  2. Unpack the .zip file and write the .img file to the SD-Card (using USB Image Tool for example)
  3. Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
  4. SSH into the Pi (using Putty for example)