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
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 | |
''' |
[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 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 |
''' | |
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() |
''' | |
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>") |
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
[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 |
#!/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 |