Source SSH from A through B to C, using private key on A
ssh -o ProxyCommand="ssh -i path_to_private_key -W %h:%p A" -i path_to_private_key B
#!/bin/bash | |
# Check if the script is run inside a git repository | |
if ! git rev-parse --is-inside-work-tree &>/dev/null; then | |
echo "Not inside a git repository. Exiting." | |
exit 1 | |
fi | |
# Check if there are modified files | |
if [ -z "$(git ls-files -m)" ]; then |
[Unit] | |
Description=Remote desktop service (VNC) for :0 display | |
Requires=display-manager.service | |
After=network-online.target | |
After=display-manager.service | |
[Service] | |
Type=simple | |
Environment=XAUTHORITY=/run/user/1000/gdm/Xauthority | |
Environment=HOME=/root |
Source SSH from A through B to C, using private key on A
ssh -o ProxyCommand="ssh -i path_to_private_key -W %h:%p A" -i path_to_private_key B
''' | |
Generated by ChatGPT using the prompt | |
fastapi crud using orm sqlalchemy | |
''' | |
from fastapi import FastAPI | |
from sqlalchemy import create_engine, Column, Integer, String | |
from sqlalchemy.orm import sessionmaker | |
app = FastAPI() | |
engine = create_engine("<database_url>") |
''' | |
Generated by ChatGPT using the prompt | |
fastapi crud mongo with logging to file | |
''' | |
from fastapi import FastAPI | |
from pymongo import MongoClient | |
import logging | |
app = FastAPI() |
#import config | |
openvpn3 config-import --config myvpnfile.ovpn | |
#show list of reusable configs | |
openvpn3 configs-list | |
#list active connection | |
openvpn3 sessions-list | |
#connect using config already imported |
[Unit] | |
Description=Remote desktop service (VNC) for :0 display | |
Requires=display-manager.service | |
After=network-online.target | |
After=display-manager.service | |
[Service] | |
Type=simple | |
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)" | |
Environment=HOME=/root |
import requests | |
import socket | |
URL='http://dynv6.com/api/update' | |
HOSTNAME='your_dynv6_hostname' | |
TOKEN='your_dyn_v6_token' | |
''' | |
You can use Task scheduler to run this on windows and cron on linux | |
''' |
#!/usr/bin/env bash | |
PHP_VERSION=7.4 | |
IONCUBE_VERSION=12.0.2 | |
TESTRAIL_DB_NAME=testrail | |
TESTRAIL_DB_USER=testrail | |
TESTRAIL_DB_PASSWORD=testrail | |
DEBIAN_FRONTEND=noninteractive | |
echo "Updating Software" |
''' | |
src: https://stackoverflow.com/a/46098711/2433866 | |
''' | |
import sys | |
import logging | |
import logging.handlers | |
logging.basicConfig( | |
level=logging.INFO, | |
format="[%(asctime)s] %(levelname)s in %(module)s: %(message)s", |