Skip to content

Instantly share code, notes, and snippets.

View steefmin's full-sized avatar

Steef Min steefmin

View GitHub Profile
@steefmin
steefmin / 01-vagrant-syncedfolders
Created May 13, 2020 13:22
vagrant sudoless (/etc/sudoers.d/)
# Allow passwordless nfs changes
Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\:0 /tmp/*
Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /bin/sed -i -e /*/ d /etc/hosts
@steefmin
steefmin / update_packages.sh
Last active April 18, 2023 12:18
package update script
#! /bin/sh
sudo echo "\n"
echo "\n Updating apt repos"
sudo apt update
echo "\n Upgrading apt packages"
sudo apt upgrade
echo "\n Stopping snap-store"
# run the following commands:
git config --global alias.pr "!f() { git fetch -fu ${2:-upstream} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
git config --global alias.pr-clean "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
git config --global alias.mr "!f() { git fetch -fu ${2:-upstream} merge-requests/$1/head:mr/$1 && git checkout mr/$1; }; f"
git config --global alias.mr-clean "!git for-each-ref refs/heads/mr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
# should result in something like:
$ cat ~/.gitconfig
[alias]

Keybase proof

I hereby claim:

  • I am steefmin on github.
  • I am steefmin (https://keybase.io/steefmin) on keybase.
  • I have a public key ASAbAWak_Nw8hfSNti1gnV5-42sd3jw200ukVoJNuWLlJQo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=500px">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js"></script>
<style id="jsbin-css">
* {
font-family: sans-serif;