Skip to content

Instantly share code, notes, and snippets.

View philipmather's full-sized avatar

Philip Mather philipmather

View GitHub Profile
@philipmather
philipmather / RHEL8-boot-rpi3.md
Last active January 1, 2021 23:09
RHEL 8 Boot server rpi3

https://serverfault.com/questions/17255/top-level-domain-domain-suffix-for-private-network https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_networking/index

nmcli connection add con-name test-philipmather-com ifname eno1 type ethernet
# Connection 'test-philipmather-com' (73e6ce1d-3e1b-4fc2-8d84-2192b8a84824) successfully added.
nmcli connection modify test-philipmather-com ipv4.addresses 192.168.1.0/24
nmcli connection modify test-philipmather-com ipv4.method manual
#nmcli connection modify test-philipmather-com ipv4.gateway 192.168.1.254
nmcli connection modify test-philipmather-com ipv4.dns "192.168.1.254"
@philipmather
philipmather / Space saving
Last active June 3, 2020 22:41
Raspberry pi optimizations
# Expand FS
$ sudo raspi-config
$ sudo reboot
# From there, delete both Wolfram Engine and LibreOffice to reclaim ~1GB of space on your Raspberry Pi:
$ sudo apt-get purge wolfram-engine libreoffice*
pi@raspberrypi:~/Projects/binocular-pi $ python
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.2.0'
# https://www.raspberrypi.org/forums/viewtopic.php?t=57552
sudo su -
echo "@xset s noblank
@xset s off
@xset -dpms" >> /etc/xdg/lxsession/LXDE-pi/autostart
pi@raspberrypi:~ $ apt-get install conky
pi@raspberrypi:~ $ cp /etc/conky/conky.conf /etc/conky/conky.conf.orig
pi@raspberrypi:~ $ vi /etc/conky/conky.conf
conky
@philipmather
philipmather / gist:fc4f9f6a8dca59d40220ac56a2aca392
Last active May 10, 2020 15:50
simulate keyboard & mouse events via SSH
As per https://theembeddedlab.com/tutorials/simulate-keyboard-mouse-events-xdotool-raspberry-pi/
Related https://www.raspberrypi.org/forums/viewtopic.php?t=130669
```
(venv) pi@raspberrypi:~/Projects/binocular-pi $ sudo apt-get install xdotool
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libxdo3
The following NEW packages will be installed:
@philipmather
philipmather / Jupyter-Notebook-on-GCP.md
Last active February 8, 2019 19:36
Jupyter Notebook on GCP

Throw up a jupyter notebook

gcloud projects create gcp-build-env-`date +%y%m%d%H%m` --name="GCP Build Environment" --set-as-default

Assuming you have one billing account

gcloud beta billing projects link ${DEVSHELL_PROJECT_ID} --billing-account `gcloud beta billing accounts list | grep -C 1 -o -e '^[0-9A-Z]\{6\}-[0-9A-Z]\{6\}-[0-9A-Z]\{6\}' | head -n1` >> /dev/null

gcloud services enable sourcerepo.googleapis.com

Install

ISO

Download and burn rhel-8.0-beta-1-x86_64-dv.iso

$ #sudo dd if=/home/matherp@corp.ppbplc.com/Downloads/rhel-8.0-beta-1-x86_64-dvd.iso of=/dev/sd#REPLACE-ME# bs=1MB

Tick "Workstation" for installation type. Don't create a user, enable NTP, set root password.

Install Openconnect VPN

@philipmather
philipmather / .bashrc_ext
Created November 8, 2018 14:59
Bash Alias
alias deblank="sed '/^$/d' "