Skip to content

Instantly share code, notes, and snippets.

View walshc's full-sized avatar

Christoph walshc

View GitHub Profile
@walshc
walshc / brightness.sh
Created September 9, 2017 14:39
Script to set/increase/decrease brightness in Ubuntu 17.04
#!/bin/bash
# Script to set/increase/decrease brightness in Ubuntu
MAX_BRIGHTNESS=$(cat /sys/class/backlight/intel_backlight/max_brightness);
BRIGHTNESS=$(cat /sys/class/backlight/intel_backlight/actual_brightness);
PCT=$(echo $BRIGHTNESS $MAX_BRIGHTNESS | awk '{printf "%4.0f\n",($1/$2)*100}')
if [ "$(whoami)" != "root" ] ; then
printf "Script must be run as root.\n" && exit;
@walshc
walshc / install-mtheme.sh
Last active October 20, 2018 12:44
Install metropolis beamer theme
#!/bin/bash
# Install Fira:
cd ~/
git clone https://github.com/mozilla/Fira
mkdir -p ~/.local/share/fonts/Fira
mv Fira/ttf/* ~/.local/share/fonts/Fira
rm -rf Fira
fc-cache -fv
@walshc
walshc / beamerthemematerial.sty
Last active April 13, 2018 02:46
Material Design Beamer theme.
% Copyright 2016 by Christoph Walsh
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
% Used material from:
% https://github.com/edasubert/beamerMaterialDesign and
% http://ctan.mackichan.com/macros/latex/contrib/beamer/base/themes/outer/beamerouterthememiniframes.sty
@walshc
walshc / installr.sh
Last active May 26, 2016 23:41
Install latest R to ~/.local.
#!/bin/bash
R_VERSION="3.2.5"
wget https://cran.r-project.org/src/base/R-3/R-$R_VERSION.tar.gz
tar -xvf R-$R_VERSION.tar.gz
rm R-$R_VERSION.tar.gz
cd R-$R_VERSION
# If ~/.local/bin doesn't exist, create it: