Skip to content

Instantly share code, notes, and snippets.

@dre1080
dre1080 / docker-cleanup-resources.md
Created Nov 9, 2020 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@dre1080
dre1080 / fix.md
Last active Oct 28, 2020
Fix bluetooth on Linux
View fix.md
@dre1080
dre1080 / config.yml
Last active Oct 20, 2020 — forked from Surendrajat/config.yml
fusuma multitouch gesture config for elementary OS
View config.yml
swipe:
3:
left:
command: 'xdotool key ctrl+super+Left'
right:
command: 'xdotool key ctrl+super+Right'
up:
command: 'xdotool key ctrl+t'
threshold: 1.5
down:
@dre1080
dre1080 / fix.md
Created Oct 19, 2020
megasync fix for deepin OS v20
View fix.md

you can fix this by adding the env variable in the launch file:

nano /usr/share/applications/megasync.desktop

and then replace Exec=megasync with Exec=env QT_SCALE_FACTOR=1 megasync

remove the TryExec line and save. you can then copy the megasync.desktop launch file to your autostart folder, e.g.:

@dre1080
dre1080 / .zshrc
Last active Oct 29, 2020
my .zshrc
View .zshrc
# preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
# SSH mode
export EDITOR="nano"
else
# local terminal mode
export EDITOR="code -w -n"
fi
# setup golang
@dre1080
dre1080 / Dockerfile
Created Oct 23, 2019
Nuxt.js Multi-Stage Dockerfile
View Dockerfile
# Build
FROM node:latest as build-env
ENV NODE_ENV production
WORKDIR /src
COPY . .
RUN yarn install \
View semantic-commit-messages.md

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@dre1080
dre1080 / deploy.sh
Created Oct 29, 2018
Zero Downtime Docker Compose Deploys
View deploy.sh
#!/usr/bin/env bash
CONTAINER_NAME="$1"
PROJECT_NAME="app"
# lets find the first container
FIRST_NUM=`docker ps | awk '{print $NF}' | grep app_$CONTAINER_NAME | awk -F "_" '{print $NF}' | sort | head -1`
NUM_OF_CONTAINERS=1
MAX_NUM_OF_CONTAINERS=2
View gist:a3699bcb433f4d04d155955206a363e3
Series:
{n.space('.').colon('-').replaceAll(/[!?.]+$/).replaceAll(/&/, 'and').replaceAll(/[`´‘’ʻ']/).replaceAll(/\*/, '-').replaceTrailingBrackets('$1')}.{s00e00}.{t.space('.').colon('-').replaceAll(/[!?.]+$/).replaceAll(/&/, 'and').replaceAll(/[`´‘’ʻ']/).replaceAll(/\*/, '-').replaceTrailingBrackets('$1')}
Movies:
{n.colon(' - ')} ({y})
You can’t perform that action at this time.