Skip to content

Instantly share code, notes, and snippets.

View luison's full-sized avatar

luison

View GitHub Profile
@JSinghDev
JSinghDev / LXCBindMount.md
Last active October 19, 2024 13:44 — forked from ajmassi/LXCBindMount.md
Create a bind mount from a Proxmox host on an unprivileged lxc container

Proxmox Assign Bind Mount To Unprivileged Container

In order for the LXC container to have full access the proxmox host directory, a subgid is set as owner of a host directory, and an ACL is used to ensure permissions.

Bind Mount dataset to LXC

Add the following line to /etc/pve/lxc/<CT_ID>.conf

mp0:/mount/point/on/host,mp=/mount/point/on/lxc

OR

pct set 100 -mp0 /mnt/bindmounts/shared,mp=/shared

Proxmox with LVM-thin and why we should use Trim/Discard

Excerpts from the Proxmox VE Administration Guide]

LVM normally allocates blocks when you create a volume. LVM thin pools instead allocates blocks when they are written. This behaviour is called thin-provisioning, because volumes can be much larger than physically available space.

8.10.2. Trim/Discard It is good practice to run fstrim (discard) regularly on VMs and containers. This releases data blocks that the filesystem isn’t using anymore. It reduces data usage and resource load. Most modern operating systems issue such discard commands to their disks regularly. You only need to ensure that the Virtual Machines enable the disk discard option.

@coltenkrauter
coltenkrauter / docker-compose.yaml
Last active January 25, 2024 19:46
Traefik V2 Docker Compose file with LetsEncrypt and HTTPS redirect - Traefik dashboard and simple whoami service
# Tutorial: https://blog.creekorful.com/2020/01/how-to-expose-traefik-2-dashboard-securely-docker-swarm/
version: '3'
services:
reverse-proxy:
image: traefik:2.3
command:
# - '--log.level=DEBUG'
- '--api=true'
- '--api.dashboard=true'
@tavinus
tavinus / onlyofficeDocsLXCBuster.md
Last active June 26, 2024 11:30
OnlyOffice Docs into a LXC Debian 10
@devops-school
devops-school / Configure-Docker-daemon.md
Created May 30, 2020 21:44
How to Configure Docker daemon with a configuration file?

Some popular options for daemon.json

The following sample configures the Docker Engine to accept incoming connections on port 2375. All other configuration options will use default values.

{
    "hosts": ["tcp://0.0.0.0:2375"]
}

The following sample configures the Docker daemon to keep images and containers in an alternate path.

@luison
luison / generate-wp-nginx.sh
Last active January 31, 2019 15:29 — forked from Tucker-Eric/generate.sh
Script to generate our WP proxied nginx configurations
SED=`which sed`
CURRENT_DIR=`dirname $0`
echo "Dominio?"
read DOMAIN
# check the domain is valid!
PATTERN="^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$";
if [[ "$DOMAIN" =~ $PATTERN ]]; then
DOMAIN=`echo $DOMAIN | tr '[A-Z]' '[a-z]'`
@netcell
netcell / Dockerfile
Last active January 18, 2021 04:19
Wordpress Development with Docker
FROM chriszarate/wordpress
RUN \
apt-get update && \
apt-get install unzip wget mysql-client -y && \
rm -rf /var/lib/apt/lists/*
COPY ./uploads.ini /usr/local/etc/php/conf.d/uploads.ini
COPY docker-entrypoint.sh /usr/local/bin/
@firatkucuk
firatkucuk / delete-slack-messages.js
Last active November 5, 2024 13:15
Deletes slack public/private channel messages, private chat messages and channel thread replies.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@lmeyer
lmeyer / main.scss
Created October 25, 2016 10:22
Responsive margins and paddings sass mixin
// Sizes
$margin-none: 0;
$margin-sm: 5;
$margin-base: 15;
$margin-lg: 30;
$margin-xl: 50;
$margin-xxl: 100;
$padding-xxl: 100;