Skip to content

Instantly share code, notes, and snippets.

View gabrieleara's full-sized avatar

Gabriele Ara gabrieleara

View GitHub Profile
@gabrieleara
gabrieleara / console.c
Created November 30, 2015 19:24
Simple (?) library that handle some command from stdin. The commands can have zero or one parameters that MUST be specified in the same line of the command. The files include a sample main which uses this library
#include "standard.h"
#include "console.h"
#include <sys/select.h>
struct command
{
char string[15];
bool active;
void (*callback)();
};
@gabrieleara
gabrieleara / UbuntuVM.md
Last active March 12, 2018 10:05
This guide is intended for people who want to easily setup an Ubuntu VM using VMWare, without much care about any little detail

Let's get started

First of all, install the system. Remember the password you use when you create your own user, we won't make much use of that password, as you will see, but some GUI programs require it to be run with super user-privileges.

Once you are done, log inside and open a terminal, usually typing Alt+T is enough.

Then launch the command sudo visudo, go to the bottom of the file and append the following two lines:

# Allow any user with sudo privileges to launch a command without password prompt
%sudo ALL=(ALL) NOPASSWD:ALL
@gabrieleara
gabrieleara / Dockerfile
Last active August 1, 2019 02:45
ROS Kinetic container used for my Robotics course
FROM ubuntu:xenial
RUN apt-get update && apt-get install -y software-properties-common
RUN echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list && \
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
RUN apt-get update && \
apt-get install --no-install-recommends -y \
ros-kinetic-desktop-full \
#!/bin/bash
(
set -e
command -v nativefier >/dev/null 2>&1 || {
echo "ERROR: The webinstall command requires nativefier to be installed!"
false
}
#!/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?"
#!/bin/bash
sudo tee /proc/acpi/bbswitch <<<OFF
@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,

ROS Commands Cheatsheet

Initializing system

To start master node:

roscore

Node commands

  • To run a node:
@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

@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;