This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -e | |
| # Detect platform and architecture | |
| OS="$(uname -s | tr '[:upper:]' '[:lower:]')" | |
| ARCH="$(uname -m)" | |
| case "$OS" in | |
| linux) | |
| PLATFORM="linux" ; |
This file contains hidden or 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/bash | |
| echo "--- System Information ---" | |
| echo "Make: $(sudo dmidecode -s system-manufacturer)" | |
| echo "Model: $(sudo dmidecode -s system-product-name)" | |
| echo "" | |
| echo "--- Processor Information ---" | |
| echo "Processor: $(cat /proc/cpuinfo | grep 'model name' | head -n 1 | awk -F': ' '{print $2}')" | |
| echo "Cores: $(nproc --all)" |
This file contains hidden or 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
| sudo apt update && sudo apt install -y openssh-server | |
| sudo systemctl enable ssd | |
| sudo systemctl restart sshd | |
| sudo systemctl status sshd | |
| ssh-import-id prakritish |
This file contains hidden or 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/bash -e | |
| function get_latest_release() { | |
| version=$(curl --silent "https://api.github.com/repos/$1/releases/latest" | jq -r .tag_name) | |
| echo "$version" | |
| } | |
| sudo apt update && sudo apt install -y curl wget jq | |
| mediamtx_version=$(get_latest_release "bluenviron/mediamtx") |
This file contains hidden or 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
| Example of /opt/frp/frpc.toml | |
| ----------------------------- | |
| serverAddr = "135.93.191.107" | |
| serverPort = 7000 | |
| [[proxies]] | |
| name = "hak-pi01" | |
| type = "tcp" | |
| localIP = "127.0.0.1" | |
| localPort = 22 |
This file contains hidden or 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
| --- | |
| - name: Create private key (RSA, 4096 bits) | |
| community.crypto.openssl_privatekey: | |
| path: "{{ ssl_privkey }}" | |
| passphrase: "{{ ssl_privkey_pass }}" | |
| cipher: auto | |
| - name: Create certificate signing request (CSR) for self-signed certificate | |
| community.crypto.openssl_csr_pipe: | |
| privatekey_path: "{{ ssl_privkey }}" |
This file contains hidden or 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
| --- | |
| - name: Install Nginx | |
| ansible.builtin.apt: | |
| name: nginx | |
| state: present | |
| autoclean: true | |
| autoremove: true | |
| clean: true | |
| update_cache: true | |
| tags: |
This file contains hidden or 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
| pi4 ansible_host=pi4.seneshore.com ansible_ssh_host=192.168.1.15 ansible_ssh_user=ubuntu |
This file contains hidden or 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
| --- | |
| raspberry: | |
| hosts: | |
| pi4: | |
| ansible_host: pi4.seneshore.com | |
| ansible_ssh_host: 192.168.1.15 | |
| ansible_ssh_user: ubuntu |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| import logging, sys | |
| logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) | |
| from collections import namedtuple | |
| from ansible.parsing.dataloader import DataLoader | |
| from ansible.vars import VariableManager | |
| from ansible.inventory import Inventory | |
| from ansible.playbook.play import Play |