This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to change the passed in variable | |
testFn0 = obj => { obj = {}; } | |
// Function to change level one variable | |
testFn1 = obj => { obj.b = 999; } | |
// Function to change level two variable | |
testFn2 = obj => { obj.b.b = 999; } | |
// Directly changing the passed in variable should not affect it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d \ | |
-p 8080:80 \ | |
-e REGISTRY_HOST=$REGISTRY_HOST_IP \ | |
-e REGISTRY_PORT=$REGISTRY_PORT \ | |
-e REGISTRY_PROTOCOL=http \ | |
-e SSL_VERIFY=false \ | |
-e REGISTRY_ALLOW_DELETE=true \ | |
parabuzzle/craneoperator:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/regolith-linux/regolith-desktop/issues/32 | |
echo "deb http://ppa.launchpad.net/regolith-linux/release/ubuntu bionic main" > /etc/apt/sources.list.d/regolith.list | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EFC31B0AE9F1000B38E37FC8C0930F305A0E0FEF | |
apt update | |
apt install devscripts build-essential cdbs libxcb1-dev gperf pkg-config xutils-dev | |
# create setup folder | |
mkdir rego-setup && cd rego-setup/ | |
wget http://archive.ubuntu.com/ubuntu/pool/main/x/xcb-util/xcb-util_0.4.0.orig.tar.gz | |
wget http://archive.ubuntu.com/ubuntu/pool/main/x/xcb-util/xcb-util_0.4.0-0ubuntu3.debian.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
yum update -y | |
yum install httpd -y | |
service httpd start | |
chkconfig httpd on | |
echo "<html><head><title>Ian's Web Server</title></head><body><h1>Ian's Web Server</h1></body></html>" > /var/www/html/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Export image as tar file .............. docker save -o <tar file> <docker image> | |
Import image from tar file ............ docker load --input <tar file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See all remotes ....................... git remote -v | |
Fetch a specific remote ............... git fetch <remote name> | |
Compare remote with local files ....... git diff --name-only remotes/<remote name>/master | |
Compare remote with main repo ......... git diff --name-only master remotes/<remote name>/master | |
Squash commits ........................ git rebase -i <after this commit> | |
Squash commits into initial commit .... git rebase -i --root | |
Force submit after squashes ........... git push origin +master | |
Replace "pick" with "reword" to change the commit message | |
Replace "pick" with "squash" to combine a commit with the last "pick" commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install dependencies ... | |
sudo apt-get install hfsplus hfsutils hfsprogs gdisk | |
To mount, add "-t hfsplus" to the mount command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find USB device ... | |
$ ls -l /dev/disk/by-uuid/ | |
total 0 | |
lrwxrwxrwx 1 root root 10 Feb 9 01:26 093F-C00F -> ../../sda1 | |
lrwxrwxrwx 1 root root 15 Feb 9 01:26 2ab3f8e1-7dc6-43f5-b0db-dd8364731d4e -> ../../mmcblk0p2 | |
lrwxrwxrwx 1 root root 15 Feb 9 01:26 5203-D7B4 -> ../../mmcblk0p1 | |
The one we are looking for is "/sda" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl | |
curl -sSL https://get.docker.com | sh | |
sudo usermod -aG docker $USER | |
# Reboot | |
docker run hello-world | |
sudo apt-get install libffi-dev libssl-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user="whoever" | |
adduser $user | |
for group in $(groups pi | cut -d':' -f2 ) ; do | |
if [[ "$group" != "pi" ]] ; then | |
adduser $user $group | |
fi | |
done |
NewerOlder