All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login

All New Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated

admin / croudsec.md

0 likes
0 forks
1 files
Last active 1 month ago
  233  curl -s https://install.crowdsec.net | sudo sh
  234  apt -y install crowdsec
  235  systemctl reload crowdsec && systemctl status crowdsec
  236  cscli metrics
  237  apt -y install crowdsec-firewall-bouncer-iptables
  238  cscli allowlist create my_allowlist -d 'my-ips'
  239  cscli allowlist add my_allowlist 1.2.3.4
  240  cscli allowlist add my_allowlist 5.6.7.8/24
  241  cscli decisions list

admin / models.py

0 likes
0 forks
1 files
Last active 1 month ago
1 import json
2 import peewee as pw
3 from datetime import datetime
4
5 db = pw.SqliteDatabase('example.db')
6
7
8 class JSONField(pw.TextField):
9 def db_value(self, value):
10 return json.dumps(value, ensure_ascii=False)

admin / upd_restart.py

0 likes
0 forks
1 files
Last active 1 month ago
1 import subprocess
2 import sys
3
4 @router.message(F.text == "/reboot")
5 async def command_handler(msg: types.Message, *args, **kwargs):
6 if msg.from_user.id in [1234567890, 123123123]:
7 subprocess.run(["git", "pull"], check=True, stdout=subprocess.PIPE).stdout
8 python = sys.executable
9 os.execl(python, python, *sys.argv)

admin / Locales.md

0 likes
0 forks
1 files
Last active 1 month ago

Добавляем поддержку русского языка в Ubuntu\Debian системах:

Установим\обновим пакет locales:

apt-get install locales

После чего выполним команду:

admin / inlux_grafana.yml

0 likes
0 forks
1 files
Last active 1 month ago
1 services:
2 influxdb:
3 image: influxdb:1.8-alpine
4 container_name: "stats-influxdb"
5 env_file: .env
6 volumes:
7 - "./influxdb:/var/lib/influxdb"
8 ports:
9 - "8086:8086"

admin / apparmor.md

0 likes
0 forks
1 files
Last active 1 month ago

Отключение AppArmor в Ubuntu 24.04

Опубликовано 9 октября 2024, 10:51

Выключение сервиса

systemctl disable --now apparmor

Удаление AppArmor

admin / StepCA.sh

0 likes
0 forks
1 files
Last active 1 month ago
1 #!/bin/sh
2
3 set -e
4
5 echo '----------Install StepCA!----------'
6 apt-get update && apt-get install -y --no-install-recommends curl vim gpg ca-certificates jq
7
8 curl -fsSL https://packages.smallstep.com/keys/apt/repo-signing-key.gpg -o /etc/apt/trusted.gpg.d/smallstep.asc && \
9 echo 'deb [signed-by=/etc/apt/trusted.gpg.d/smallstep.asc] https://packages.smallstep.com/stable/debian debs main' \
10 | tee /etc/apt/sources.list.d/smallstep.list

admin / SMTP_servers

0 likes
0 forks
2 files
Last active 1 month ago
1 from datetime import datetime
2 import asyncore
3 from smtpd import SMTPServer
4
5 class EmlServer(SMTPServer):
6 no = 0
7 def process_message(self, peer, mailfrom, rcpttos, data):
8 filename = '%s-%d.eml' % (datetime.now().strftime('%Y%m%d%H%M%S'),
9 self.no)
10 f = open(filename, 'w')

admin / custom_jwt.js

0 likes
0 forks
1 files
Last active 1 month ago
1 /**
2 * This function is called during the access token generation process to get custom claims for the access token.
3 * Limit custom claims to under 50KB.
4 *
5 * @param {Payload} payload - The input argument of the function.
6 *
7 * @returns The custom claims.
8 */
9 const getCustomJwtClaims = async ({ token, context, environmentVariables, api }) => {
10 const user = context.user;

admin / ssh-port.service

0 likes
0 forks
1 files
Last active 1 month ago
1 [Unit]
2 Description=SSH tunnel
3 After=network-online.target
4 [Service]
5 ExecStart=/usr/bin/ssh -NT \
6 -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes \
7 -R 4433:127.0.0.1:4430 user@1.2.3.4 -p 22
8 RestartSec=15
9 Restart=always
10 [Install]
Newer Older

Powered by Opengist ⋅ Load: 238ms⋅

English
العربية Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 简体中文 繁體中文