Skip to content

Instantly share code, notes, and snippets.

View timohuovinen's full-sized avatar
🙃

Timo Huovinen timohuovinen

🙃
View GitHub Profile
@timohuovinen
timohuovinen / save.md
Last active January 4, 2023 23:09
git add, commit, push shortcut

I got annoyed having to git add then git commit -a -m and then git push most of the time, so here's a shortcut.
Having to remove the quotes and re-add them was also annoying.

Add to /home/yourname/.bashrc

# add files, commit "my message" and push
function save {
  git add .
 git commit -a -m "$*"
@timohuovinen
timohuovinen / java-amd64.Dockerfile
Last active December 21, 2022 17:23
Install java 8 (2022 Oct 12) on Docker with linux amd64
ARG JRE_URL=http://javadl.oracle.com/webapps/download/AutoDL?BundleId=247127_10e8cce67c7843478f41411b7003171c
ARG JAVA_HOME_NAME=java-8-oracle
RUN \
apt-get update && \
apt-get install -y wget && \
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" $JRE_URL -O java-linux-x64.tar.gz && \
mkdir -p /usr/lib/jvm/$JAVA_HOME_NAME && \
tar -C /usr/lib/jvm/$JAVA_HOME_NAME --strip-components=1 -xvf java-linux-x64.tar.gz && \
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/$JAVA_HOME_NAME/bin/java" 1 && \
rm -rf /var/lib/apt/lists/* && \
@timohuovinen
timohuovinen / ext4-journal-mode.md
Last active October 29, 2022 15:51
ext4 filesystem journal mode
@timohuovinen
timohuovinen / install-kvm-windows-linux.md
Last active October 31, 2022 08:30
Windows 10 guest virtual machine on linux mint 21 host using KVM and QEMU
@timohuovinen
timohuovinen / install-docker-desktop-linux-mint.md
Last active October 27, 2022 08:39
Install docker desktop on linux mint 21

Linux Mint 21 vanessa corresponds to Ubuntu jammy

Install docker engine (can be skipped because it's bundled with docker desktop)

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.gpg
@timohuovinen
timohuovinen / virtualbox-windows.md
Last active March 31, 2024 11:48
Create and run a windows virtual machine using virtualbox

Virtualbox (free and open-source)

How to install an unlicensed copy of windows using virtualbox

  1. Install virtualbox 7 (or higher)
    1. Ubuntu 22.04 jammy for linux mint 21
    2. Download extensions pack for the same version.
  2. Virtualbox > Tools > Install Oracle VM Virtualbox Extensions Pack for the same version
  3. Download Windows 10 pro from Microsoft
  4. Create a machine
    1. System > Motherboard > Check EFI and Secure boot (boot order won’t work with EFI, required for windows 11)
  5. System > Motherboard > Check TPM 2.0 (Security chip emulation)
@timohuovinen
timohuovinen / install-go-asdf-apt.md
Last active October 26, 2022 12:39
Install go using asdf on linux mint

Install go using asdf on linux mint

sudo apt update
sudo apt install -y curl git
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
cat << EOF >> ~/.bashrc
# ASDF
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
@timohuovinen
timohuovinen / Dockerfile
Last active March 25, 2022 10:46
Adding a user in a linux docker container
FROM yourimage
# Setup the user
ENV USER_NAME=yourusername
ENV GROUP_NAME=yourusergroup # can be the same as USER_NAME
ENV HOME=/var/home/$USER_NAME
# Create the home directory for the new user.
RUN mkdir -p $HOME