Skip to content

Instantly share code, notes, and snippets.

View popey's full-sized avatar
🏠
Working from home

Alan Pope popey

🏠
Working from home
View GitHub Profile
@popey
popey / setup_easy-openvpn_ubuntu-core.md
Last active March 24, 2021 11:40
Steps to setup easy-openvpn on Ubuntu Core

Steps to setup easy-openvpn on Ubuntu Core

This gist is to accompany a more wordy blog post which covers everything in much more detail. These are the easily copy/pastable steps.

For this you will need:-

  • Raspberry Pi 2 or 3, PSU, keyboard, LAN connection, HDMI cable and display
  • Laptop/desktop computer - mine is running Ubuntu 18.04 but anything with SSH will do
  • Micro SD card and adapter to attach to the computer
@popey
popey / snapcraft.yaml
Created February 6, 2019 21:56
gotop snapcraft.yaml used during Snapcraft Live stream on 6th Feb 2019
name: gotop
base: core18 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: gotop
description: |
A terminal based graphical activity monitor inspired by gtop and vtop
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
@popey
popey / Google Code-In 2018 Package Electron.md
Last active February 17, 2021 15:30
Package an Electron application as a snap

We have identified a number of electron-based desktop applications which already have builds for Linux, but are not yet easily available in Ubuntu. The goal of this task it to select one of those applications and update the build system to add snap support.

Preparation:

Many of these applications require a newer version of node/npm to build than is available in Ubuntu. We recommend using Ubuntu 16.04 machine, virtual machine or container. Please do not do this task on a 17.10 system, but use 16.04.

In that 16.04 system, install node/npm from upstream nodesource as detailed at https://github.com/nodesource/distributions#debinstall

You may also want to go through the electron guide, to ensure your system is configured correctly to build electron applications successfully. https://docs.snapcraft.io/build-snaps/electron

[2021-01-16 20:55:36] Processing tool list from AppID 891390
[2021-01-16 20:55:36] Registering tool steamlinuxruntime_soldier, AppID 1391110
[2021-01-16 20:55:36] Registering tool steamlinuxruntime, AppID 1070560
[2021-01-16 20:55:36] Registering tool proton_experimental, AppID 1493710
[2021-01-16 20:55:36] Registering tool proton_513, AppID 1420170
[2021-01-16 20:55:36] Registering tool proton_5, AppID 1245040
[2021-01-16 20:55:36] Registering tool proton_411, AppID 1113280
[2021-01-16 20:55:36] Registering tool proton_42, AppID 1054830
pressure-vessel-wrap[10412]: Original argv:
pressure-vessel-wrap[10412]: 0: '/home/alan/.steam/debian-installation/steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-wrap'
pressure-vessel-wrap[10412]: 1: '--env-if-host=PATH=/home/alan/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
pressure-vessel-wrap[10412]: 2: '--'
pressure-vessel-wrap[10412]: 3: 'steam-runtime-system-info'
pressure-vessel-wrap[10412]: 4: '--verbose'
pressure-vessel-wrap[10412]: Current working directory:
pressure-vessel-wrap[10412]: Physical: /home/alan/.steam/debian-installation/steamapps/common/SteamLinuxRuntime_soldier
pressure-vessel-wrap[10412]: Logical: /home/alan/.steam/debian-installation/steamapps/common/SteamLinuxRuntime_soldier
pressure-vessel-wrap[10412]: Environment variables:
alan@robot:~$ STEAM_LINUX_RUNTIME_LOG=1 steam
Running Steam on ubuntu 21.04 64-bit
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
Steam client's requirements are satisfied
/home/alan/.steam/debian-installation/ubuntu12_32/steam -nominidumps -nobreakpad
[2021-01-16 23:11:51] Startup - updater built Dec 20 2020 23:07:02
Installing breakpad exception handler for appid(steam)/version(1608507519)
[2021-01-16 23:11:51] Loading cached metrics from disk (/home/alan/.steam/debian-installation/package/steam_client_metrics.bin)
[2021-01-16 23:11:51] Using the following download hosts for Public, Realm steamglobal
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-8809G CPU @ 3.10GHz
CPU Family: 0x6
@popey
popey / move_dropbox.sh
Created December 13, 2018 11:24
Move Dropbox to a sparse file
# Location of the image which will contain the new ext4 partition
DROPBOXFILE="$HOME"/.dropbox.img
# Current location of my Dropbox folder
DROPBOXHOME="$HOME"/Dropbox
# Where we will copy the folder to. If you have little space, you could make this
# a folder on a USB drive
DROPBOXBACKUP="$HOME"/old_Dropbox
@popey
popey / test_snaps.sh
Last active October 7, 2020 08:37
Script to somewhat automate testing of snaps
#!/bin/bash
# Script to automate setup, install of snaps and running.
# Script will do the following:-
# - Make sure we're in an X11 session (wayland not supported)
# - Install snapd and scrot (for taking screenshots) using whatever package manager
# - Determine distribution being run on, for logging and screenshot naming
# - Double check snapd is installed and works, and switch to the beta channel
# - Install a configurable list of snaps
# - Take a reference screenshot (of the file manager) for theme comparison
# - Launch each snap in turn
@popey
popey / lddtostage
Last active October 31, 2019 23:58
Determine libraries needed by a binary and output in format for snapcraft.yaml
#!/bin/bash
TMPDIR=$(mktemp -d)
LDD=$TMPDIR/LDD
PACKAGES=$TMPDIR/PACKAGES
ldd $1 | awk -F ' ' '{print $3}' | sed '/^$/d' | sed '/^(/d' | grep -v '^not' > $LDD
while read p; do
echo -n .