Skip to content

Instantly share code, notes, and snippets.

@ederparaiso
ederparaiso / Docker-centos7-systemd-sshd.md
Last active February 24, 2024 09:00
docker-centos7-systemd-sshd

Docker centOS 7 based with systemd enabled and sshd installed.

Build image

docker build --rm -t c7-systemd-sshd .

Run

docker run --rm --privileged=true -p 22:22 -v /sys/fs/cgroup:/sys/fs/cgroup:ro c7-systemd-sshd

Alternatively you can use docker compose

@ederparaiso
ederparaiso / git-cleanup-old-branches.sh
Last active June 11, 2018 17:19
Removes all branches that don't exist in remote repo anymore
#!/bin/bash
cd $1
git checkout master
git fetch --prune
OLD_BRANCHES=$(git branch -v | grep gone | cut -d " " -f3)
for branch in ${OLD_BRANCHES}; do
git branch -D ${branch}
done