Skip to content

Instantly share code, notes, and snippets.

Portainer with Podman

config:
  cloud-init.user-data: |
    #cloud-config
    manage_etc_hosts: true
    timezone: UTC
    users:
      - default
@sshtmc
sshtmc / container-compose.yml
Last active January 4, 2023 11:21
Podman-compose (or docker-compose) config for running Postgresql + PgAdmin4 with data stored in the project subdirectory
services:
postgresql:
image: docker.io/postgres:latest
container_name: postgresql
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
alias l='ls -ltr'
alias gst='git status'
alias gc='git commit'
alias ga='git add'
alias gd='git diff'
##### Keep history from all terminal sessions
# Avoid duplicates
HISTCONTROL=ignoredups:erasedups
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@sshtmc
sshtmc / ubuntu-configure-sendmail-with-gmail
Created October 25, 2012 12:24
Ubuntu sendmail using smtp.gmail.com
#!/bin/bash
HOST=$(hostname)
function install_postfix() {
echo | sudo debconf-set-selections <<__EOF
postfix postfix/root_address string
postfix postfix/rfc1035_violation boolean false
postfix postfix/mydomain_warning boolean
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
@sshtmc
sshtmc / simple_c_vector.h
Created September 13, 2012 10:52
Simple vector-implementation in C
#ifndef __SIMPLECVECTOR_H__
#define __SIMPLECVECTOR_H__
#include <stdlib.h>
#include <assert.h>
#include <string.h>
typedef struct vector_ {
void** data;
size_t used_entries;