Skip to content

Instantly share code, notes, and snippets.

@przemarbor
przemarbor / vagrant-debian.sh
Last active March 17, 2023 09:01 — forked from FrightenedFox/vagrant-debian.sh
Shell script for installation of Vagrant and VirtualBox (6.1!) on Debian (Bullseye)
# Install requirements
sudo apt update && sudo apt install -y build-essential gcc make perl dkms
# Install VirtualBox
mkdir ~/tempInstallationDir/
wget https://download.virtualbox.org/virtualbox/6.1.42/virtualbox-6.1_6.1.42-155177~Debian~bullseye_amd64.deb -O ~/tempInstallationDir/virtualbox-6.1_6.1.42-155177~Debian~bullseye_amd64.deb
sudo dpkg -i ~/tempInstallationDir/virtualbox-6.1_6.1.42-155177~Debian~bullseye_amd64.deb
sudo apt install -f -y
sudo /sbin/vboxconfig
rm -rf ~/tempInstallationDir/
@przemarbor
przemarbor / parrun.sh
Created March 22, 2022 21:26 — forked from precsim/parrun.sh
Bash xargs script to run parallel MATLAB and Octave jobs
#!/bin/bash
#
# Bash script using xargs to run Matlab and Octave jobs in parallel.
#
n_parruns=16 # Total number of runs.
n_parproc=3 # Number of simultaneous parallel processes.
# Define Matlab/Octave executable and main m-scipt file to run.
export runcmd='/mnt/c/Octave/Octave-4.2.1/bin/octave-cli.exe'
@przemarbor
przemarbor / SysRq magic keys.md
Last active April 16, 2021 13:54 — forked from JPvRiel/SysRq magic keys.md
SysRq magic keys #linux

sysrq magic keys

This is useful for trying to recover from an unresponsive system. However, by default, Ubuntu disables the key to gain raw keyboard access.\

Sometimes part of the issue is that X/Wayland display servers have crashed due to bad graphics drivers and keyboard input isn't processed anymore, whereby changing to another console, e.g. ctrl + alt + F1 doesn't work. Since the default disables keyboard control, alt + sysrq + r, can't help salvage the situation. Hence the suggestion to at least enable system request raw keyboard control when trying to recover a system.

Ubuntu doesn't enable control of keyboard by default

Ubuntu 16.04 LTS default value:

@przemarbor
przemarbor / multiple-push-urls.md
Last active April 16, 2021 13:58 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote #git

Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]