Skip to content

Instantly share code, notes, and snippets.

View andyklimczak's full-sized avatar
:shipit:
Cache Rules Everything Around Me (C.R.E.A.M.)

Andy Klimczak andyklimczak

:shipit:
Cache Rules Everything Around Me (C.R.E.A.M.)
View GitHub Profile
# 1. run `docker run -rm sentry config generate-secret-key` and copy it to all `SENTRY_SECRET_KEY` values
# 2. run `docker compose up` to start sentry
# 3. run `docker exec sentry sentry upgrade` to migrate db and set up initial user
# 4. visit localhost:9000
volumes:
   pgdb:

services:
  redis:
@andyklimczak
andyklimczak / gist:9ff07bb2ec1ebfe82be2098094b38848
Last active May 28, 2024 21:03
Modern Front-End Development for Rails, Second Edition notes

Error install nior4 and html_tokenizer. Use this:

bundle config build.nio4r --with-cflags="-Wno-incompatible-pointer-types"
bundle config build.html_tokenizer --with-cflags="-Wno-incompatible-pointer-types"
bundle install

Don't want to run seafile on port 80, so changing the port to 8000 requires changing some other settings.

Using this docker-compose.yml

services:
  db:
    image: mariadb:10.11
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=db_dev  # Requested, set the root's password of MySQL service.
@andyklimczak
andyklimczak / gist:6cffb26bf86611ccd86c41e0ec8b5765
Created September 8, 2023 21:37
How to access dokku postgres psql
dokku postgres:list
dokku postgres:info DBNAME
copy the DSN, something like postgres://postgres:password123@dokku-postgres-DBNAME:5432/db_name
dokku postgres:enter DBNAME
then inside the postgres container:
psql DSN
BUT CHANGE THE HOST NAME to localhost in DSN, so it should be something like postgres://postgres:password123@localhost:5432/db_name

ssh in (typically ubuntu digital ocean dokku marketplace image)

$ ssh host

Create user other than root to log in to with sudo and dokku groups

# adduser somename
# usermod -aG sudo somename
# usermod -aG dokku somename
@andyklimczak
andyklimczak / gist:ba8694dfeaffb3546e89ea5cb92040de
Last active May 22, 2023 12:46
Elixir Phoenix Cheatsheet

Add index to field:

create table(:posts) do
  add :rating, :integer
end

create index(:posts, [:rating])