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/bash | |
BASE_GIT_DIR="$HOME/git" | |
GIT_REPO=$1 | |
GIT_DIR=$(echo ${GIT_REPO} | awk -F":" -v BASE_GIT_DIR="$BASE_GIT_DIR" '{print BASE_GIT_DIR"/"$2}' | xargs dirname) | |
mkdir -p ${GIT_DIR} | |
if [ $? == 0 ]; then | |
echo "Using folder ${GIT_DIR}" | |
git -C ${GIT_DIR} clone --recurse-submodules ${GIT_REPO} | |
fi |
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
# Example docker env file for OWS instance with (a single file) configuration. | |
# Set some default vars, you can overwrite these by creating env vars | |
AWS_NO_SIGN_REQUEST=true | |
AWS_DEFAULT_REGION=us-west-2 | |
AWS_REGION=us-west-2 | |
DB_HOSTNAME=postgres | |
DB_PORT=5432 | |
DB_USERNAME=opendatacubeusername | |
DB_PASSWORD=opendatacubepassword | |
DB_DATABASE=opendatacube |
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 build -t myapp:latest myapp/ | |
docker save --output myapp_latest.tar myapp:latest | |
sudo k3s ctr images import myapp_latest.tar |
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
FROM almalinux:8 | |
ARG SSH_PRIVATE_KEY | |
RUN mkdir ~/.ssh/ | |
RUN echo "${SSH_PRIVATE_KEY}" > ~/.ssh/authorized_keys | |
RUN chmod 400 ~/.ssh/authorized_keys | |
RUN yum -y install openssh-server openssh-clients iproute python39; | |
RUN /usr/bin/ssh-keygen -A | |
RUN chpasswd <<<"root:root" | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd","-D"] |
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
args = "-c" & " -l " & """cd ;export DISPLAY=127.0.0.1:0.0 ;terminator""" | |
WScript.CreateObject("Shell.Application").ShellExecute "bash", args, "~", "open", 0 |
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
from gps3 import agps3 | |
import time | |
import dateutil.parser as dp | |
import requests | |
#host = '192.168.1.15' | |
host = '127.0.0.1' | |
s = 30 | |
traccar_server = "https://XXXXXXX/traccar/" | |
traccar_id_device = 11111 |
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
#name and ip | |
docker inspect CONTAINTERID | jq '{Name:.[].Name,ip:.[].NetworkSettings.Networks[].IPAddress}' |
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
[vagrant@localhost ~]$ FILE="/this/is/the/file.ext" | |
# dirname | |
[vagrant@localhost ~]$ echo "${FILE%/*}" | |
/this/is/the | |
#basename | |
echo "${FILE##*/}" | |
file.ext | |
# Full path whitout extension | |
[vagrant@localhost ~]$ echo "${FILE%.*}" | |
/this/is/the/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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import serial, time, struct | |
ser = serial.Serial() | |
ser.port = "/dev/ttyUSB0" # Set this to your serial port | |
ser.baudrate = 9600 | |
ser.open() |
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
<div id="clock"></div> | |
<div id="utc"></div> | |
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"> |
NewerOlder