GithubHelp home page GithubHelp logo

hunoz / sloop Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.08 MB

This repo uses pi-gen to create an image for a Raspberry Pi that is a ready-to-go development environment capable of usage with an iPad

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 0.71% Shell 98.91% sed 0.39%

sloop's Introduction

Description

Sloop is a Raspberry Pi image generator that uses pi-gen to create its images. Each image is set up with the following configuration:

  • Pyenv, SDKMan, GVM, and nvm are installed to manage environments for Python, Java, Golang, and Node, respectively.
  • root user is configured for SSH (User can be changed by specifying -u option)
  • ohmyzsh installed
  • Network configured via USB port for communication with an iPad for OTG development and USB tethering to a smartphone
  • Timezone set to UTC (Can be changed by specifying -t option)
  • Hostname configured to sloop (Can be changed by specifying -h option)
  • Default shell set to zsh
  • wlan0 configured to connect to certain networks (skipped if no stage2/04-dev-env-setup/files/wpa_supplicant-wlan0.conf file is present)
  • code-server configured as web IDE, running at http://127.0.0.1:49300 (can be changed by placing a code-server config at stage2/04-dev-env-setup/files/code-server.config)
  • Syncthing configured to serve code-server workspace (/workspace, can be changed by specifying -w option), accessible at http://127.0.0.1:8384

Usage

This package must be used in a debian environment (preferrably on a Raspberry Pi to ensure build consistency). To understand the available options, run ./build.sh -h to see the options. Either -p (publickey) or -s (password) must be specified. By default, password auth over SSH is disabled, specify the -o option to allow password auth for SSH.

All files in stage2/04-dev-env-setup/files are copied into /sloop in the image, so if you have any custom files that you need to reference in a config, such as SSL certificates for code-server, reference them in /sloop.

When using this image with an iPad, it will have the IP address 11.100.0.1 and the iPad will obtain an IP within the range of 11.100.0.2 - 11.100.0.6. These IP addresses were chosen as they are incredibly unlikely to conflict with any other used IP address ranges.

To use this image and connect to an iPhone via USB tethering, just connect it to a USB port and ensure your hotspot is on. eth1 will automatically pull an IP address via DHCP which will allow you network connectivity.

To use a custom configuration for code-server, you can copy your config file to stage2/04-dev-env-setup/files/code-server.config and it will be copied and use instead of the default config.

To configure the wlan0 connection, place a file in stage2/04-dev-env-setup/files with the name wpa_supplicant-wlan0.conf with a configuration that looks like the below example. As a note, if your SSID comes from an Apple device and contains an apostrophe, you will need to change the SSID in the example below to replace any apostrophes in the SSID with \xE2\x80\x99. Example is in the section below.

network={
  scan_ssid=1 # This tells it to scan for the network as it is not broadcast
  ssid="<SSID_HERE>" # Make sure that the SSID is in quotes unless you followed the aforementioned instructions due to there being illegal characters in your SSID
  psk="<PASSWORD_HERE" # The password to the network
  key_mgmt=WPA-PSK # Change to your needs
  priority=0 # Lower number means higher priority. You can specify the network block for each network you want, so use priority to prioritize their connectivity order
}

# iPhone network
network={
  scan_ssid=1
  ssid="hunoz\xE2\x80\x99s iPhone" # hunoz's iPhone
  psk="password"
  key_mgmt=WPA-PSK
  priority=1
}

Caveats

Programming Languages

Golang

  • When using Golang/GVM, you need to run gvm install <VERSION> -B so that it installs from the binary source
  • The image is pre-configured for this, but you must set GOHOSTARCH and GOARCH to arm to run and build for your local environment

To build the image, run ./build.sh -c <CONFIG_PATH> with the required arguments if you specified a config path. If you did not specify a config path, run ./build.sh with the required arguments. Once it is complete, it will output a file in deploy/ with a name similar to image_$(date +"%Y-%m-%d")-sloop-lite.zip which can be extracted to obtain the .img file which can then be flashed on an SD card using something like Raspberry Pi Imager

Roadmap

  • Have syncthing start as a service on boot (implemented, needs testing)

sloop's People

Contributors

xecdesign avatar hunoz avatar samtygier avatar hhromic avatar stefanb2 avatar rkubes avatar cfstras avatar davesteele avatar gromain avatar sam3d avatar bjsowa avatar lcvandinteren avatar knghtbrd avatar marcone avatar kralo avatar gszy avatar andig avatar tjstyle avatar matthijskooijman avatar louismt avatar jamesruan avatar jacen92 avatar dcwangmit01 avatar chrisdecker1201 avatar bjpirt avatar andrewmichaelsmith avatar ryanteck avatar rschulman avatar kormoc avatar rickdoesdev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.