Skip to content

Instantly share code, notes, and snippets.

View gabrieleara's full-sized avatar

Gabriele Ara gabrieleara

View GitHub Profile
@gabrieleara
gabrieleara / Makefile
Last active March 14, 2022 09:55
A Makefile for a Linux kernel module with some quality of life improvements
# ╔═══════════════════════════════════════════════════════╗
# ║ Configuration ║
# ╚═══════════════════════════════════════════════════════╝
MODULE_NAME=<put-module-name-here>
obj-m += $(MODULE_NAME).o
# ┌───────────────────────────────────────────────────────┐
# │ Sources │
# └───────────────────────────────────────────────────────┘
@gabrieleara
gabrieleara / postinstall
Last active April 30, 2020 13:20
Simple post installation script to install some stuff on Ubuntu 20.04+
#!/bin/bash
# First argument is the link to the deb file to download
function download_install_deb() {
wget -O /tmp/installer.deb "$1"
dpkg -i /tmp/installer.deb || apt install -f -y
rm /tmp/installer.deb
}
(
#!/bin/bash
set -e
############################## DEFAULT PARAMETERS ##############################
# Indicates whether we want to install or remove one or multiple packages
# TODO: Also autoremove can be used, to force additional cleanup
install_remove="install"

Developing a Website using GitHub Pages Locally on Ubuntu

This is a simple step-by-step guide to setup your system to develop a website that will be deployed on GitHub Pages locally.

Install ruby and dependencies

First of all you need to install the proper packages using apt:

sudo apt install ruby-full build-essential zlib1g-dev -y
@gabrieleara
gabrieleara / predictability.bash
Last active December 18, 2018 07:41
A small note that helps when testing a program under "predictable" circumstances, for repeatable time testing
# How to make "deterministic" the execution of a program in an Intel-based Linux host
################################################################################
# Following commands are meant to disable the powersave governor for cpufreq,
# so that the CPU frequency is no longer affected by the power saving.
################################################################################
# Sets "performance" as the new cpufreq governor
for CPU_FREQ_GOVERNOR in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do [ -f $CPU_FREQ_GOVERNOR ] || continue;
@gabrieleara
gabrieleara / XVRDocumentation.md
Last active August 9, 2018 11:07
XVR Documentation and Style Guide

XVR S3D Language Documentation

A non-standard standardization attempt

This file is written to ease the developing of a project using XVR Studio 2.0, written in S3D language.

For the style guide, check this other document.

Note: This document is for the most part a direct copy of the content of the wiki documentation of XVR and S3D language, available inside VRMedia Wiki website.

Table of Contents

ROS Commands Cheatsheet

Initializing system

To start master node:

roscore

Node commands

  • To run a node:
@gabrieleara
gabrieleara / settings.json
Created May 12, 2018 14:13
Settings for VS Code editor
{
"editor.acceptSuggestionOnEnter": "smart",
"editor.autoClosingBrackets": true,
"editor.autoIndent": true,
"editor.cursorBlinking": "blink",
"editor.cursorStyle": "line",
"editor.cursorWidth": 0,
"editor.detectIndentation": true,
"editor.dragAndDrop": true,
"editor.emptySelectionClipboard": false,
#!/bin/bash
sudo tee /proc/acpi/bbswitch <<<OFF
#!/bin/bash
### FUNCTIONS ###
# Ask the user a simple yes/no question. Any response other than yes (no case)
# will lead to a negative answer
confirm() {
# Call this function with a prompt string (without y/N) or use the default
# prompt "Are you sure?"