Skip to content

Instantly share code, notes, and snippets.

View bertvv's full-sized avatar

Bert Van Vreckem bertvv

View GitHub Profile
@bertvv
bertvv / bash_template.sh
Last active February 1, 2019 19:20
Simple Bash script template
#!/usr/bin/env bash
#
# Script name -- purpose
#
# Author:
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
#
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
@bertvv
bertvv / lorem.txt
Created October 22, 2013 12:11
Vultekst
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget
auctor massa, vitae placerat nisl. Nunc mi ligula, ultricies sed euismod
nec, porttitor ac tortor. Donec congue lorem vel risus ullamcorper
euismod. Nam interdum eu arcu a bibendum. Nunc vel risus dolor. Quisque
magna libero, ornare eu luctus sed, auctor et erat. Donec vitae tincidunt
tortor. Integer a rhoncus mi. Ut rutrum sapien quis odio euismod luctus.
Cras lobortis nisi non neque faucibus malesuada.
Aenean commodo nec mi non consectetur. Aenean imperdiet neque eget lacus
pharetra, gravida accumsan nisl ultrices. Sed volutpat sed lacus eu
@bertvv
bertvv / latex.gitignore
Last active December 19, 2015 15:19
Ignore temporary files in a LaTeX project maintained with Git Download with: wget https://gist.github.com/bertvv/5975746/raw/c02d1c760459027c09ef220af6129006eb31f328/latex.gitignore
# General files to ignore
*~
*.bak
.*.un~
# Gedit LaTeX ini file
.*.ini
# LaTeX compilation artifacts
*.aux
@bertvv
bertvv / HoGent kleurenpalet.markdown
Last active January 12, 2017 08:35
Kleurenpalet van de HoGent huisstijl

Kleuren HoGent huisstijl

Omdat het altijd van pas komt...

RGB decimaal en hex

Departementen

Bron: huisstijlhandboek

@bertvv
bertvv / newfile.sh
Last active December 17, 2015 04:58
Generate a file name for a new file, based on the specified prefix and suffix. Uniqueness is guaranteed by a sequence number. E.g. "newfile test- .txt" will return a file name in the form test-NNN.txt where NNN is the first number (001, 002, etc.) that results in a file name that doesn't exist yet.
# Return a file name consisting of the specified prefix, number, and suffix
# 3 arguments:
# $1 - prefix
# $2 - an integer, which will be padded with zeroes to length 3
# $3 - suffix
# e.g. "mkfile test- 2 .txt" will return "test-002.txt"
mkfile ()
{
echo "${1}$(printf '%03d' ${2})${3}"
}
@bertvv
bertvv / yumtricks.sh
Last active December 15, 2015 23:38
Useful Yum and RPM tricks
# List files in a package
rpm -ql PACKAGE
# What package does a file belong to?
rpm -qf FILE # in currently installed packages
yum provides FILE # in all packages
# Print a list of manually installed packages
# credits: http://forums.fedoraforum.org/showpost.php?p=1606568&postcount=12
yumdb search command_line "*install*" | grep command_line | sed 's/.*install//' | tr ' ' '\n' | sort -u
@bertvv
bertvv / gemrc
Last active December 10, 2015 21:08
gemrc that avoids installing documentation. Useful for VMs that have to stay as small as possible.
# This goes into /etc/gemrc
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
@bertvv
bertvv / hgignore.LaTeX
Last active January 18, 2019 13:01
Ignore temporary files for a LaTeX project in Mercurial. Works as well as a .gitignore for a Git repository if you drop the line with "syntax: glob".
# Files to ignore in a LaTeX project
syntax: glob
# General files to ignore
*~
*.bak
# Gedit LaTeX ini file
.*.ini