Skip to content

Instantly share code, notes, and snippets.

if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
//
// How to access GPIO registers from C-code on the Raspberry-Pi
// Example program
// 15-January-2012
// Dom and Gert
// Revised: 15-Feb-2013
// Access from ARM Running Linux
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sched.h>
#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
@mrkskwsnck
mrkskwsnck / README.md
Created March 26, 2016 15:33 — forked from trieloff/README.md
A command line alternative to LampStealer

The LampStealer app for Hue does not work with newer versions of the bridge, as the API has changed. This shell script works with fewer dependencies and achieves the same. Install jq and run the shell script after pushing the big button on the bridge.

@mrkskwsnck
mrkskwsnck / update_all_repos.lua
Created September 29, 2017 10:08
Iterate over all user's GitHub repositories and update them locally
#!/usr/bin/env lua
--[[
Dependencies via Luarocks:
* luasocket
* luasec
* luajson
* luafilesystem
@mrkskwsnck
mrkskwsnck / index.html
Created November 28, 2018 12:56
HTML dummy file (Flipping Tables)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Flipping Tables</title>
</head>
<body>
<p>(╯°□°)╯︵ ┻━┻</p>
</body>
</html>
@mrkskwsnck
mrkskwsnck / powertest.sh
Last active August 12, 2019 13:45
Test the Raspberry Pi's power supply for stability
#!/bin/bash
#
# Description: Test the Raspberry Pi's power supply for stability
# Source: https://github.com/bamarni/pi64/issues/4#issuecomment-292707581
#
# Watch your Pi! RPi foundation knows that Micro USB for DC-IN
# is sh*t but also doesn't give a sh*t. Voltage drops caused by
# average USB cables cause all sorts of instabilities and also
# data corruption but instead of fixing the problem they masked
# it in their 'firmware'. The main CPU on the Raspberry monitors
@mrkskwsnck
mrkskwsnck / http_proxy_extra_header_demo.php
Created February 26, 2021 10:39
Extra HTTP header from proxy
<?php
/*
* Description: Demonstration of the "extra HTTP header" issue using a
* web proxy. The problem becomes significant when the
* header is output with the body alltogether.
*
* Solution: See https://stackoverflow.com/a/17059693/3375584
*/
@mrkskwsnck
mrkskwsnck / README.md
Last active November 5, 2021 16:40
Example read me file by Golo Roden

<Add module name here>

<Add module description here>

Installation

$ npm install <Add module name here>