Skip to content

Instantly share code, notes, and snippets.

@CemraJC
CemraJC / site-structure-generator.js
Created February 8, 2024 09:05
Wiki.JS Version 2 - Dynamic Page Structure / TOC Generator
<script>
// ^^^
// Keep the <script> tags when copying into Wiki.JS page editor
async function fetchAllPages() {
const graphqlEndpoint = "/graphql";
const query = `
query GetAllPages {
pages{
list(limit: 1000, orderBy: PATH, orderByDirection: ASC) {
@rockavoldy
rockavoldy / loki-config.yaml
Last active May 18, 2023 16:35
loki and promtail config for odoo log
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
common:
instance_addr: 127.0.0.1
path_prefix: /tmp/loki
storage:
#!/bin/bash
##################################################################################
## ##
## To run this script by command line in background issue this command ##
## ./monitoring-odoo-postgresql-lock > /dev/null 2>&1 & ##
## To kill this script if running issue this command ##
## pkill -f monitoring-odoo-postgresql-lock ##
## To add this script to crontab: ##
## @reboot /path/to/monitoring-odoo-postgresql-lock > /dev/null 2>&1 || true ##
## ##
@diegopacheco
diegopacheco / pbpaste-pbcopy-ubuntu.md
Last active June 8, 2024 03:22
pbpaste && pbcopy for Ubuntu Linux 20.04

Install

sudo apt-get install xclip -y

Create Alias

alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'

Try out

@daladim
daladim / run-as-cron.sh
Last active November 6, 2023 09:42
Run a command or a script as cron would
#!/bin/bash
# Run as if it was called from cron, that is to say:
# * with a modified environment
# * with a specific shell, which may or may not be bash
# * without an attached input terminal
# * in a non-interactive shell
# This scripts supports cron jobs run by any user, just run it as the target user (e.g. using sudo -u <username>)
# An up-to-date version of this script may be available at https://github.com/daladim/run-as-cron
@stain
stain / .notmuch-config
Last active November 13, 2023 08:17
NotMuch hooks for selectively sorting to inbox, moving archived messages to other folder. offlineimap syncs to /home/USER/mail/company and /home/USER/mail/org1
[database]
path=/home/USER/mail
[user]
name=MyName MySurname
primary_email=me@example.com
other_email=me@example.org
@acundari
acundari / traefik-auth.conf
Last active December 6, 2022 09:41
Traefik fail2ban
# /etc/fail2ban/filter.d/traefik-auth.conf
[Definition]
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$