Last active
March 11, 2020 20:55
-
-
Save wolkenarchitekt/5fdd672aeed1099c1f6c6ea925c8277d to your computer and use it in GitHub Desktop.
Makefile config management
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL := /bin/bash | |
PWD = $(shell pwd) | |
UNAME := $(shell uname) | |
ARCH := $(shell uname -m) | |
USER := $(shell echo $$USER) | |
USERDIR := $(shell echo $$HOME) | |
# Synology ignores | |
ifeq ($(UNAME),Linux) | |
FOLDER := .SynologyDrive/SynologyDrive.app/conf | |
else ifeq ($(UNAME),Darwin) | |
FOLDER := .SynologyDrive/SynologyDrive.app/Contents/Resources/conf | |
endif | |
SYNOLOGY_SRC := $(PWD)/files/home/user/$(FOLDER) | |
SYNOLOGY_TARGET := $(USERDIR)/$(FOLDER) | |
packages: | |
@sudo apt-get update | |
@echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections | |
@DEBIAN_FRONTEND=noninteractive sudo apt-get -y install \ | |
ansible \ | |
clementine \ | |
clipit \ | |
entr \ | |
exfat-fuse \ | |
fasd \ | |
fdupes \ | |
gimp \ | |
git \ | |
gitg \ | |
glances \ | |
gparted \ | |
git-gui \ | |
gstreamer1.0-plugins-bad \ | |
jmtpfs \ | |
ipython3 \ | |
hfsutils \ | |
hfsprogs \ | |
htop \ | |
jq \ | |
keepassx \ | |
libxml2-utils \ | |
libglib2.0-bin \ | |
markdown \ | |
meld \ | |
mpv \ | |
nfs-common \ | |
ntfs-3g \ | |
openssh-server \ | |
partitionmanager \ | |
postgresql-client \ | |
pwgen \ | |
python-mutagen \ | |
python3-ipdb \ | |
python3-mutagen \ | |
python-watchdog \ | |
python3-pip \ | |
silversearcher-ag \ | |
soundkonverter \ | |
terminator \ | |
torbrowser-launcher \ | |
udftools \ | |
ubuntu-restricted-extras \ | |
vlc \ | |
zlib1g-dev | |
@pip3 install --user \ | |
black \ | |
autoflake \ | |
cookiecutter \ | |
isort \ | |
sphinx \ | |
soundcloud_dl \ | |
virtualenv | |
hibiscus: | |
@sudo apt-get install -y hibiscus-ppa | |
@sudo apt-get-update && sudo apt-get install hibiscus-orig | |
latex: | |
@sudo apt-get -y install \ | |
latexmk \ | |
texlive \ | |
texlive-fonts-extra \ | |
texlive-science \ | |
texlive-lang-german \ | |
texmaker | |
@sudo cp files/usr/share/applications/texmaker.desktop /usr/share/applications/texmaker.desktop | |
@sudo chown -R $(USER) /usr/share/applications/texmaker.desktop | |
ack: | |
sudo apt-get install -y ack | |
ln -sf $(PWD)/files/home/user/.ackrc $(USERDIR)/.ackrc | |
acroread: | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update --fix-missing | |
sudo apt install -y gdebi-core libxml2:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386 libatk-adaptor:i386 | |
cd /tmp && \ | |
wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb && \ | |
sudo dpkg -i AdbeRdr9.5.5-1_i386linux_enu.deb | |
fzf: | |
@if [ ! -d "$(USERDIR)/.fzf" ] ; then \ | |
git clone --depth 1 https://github.com/junegunn/fzf.git $(USERDIR)/.fzf; \ | |
$(USERDIR)/.fzf/install --completion --key-bindings --no-update-rc; \ | |
fi | |
bash: | |
mkdir -p $(USERDIR)/.config | |
@if ! [ -L "$(USERDIR)/.bashrc" ]; then \ | |
ln -sf $(PWD)/files/home/user/.bashrc $(USERDIR)/.bashrc; \ | |
fi | |
@if ! [ -L "$(USERDIR)/.config/bashrc" ]; then \ | |
ln -sf $(PWD)/files/home/user/.config/bashrc $(USERDIR)/.config/bashrc; \ | |
ln -sf $(PWD)/files/home/user/.bashrc $(USERDIR)/.bashrc; \ | |
fi | |
sudo cp files/etc/bash_completion.d/* /etc/bash_completion.d/ | |
autoformat: | |
@pip3 install --user \ | |
black \ | |
isort \ | |
autoflake | |
@sudo ln -s $(PWD)/files/usr/local/bin/autoformat /usr/local/bin/autoformat | |
synology_ignore: | |
cp -v $(SYNOLOGY_SRC)/filter $(SYNOLOGY_TARGET)/ | |
cp -v $(SYNOLOGY_SRC)/filter-v4150 $(SYNOLOGY_TARGET)/ | |
ipython_profile: | |
@ipython3 profile create | |
@cp $(PWD)/files/home/user/.ipython/profile_default/*.py ~/.ipython/profile_default/ | |
python3.7: | |
@sudo add-apt-repository -y ppa:deadsnakes/ppa | |
@sudo apt install -y python3.7 | |
@python3.7 -m pip install pip | |
@pip3.7 install ipython | |
python3.8: | |
@sudo add-apt-repository -y ppa:deadsnakes/ppa | |
@sudo apt install -y python3.8 | |
@python3.8 -m pip install pip | |
@pip3.8 install ipython | |
pyenv: | |
@sudo apt-get install -y \ | |
build-essential \ | |
libbz2-dev \ | |
libssl-dev \ | |
libreadline-dev \ | |
libsqlite3-dev \ | |
tk-dev | |
@curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | |
synology-drive: | |
#xdg-open https://www.synology.com/en-uk/support/download/DS216j#utilities | |
xdg-open https://www.synology.com/de-de/support/download/DS718+#utilities | |
@read -p "Press any key after installation is finished" | |
powerbutton-shutoff: | |
hostnamectl set-chassis vm | |
-gsettings set org.gnome.settings-daemon.plugins.power button-power shutdown | |
entr: | |
sudo cp $(PWD)/files/reload-browser /usr/local/bin/reload-browser | |
sudo chmod +x /usr/local/bin/reload-browser | |
wrk: | |
sudo apt-get install build-essential libssl-dev git -y | |
cp -r $(PWD)/files/wrk /tmp && cd /tmp/wrk && make && sudo cp wrk /usr/local/bin | |
insomnia: | |
# Add to sources | |
echo "deb https://dl.bintray.com/getinsomnia/Insomnia /" \ | |
| sudo tee -a /etc/apt/sources.list.d/insomnia.list | |
# Add public key used to verify code signature | |
wget --quiet -O - https://insomnia.rest/keys/debian-public.key.asc \ | |
| sudo apt-key add - | |
# Refresh repository sources and install Insomnia | |
sudo apt-get update | |
sudo apt-get install -y insomnia | |
go: | |
sudo snap install go --classic | |
node: | |
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash | |
#curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - | |
sudo apt-get update && sudo apt -y install nodejs | |
node-modules: | |
npm install eslint eslint-plugin-react | |
yarn: | |
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt-get update && sudo apt-get install -y yarn | |
rust: | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
mount: | |
./config.sh fstab | |
inotify-sysctl: | |
@if [ ! -f "/etc/sysctl.d/idea.conf" ]; then \ | |
echo "fs.inotify.max_user_watches = 524288" | sudo tee /etc/sysctl.d/idea.conf; \ | |
sudo sysctl -p --system; \ | |
fi | |
sublime: | |
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list | |
sudo apt-get update | |
sudo apt-get install -y sublime-text | |
virtualbox: | |
# xdg-open http://download.virtualbox.org/virtualbox/6.0.10/ | |
# sudo usermod -aG vboxusers $(USER) | |
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - | |
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - | |
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib" | |
sudo apt update | |
sudo apt install -y virtualbox-6.0 | |
# Create signing keys | |
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive common name/" | |
# Sign module | |
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv) | |
# Confirm module is signed | |
tail $(modinfo -n vboxdrv) | grep "Module signature appended" | |
# Register keys to secureboot | |
sudo mokutil --import MOK.der | |
# Needto enroll MOK https://sourceware.org/systemtap/wiki/SecureBoot | |
kubectl: | |
sudo snap install kubectl --classic | |
vim: | |
sudo apt-get install -y vim | |
ln -s $(PWD)/files/home/user/.vim ~/.vim | |
docker: | |
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
sudo apt update | |
sudo apt install -y docker-ce | |
sudo usermod -aG docker ${USER} | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$$(uname -s)-$$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
keyboard: | |
sudo cp /usr/share/X11/xkb/symbols/gb /usr/share/X11/xkb/symbols/gb.bak | |
sudo cp files/usr/share/X11/xkb/symbols/gb /usr/share/X11/xkb/symbols/gb | |
/usr/bin/setxkbmap gb -display :0 | |
chrome: | |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list | |
sudo apt-get update | |
sudo apt install -y google-chrome-stable | |
quicktile: | |
sudo apt-get update --fix-missing | |
sudo apt install -y libpango1.0-0 python-pip libwnck22 | |
wget http://ftp.br.debian.org/debian/pool/main/g/gnome-python-desktop/python-wnck_2.32.0+dfsg-3_amd64.deb | |
sudo dpkg -i python-wnck_2.32.0+dfsg-3_amd64.deb | |
sudo -H pip2 install --upgrade https://github.com/ssokolow/quicktile/archive/master.zip | |
-dconf load /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ <files/quicktile_keyboard_shortcuts.dconf 2>/dev/null | |
nautilus-settings: | |
-dconf load /org/gnome/nautilus/preferences/ <files/nautilus.dconf 2>/dev/null | |
git-config: | |
ln -s $(PWD)/files/home/user/.gitconfig $(HOME)/.gitconfig | |
clipit-settings: | |
mkdir -p $(HOME)/.config/clipit | |
ln -sf $(PWD)/files/home/user/.config/clipit/clipitrc $(HOME)/.config/clipit | |
vagrant: | |
wget https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb | |
sudo dpkg -i vagrant_2.2.5_x86_64.deb | |
rm vagrant_2.2.5_x86_64.deb | |
amazon: | |
@sudo dpkg-divert \ | |
--divert /usr/share/applications/ubuntu-amazon-default.desktop.diverted \ | |
--local \ | |
--rename \ | |
/usr/share/applications/ubuntu-amazon-default.desktop | |
terminator: | |
@sudo apt-get install -y terminator | |
mkdir $(HOME)/.config/terminator/ | |
cp $(PWD)/files/home/user/.config/terminator/config $(HOME)/.config/terminator/config | |
fix-usb3: # Fix USB3.0 devices not being detected | |
./config.sh usb3 | |
wifi-fix: # Repair Wifi on Thinkpads | |
sudo sed -i 's/wifi.powersafe = 3/wifi.powersafe = 2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf | |
cups-disable-discovery: | |
# Disable notification spam because of adding new printers at work | |
sudo sed -i 's/# BrowseProtocols none/BrowseProtocols none/' /etc/cups/cups-browsed.conf | |
sudo service cups-browsed restart | |
sudo service cups restart | |
osx: | |
# Install homebrew first | |
@if [ ! -x brew ]; then \ | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; \ | |
fi; | |
ln -sf $(PWD)/files/home/user/.bash_profile $(HOME)/.bash_profile | |
@if [ ! -x fasd ]; then \ | |
brew install fasd \ | |
fi; | |
sudo cp files/osx/british_umlauts_new.keylayout "/Library/Keyboard Layouts/" | |
sudo mkdir -p /usr/local/Frameworks | |
sudo chown $(USER) /usr/local/Frameworks | |
brew install python3 | |
brew install git # for git gui | |
# Increase keyboard repeat rate | |
defaults write -g InitialKeyRepeat -int 15 # normal minimum is 15 (225 ms) | |
defaults write -g KeyRepeat -int 2 # normal minimum is 2 (30 ms) | |
opera: | |
wget -qO- https://deb.opera.com/archive.key | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free" | |
sudo apt-get update | |
sudo apt install -y opera-stable | |
spotify: | |
curl -sS https://download.spotify.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list | |
sudo apt-get update && sudo apt-get install spotify-client | |
slack: | |
cd /tmp && \ | |
wget https://downloads.slack-edge.com/linux_releases/slack-desktop-4.0.2-amd64.deb && \ | |
sudo apt install -y ./slack-desktop-*.deb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment