Skip to content

Instantly share code, notes, and snippets.

View FrozenDroid's full-sized avatar
💭
is this thing on?

Vincent Stakenburg FrozenDroid

💭
is this thing on?
  • the Netherlands
  • 02:54 (UTC +01:00)
View GitHub Profile
@Francesco149
Francesco149 / docker-cross-device-link.md
Last active October 27, 2023 08:51
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
@darkwater
darkwater / init.vim
Created October 5, 2018 11:56
Neovim config
""
"" Darkwater's Neovim configuration
""
" Plugins {{{
call plug#begin()
" UI plugins
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'majutsushi/tagbar', { 'on': 'Tagbar' }
@MightyPork
MightyPork / WAKING UP TOO A BLOCK.TXT
Created April 16, 2018 19:41
someone was angry
FACE BOOK HACKED MY PAGE THANK YOU ZUCKERBERG !!
I EXPECT NOTHING FROM A BILDERBERG BOY CEO !
LIKE YOU ASSHOLE ZUCKERBERG'S!!
YOU NAZI BOY !@!
class PluginImpl : JavaPlugin() {
override fun onLoad() { instance = this }
companion object {
lateinit var instance : PluginImpl
private set
}
}
#include <inttypes.h>
#include <stdlib.h>
#include "stm32f1xx_ll_utils.h"
/**
* @brief USBD_FS_SerialStrDescriptor
* return the serial number string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
* @retval pointer to descriptor buffer
@MightyPork
MightyPork / bsre.md
Last active July 9, 2016 10:14
BSRE 2016 (W.I.P. blog post!)

IBM BSRE 2016

Intro

In early June 2016 I received a forwarded e-mail in the university inbox about the BSRE, which stands for Best Student Recognition Event. I didn't know at the time what it comprises nor that I'd end up participating myself. I'm also not a best student in any way.

A quick Google search yielded a lone blog post from one of the previous runs of the event, in France, which apparently focused on fighting food waste. It also boasted ominous keywords like "networking" and "teams", which however turned out not to be so bad.

Solving the root User Issue

Running containers use root as the logged in user. This is fine, but in times like you run method like npm init and bower init, this will be cumbersome. This commands generate json configuration files for development. And when you try to edit this files in your host machine, you will notice that you may have Permission denied errors and you should run first chown command to give you permission on these created files.

Fortunately, we have a solution for this, by creating our own user inside the docker container.

In this example, let's say we created a container for our calculator angular app by using this command:

qemu-system-x86_64 -enable-kvm -rtc base=localtime -name Windows -cpu host -m 1G -device virtio-scsi-pci,id=scsi -drive file=/home/vincent/arch.iso,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd -boot menu=on -device nec-usb-xhci -device usb-host,vendorid=0x1532,productid=0x011b -device vfio-pci,host=02:00.0,multifunction=on,x-vga=on -device vfio-pci,host=02:00.1 -nographic
qemu-system-x86_64 -enable-kvm -rtc base=localtime -name Windows -cpu host -m 1G -device virtio-scsi-pci,id=scsi -drive file=/home/vincent/arch.iso,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd -boot menu=on -device nec-usb-xhci -device usb-host,vendorid=0x1532,productid=0x011b
@dasJ
dasJ / qemu_frozendroid
Created November 3, 2015 18:38
Qemu FrozenDroid
qemu-system-x86_64 \
-enable-kvm -M q35 -localtime -usb -name Windows `# General options` \
-monitor /dev/tty -nographic -vga none -serial none `# Graphic options` \
-cpu host,kvm=off -smp 1,sockets=1,cores=1,threads=1 `# CPU Options` \
-m 1024 `# Memory` \
-bios /usr/share/qemu/bios.bin `# BIOS` \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 `# PCIe Bus` \
-device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on `# Graphics card` \
-device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 `# Graphics card sound` \
-soundhw hda `# Sound` \