Skip to content

Instantly share code, notes, and snippets.

View ben-kenney's full-sized avatar

ben-kenney

View GitHub Profile
#!/bin/bash
# Small script that will use htpasswd to hash a password
# This is useful for Traefik, especially if you don't want to install apache2-utils on your system
# It can be run using docker:
# docker container run -ti --rm -v $PWD:/data -w /data ubuntu:bionic bash -c "bash htpasswd.sh"
# hashed password will be stored in the file log.timestamp to ensure unique name
timestamp=$(date +%s)
@ben-kenney
ben-kenney / x2go-install
Created June 6, 2021 20:29
Script to install x2go on ubuntu
#!/bin/bash
# install x2go with xfce
# based on https://fabianlee.org/2019/02/03/ubuntu-x2go-on-ubuntu-bionic-for-remote-desktop-access/
# Should be able to run this script as your regular user if they are in the sudoers list
# ensure user is not root
if [[ $EUID -eq 0 ]]; then
echo "This script should not be run as root, but $USER should have sudo privileges"
exit 1
fi
@ben-kenney
ben-kenney / .zshrc
Last active December 27, 2023 22:23
# some parts borrowed from
# http://leahneukirchen.org/dotfiles/.zshrc
# https://leahneukirchen.org/blog/archive/2012/02/10-new-zsh-tricks-you-may-not-know.html
# these options allow for neat directory history
# cd -<TAB>
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_MINUS
# theme for oh-my-zsh
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
local cb=$(current_branch)
if [ -n "$cb" ]; then