- Create certificates
- Edit Docker options
- Restart Docker
- Copy client certificates from host
- (optional) Add remote endpoint in Portainer
Tested on a standard $5/mo DigitalOcean VPS running Ubuntu 16.04.
Tested on a standard $5/mo DigitalOcean VPS running Ubuntu 16.04.
| FROM user/baseimage:version-tag | |
| # 1. This is VERY basic | |
| # 2. Need to load RVM first during build | |
| # 3. Create empty folders for runtime files | |
| RUN \ | |
| rm /bin/sh && ln -s /bin/bash /bin/sh && \ | |
| mkdir -p \ | |
| /home/app/webapp \ |
| version: "3" | |
| services: | |
| traefik: | |
| image: "traefik:v2.0" | |
| container_name: "traefik" | |
| command: | |
| # Globals | |
| - "--log.level=DEBUG" | |
| - "--api=true" |
Note: This gist may be outdated, thanks to all contributors in comments.
adb is the Android CLI tool with which you can interact with your android device, from your PC
You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.
Don't hesitate to read comments, there is useful tips, thanks guys for this !
This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.
I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)
Before trying it out DIY, I considered using:
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| """ """ | |
| """ Álan's NeoVim configuration """ | |
| """ """ | |
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| call plug#begin('~/.vim/plugged') | |
| Plug 'ParamagicDev/vim-medic_chalk' | |
| Plug 'SirVer/ultisnips' |
| Rails.application.eager_load! | |
| exclude_tables = ["sessions"] | |
| row_limit_per_table = nil | |
| tables = [] | |
| ApplicationRecord.descendants.each do |model| | |
| next if exclude_tables.any?{ |skip_table| skip_table == model.table_name } | |
| next if tables.include?(model.table_name) # This covers STI | |
| puts "Exporting: #{model.table_name}" | |
| class Mecha | |
| private attr_accessor(:states_map, :callbacks, :transitions, :current_state) | |
| public :transitions, :current_state | |
| def initialize(initial_state:, transitions:) | |
| self.states_map = transitions.parameters.select { |(type, _)| type == :keyreq }.to_h { [_2, _2] } | |
| self.callbacks = Hash.new { |hash, key| hash[key] = [] } | |
| self.transitions = transitions.call(**states_map).transform_values(&:freeze).freeze |
| services: | |
| - docker:24.0.5-dind | |
| variables: | |
| DOCKER_HOST: tcp://docker:2375 | |
| DOCKER_DRIVER: overlay2 | |
| DOCKER_TLS_CERTDIR: "" # don't start over TLS | |
| meta-build-image: | |
| interruptible: true |
| #!/bin/bash | |
| # Production Docker Host Hardening Script v2 | |
| # For Ubuntu Server 24.04 LTS (Noble) | |
| # Suitable for both Kamal deployment and builder hosts | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # --- Constants --- |