Skip to content

Instantly share code, notes, and snippets.

@Norcoen
Norcoen / Arch Linux, Fedora
Created February 14, 2021 22:39 — forked from elvetemedve/Arch Linux, Fedora
Allow Vagrant usage without providing sudo password
sudo tee /etc/sudoers.d/vagrant > /dev/null << EOL
#
# Arch Linux, Fedora sudoers entries
#
# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE
@Norcoen
Norcoen / download-site.md
Created March 19, 2021 00:31 — forked from pmeinhardt/download-site.md
download an entire page (including css, js, images) for offline-reading, archiving… using wget

If you ever need to download an entire website, perhaps for off-line viewing, wget can do the job — for example:

$ wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.org --no-parent  www.website.org/tutorials/html/

This command downloads the website www.website.org/tutorials/html/.

The options are:

  • --recursive: download the entire website
  • --domains website.org: don't follow links outside website.org
@Norcoen
Norcoen / pi_setup.sh
Created September 15, 2021 02:02 — forked from AnthonyDiGirolamo/pi_setup.sh
Raspberry Pi Provisioning Script
#!/usr/bin/env bash
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp -r archives pi@192.168.3.249:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh pi@192.168.3.249 'sudo mv ~/archives/* /var/cache/apt/archives/'
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_setup pi@192.168.3.249:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh pi@192.168.3.249 'bash ~/pi_setup pi9 109'
# for pi in 110 111 112
# do
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_keys pi@192.168.3.$pi:~/.ssh/authorized_keys
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_hosts pi_mpihostsfile pi@192.168.3.$pi:~/
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp ~/.ssh/config pi@192.168.3.$pi:~/.ssh/
# ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh pi@192.168.3.$pi 'cat /etc/hosts pi_hosts | tee hosts ; sudo cp hosts /etc/hosts'
@Norcoen
Norcoen / gitlab_lxc.txt
Last active January 15, 2022 19:59
gitlab on LXC Container (proxmox)
Um gitlab auf ubuntu 16.04 oder debian 8.5 zu installieren
(und wohl auch auf anderen ubuntus, debian hat noch zusätliche Probleme, dafür funktioniert aber z.B. top, htop, usw...)
müssen folgende Einstellungen in /etc/gitlab/gitlab.rb gesetzt sein:
postgresql['shared_buffers'] = "512MB" # recommend value is 1/4 of total RAM, up to 14GB.
postgresql['effective_cache_size'] = "128MB"
Beim ersten wird in der Config zum Start 256MB angeboten, reicht ggf. auch
Beim zweiten ist in der Config nur 1MB eingetragen, das kommt mir ggü. dem Standardwert von postgresql (128MB) zu wenig vor.
#!/usr/bin/env bash
# Installs NixOS on a Hetzner server, wiping the server.
#
# This is for a specific server configuration; adjust where needed.
#
# Prerequisites:
# * Update the script wherever FIXME is present
#
# Usage:
@Norcoen
Norcoen / nixinst.sh
Created November 21, 2022 13:22 — forked from nuxeh/nixinst.sh
Automated NixOS installer script
#!/bin/sh
#
# For installing NixOS having booted from the minimal USB image.
#
# To run:
#
# sh -c "$(curl https://eipi.xyz/nixinst.sh)"
#
# https://eipi.xyz/blog/nixos-x86-64