Skip to content

Instantly share code, notes, and snippets.

View mko-x's full-sized avatar
🧿
Watching

mko-x mko-x

🧿
Watching
View GitHub Profile
@mko-x
mko-x / test.geojson
Last active April 12, 2019 18:03
TestCollection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mko-x
mko-x / keepassXC_build_macOS.sh
Created April 7, 2019 10:42
Build KeePassXC for macOS from scratch
#!/bin/bash
# You may consider using sudo.
# According to https://github.com/keepassxreboot/keepassxc/blob/develop/INSTALL.md
# I was finally able to build keepassxc on my Mac.
# ensure brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update && brew install make cmake gcc qt libgcrypt quazip zlib libmicrohttpd libxi \
@mko-x
mko-x / download_latest_github_release_shell_script
Created February 18, 2019 17:29
Simple shellscript (bash/sh/zsh) to download latest release of a github repository
#!/usr/bin/env zsh bash sh
# @author mko-x<
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "# Download Latest Github Release\n"
echo "# Description: Simply download any latest Github releases of a desired repository."
echo "# Parameter 1: Github repository owner/user\n"
echo "# Parameter 2: Github repository name\n"
echo "# \n"
fi
@mko-x
mko-x / harden_nginx.sh
Created February 7, 2018 21:37
Simple script to harden an nginx webserver
#Firewall Seup:
apt-get install ufw
ufw default deny incomming
ufw default allow outgoing
ufw allow from $yourIP to any port 22
ufw allow 443
#Nginx Versionen verbergen
sed -i "s/# server_tokens off;/server_tokens off;/g" /etc/nginx/nginx.conf
#ETags entfernen
sed -i 's/server_tokens off;/server_tokens off;\netag off;/' /etc/nginx/nginx.conf
@mko-x
mko-x / sh-root-check
Created May 10, 2015 06:09
shell ensure root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@mko-x
mko-x / brew-pkg-check
Created May 10, 2015 06:04
homebrew - check if one or more packages are installed
#!/bin/sh
for pkg in macvim ngrep other needed packages; do
if brew list -1 | grep -q "^${pkg}\$"; then
echo "Package '$pkg' is installed"
else
echo "Package '$pkg' is not installed"
fi
done
@mko-x
mko-x / gist:ed488944bcd2f488cd34
Created February 22, 2015 18:49
docker.rmi.none - removes all untagged images ( REPOSITORY = <none> )
do_remove_none_images() {
# find untagged images
IMAGE_IDS=$(docker images | grep "^<none>" | awk '{print $"3"}')
# in case of no untagged images found do nothing
if [ -n "$IMAGE_IDS" ]; then
docker rmi $IMAGE_IDS > /dev/null 2>&1
fi
}
alias d.rmi.none=do_remove_none_images
# you may use a cron job to execute the cleaning repeatingly