Skip to content

Instantly share code, notes, and snippets.

View MelvinStans's full-sized avatar

Melvin Stans MelvinStans

  • The Netherlands
View GitHub Profile
#!/bin/bash
echo ”bye!”
reboot
@MelvinStans
MelvinStans / VirtualBox-commands.sh
Created February 28, 2019 11:27
VirtualBox commands
# List virtual machines
VBoxManage list vms
"MyVM" {e4b0c92c-4301-4a7d-8af8-fe02fed00451}
# Start VM in headless mode
VBoxManage startvm MyVM --type headless
# Power off VM
VBoxManage controlvm MyVM poweroff
#!/bin/sh
##########################################################################################
# Create time date stamped log
##########################################################################################
logFile="/private/var/log/OurCompany.log"
log () {
/bin/echo $1
/bin/echo $(date "+%Y-%m-%d %H:%M:%S: ") $1 >> $logFile
@MelvinStans
MelvinStans / resetMacNetwork.sh
Created February 25, 2019 08:18
Mac network location reset
#!/bin/sh
##########################################################################################
# Create time date stamped log
##########################################################################################
logFile="/private/var/log/OurCompany.log"
log () {
/bin/echo $1
/bin/echo $(date "+%Y-%m-%d %H:%M:%S: ") $1 >> $logFile
@MelvinStans
MelvinStans / Sjaakv2.sh
Last active January 10, 2019 14:50
Usefull commands on the Sjaakv2 robot
/opt/TurboVNC/bin/vncserver
roslaunch sjaak_nav explore.launch
@MelvinStans
MelvinStans / git_change_commit_mail
Created June 2, 2018 13:52
Command to change mail on all commits
git filter-branch --env-filter '
WRONG_EMAIL="[email protected]"
NEW_NAME="New Name Value"
NEW_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
@MelvinStans
MelvinStans / piezo.ino
Created May 6, 2018 11:01
Piezo Button
const int piezoPin = A0;
const int threshold = 600;
int sensorReading = 0;
int outputPin = 2;
void setup() {
pinMode(piezoPin, INPUT);
pinMode(outputPin, INPUT);
Serial.begin(9600);
@MelvinStans
MelvinStans / esp8266_analog_graph_oled.ino
Created February 15, 2018 14:56
Display analog input in a time/value graph on a OLED screen.
#include <SPI.h>
#include "SSD1306Spi.h"
// The OLED display width and height
#define int DISPLAY_HEIGHT = 64;
#define int DISPLAY_WIDTH = 128;
SSD1306Spi display(0,16,2); // RESET, DC, CS
byte count;
@MelvinStans
MelvinStans / esp8266_web_oled.ino
Last active April 23, 2023 19:21
Put text on a OLED screen from a website on the ESP8266
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <SPI.h>
#include "SSD1306Spi.h"
// Change here the ssid and password to your own.
const char *ssid = "SSID";
const char *password = "password";
String ss = ssid;