Skip to content

Instantly share code, notes, and snippets.

View gunnarx's full-sized avatar

Gunnar gunnarx

View GitHub Profile
@gunnarx
gunnarx / PEP 0557.md
Last active September 9, 2022 11:42
Python's default values are class attributes... which makes them behave totally weird!
@gunnarx
gunnarx / README.md
Created June 2, 2021 10:56
Fixed links for ramses-composer

commit 1a234d1510eb00771f598acd2bb6aef792e14be0 (HEAD -> main) Author: Gunnar Andersson gandersson@genivi.org Date: Wed Jun 2 12:54:36 2021 +0200

README.md: Fix links to Qt and individual files

Signed-off-by: Gunnar Andersson <gandersson@genivi.org>
#!/usr/bin/python3
units = [
"A",
"N.m",
"PS",
"UNIX Timestamp",
"V",
"celsius",
"cm",
@gunnarx
gunnarx / delete_git_submodule.md
Created July 13, 2018 11:05 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@gunnarx
gunnarx / gist:ec50d269edd9a537c8034b49690b9e1f
Created July 6, 2018 14:04
GDP to R-Car SD card. Pretty awful hack, be careful :)
#!/bin/bash
# SETTINGS WARNING - get HOST DEVICE right or overwrite the wrong disk!
HOST_DEVICE=/dev/sda
HOST_DEVICE_PARTIION=${HOST_DEVICE}1
SDIMG=genivi-dev-platform-r-car.sdimg
DD=dcfldd # Change to dd if you don't have dcfldd installed
MOUNTPOINT=/tmp/rcar_sd_mount
#set -e
@gunnarx
gunnarx / gist:0bf380efeb645682f9f6f203e8f1efcc
Created March 17, 2018 12:10 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
#!/bin/sh
uncrustify -c uncrustify.cfg --no-backup `git ls-tree --name-only -r HEAD | grep \\\.[ch]$ | grep -v gvdb`
# from https://github.com/flatpak/flatpak/ (LGPLv2)
# Example config
newlines lf
input_tab_size 8
output_tab_size 8
@gunnarx
gunnarx / .travis.yml
Created February 9, 2018 17:43
Example Travis Eclipse maven
From:
https://github.com/moto-timo/eclipse-poky-1/blob/timo/maven/.travis.yml
# Although this looks like it does nothing,
# a default behavior in Travis CI is to
# call "mvn install...", so this is actually
# enough to build the project
#
# https://docs.travis-ci.com/user/languages/java/
#
@gunnarx
gunnarx / gist:527fbc385a2e76f89609d837b6447f85
Last active November 18, 2022 06:08
Docker to Virtualbox
@gunnarx
gunnarx / ubuntu-cloud-virtualbox.sh
Created January 30, 2018 07:47 — forked from smoser/ubuntu-cloud-virtualbox.sh
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"