Skip to content

Instantly share code, notes, and snippets.

🤓
Hey there! I am using GitHub.

Will Power willpower232

🤓
Hey there! I am using GitHub.
Block or report user

Report or block willpower232

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@willpower232
willpower232 / passmenu.sh
Last active Jun 10, 2019
dmenu script for pass
View passmenu.sh
#!/usr/bin/env bash
# 1 - source copy from https://geluk.io/p/passmenu.sh (https://github.com/Baggykiin/pass-winmenu)
# 2 - make dmenu case insensitive
# 3 - correct include_username variable
shopt -s nullglob globstar
typeit=0
include_username=1
@willpower232
willpower232 / notes.md
Last active Apr 16, 2019
Setting up my perfect development environment in virtualbox
View notes.md

OS

Mint

Definitely more ready out of the box also seems to cope with 3D in Virtualbox better

Standard

save 1.1GB for base install of 5.5GB apt remove mintstick transmission-gtk timeshift thunderbird xed simple-scan rhythmbox redshift-gtk pix xplayer libreoffice-* xviewer hexchat gimp firefox xreader baobab gnome-calendar gnome-calculator gnome-terminal blueberry gufw tomboy && apt autoremove

@willpower232
willpower232 / my.vimrc
Last active Jun 19, 2019
Guess I have to get into vim one day
View my.vimrc
" syntax highlighting
syntax on
" todo: experiment with colour schemes
"colorscheme elflord
" might help vim cope with random terminals and colours
" by reminding it that the background is dark
set background=dark
@willpower232
willpower232 / gogocertbot.sh
Created Jan 22, 2018
Certbot with DNS verification and AWS route53 plugin
View gogocertbot.sh
#!/bin/bash
# run these first to install certbot globally with the route53 plugin
# $ sudo apt install python-setuptools
# $ sudo easy_install pip
# $ sudo -H pip install certbot-dns-route53
# verify the route53 plugin is present
# $ certbot plugins
@willpower232
willpower232 / reset_home_directory_permissions.sh
Created Dec 13, 2017
Reset Linux Home directory permissions based on /etc/passwd
View reset_home_directory_permissions.sh
#!/bin/bash
chown root:root /home
chmod 755 /home
USERS=$(grep '/home' /etc/passwd | tr "\n" "\n")
for USER in $USERS
do
@willpower232
willpower232 / etc_nginx_sites-enabled_test
Last active Jul 18, 2018
Run Nginx on WSL (Ubuntu on Windows) with automatic domain names and environment for local development
View etc_nginx_sites-enabled_test
server {
listen 80;
listen 443 ssl http2;
# make yourself an SSL certificate for *.test.test (and your dhparam file if you're so inclined)
ssl_certificate /etc/nginx/ssl/test.cert;
ssl_certificate_key /etc/nginx/ssl/test.key;
# your other favourite SSL settings go here
@willpower232
willpower232 / apt-check.sh
Last active Jan 10, 2018
Output pending apt updates as a string and do something with it, good for crons. Aptitude based version of https://gist.github.com/willpower232/ebc91827347c18501030ea0bb70f1a2a
View apt-check.sh
#!/bin/bash
# count package updates by the number of lines
# - just-print bypasses the sudo lock requirement
# - have to narrow it down to lines with brackets to avoid simulation warning that has whitespace at the start
# also note this will include any packages on hold, you should use apt pinning to hide them from the update process
UPDATES_COUNT=$(apt-get --just-print -V -u upgrade --assume-no | grep "(" | grep "^\s" | wc -l)
# store the hostname for later
HOSTNAME=$(hostname)
@willpower232
willpower232 / yum-check.sh
Last active Jan 10, 2018
Output pending yum updates as a string and do something with it, good for crons. Based on https://relativkreativ.at/articles/simple-update-notifications-for-your-centos-redhat-server
View yum-check.sh
#!/bin/bash
# count package updates by the number of lines
# note that this will include packages pending replacement because of needing system reboot
UPDATES_COUNT=$(yum check-update --quiet | grep -v "^$" | wc -l)
# count security updates with a substring
SECURITY_UPDATES=$(yum --debuglevel 2 --security check-update 2>/dev/null | grep -P '(?<! 0 packages) available$' | cut -d ',' -f 1)
# store the hostname for later
View bash.bashrc
# git clone git@github.com:jimeh/git-aware-prompt ~/.bash/git-aware-prompt
git_branch=
git_dirty=
if [ -d ~/.bash/git-aware-prompt ]; then
source ~/.bash/git-aware-prompt/prompt.sh
fi
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
@willpower232
willpower232 / Vagrantfile
Created Nov 21, 2016
My working minimalist Vagrantfile with everything I have used so far in my use of Vagrant
View Vagrantfile
VAGRANTFILE_CLIENT_NAME = "example"
Vagrant.configure(2) do |config|
config.vm.define VAGRANTFILE_CLIENT_NAME do |localdevbox|
localdevbox.vm.box = "localdev"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
You can’t perform that action at this time.