This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Setup GTest/GMock | |
set -Eeuxo pipefail | |
# Require root | |
[ "$UID" -eq 0 ] || exec sudo "$0" "$@" | |
# Check required packages are installed | |
dpkg -s libgtest-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
include(ExternalProject) | |
######################################################################################### | |
# GLEW | |
######################################################################################### | |
set(GLEW_PREFIX ${CMAKE_BINARY_DIR}/glew) | |
set(GLEW_INCLUDE_DIR ${GLEW_PREFIX}/include CACHE STRING "GLEW Include Directory") | |
set(GLEW_LIBRARY ${GLEW_PREFIX}/lib64/libGLEW.a CACHE STRING "GLEW Static Library") | |
set(GLEW_LIB_DEPENDENCIES CACHE STRING "GLEW Library Dependencies" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
include(ExternalProject) | |
######################################################################################### | |
# GLFW3 | |
######################################################################################### | |
option(BUILD_GLFW3 "Download and build GLFW3" OFF) | |
# Use GLFW from system | |
if(NOT BUILD_GLFW3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
include(ExternalProject) | |
######################################################################################### | |
# GLAD | |
######################################################################################### | |
option(DOWNLOAD_GLAD "Download and build GLAD" OFF) | |
# Build settings | |
set(GLAD_PREFIX ${CMAKE_BINARY_DIR}/GLAD) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Set FullHD resolution (1920x1080) into a HD monitor of native resolution 1366x768. | |
# | |
xrandr --output eDP1 --mode 1366x768 --panning 1920x1080 --scale 1.41 | |
# | |
# Set a scaled down resolution of 1920x1080 to 21:9 monitor (2560x1080) | |
$ | |
xrandr --output HDMI1 --mode 1920x1080 --panning 1920x1080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <utility> | |
#include <GLFW/glfw3.h> | |
#include <unistd.h> | |
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {} | |
static void error_callback_glfw(int error, const char* description) {} | |
static void framebuffer_size_callback(GLFWwindow* window, int width, int height) {} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
getline < "/tmp/cpu-usage-cache" | |
close("/tmp/cpu-usage-cache") | |
prev_idle = $1 | |
prev_total = $2 | |
getline < "/proc/stat" | |
close("/proc/stat") | |
idle = $5 | |
total = 0 | |
for (i=2; i<=NF; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Module showing CPU load as a changing bars. | |
# Just like in polybar. | |
# Each bar represents amount of load on one core since | |
# last run. | |
# Cache in tmpfs to improve speed and reduce SSD load | |
cache=/tmp/cpubarscache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install ArchLinux ARMv7 on the SD card | |
Follow the guide lines in: https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3 | |
2. Configure Serial UART0 to the Linux console | |
Only need to disable the bluetooth on UART0 to free it to operate as linux console: | |
Add the following to /boot/config.txt to disable the onboard bluetooth on UART0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# array of connected monitors | |
monitors=( $(xrandr | grep ' connected ' | cut -d' ' -f1) ) | |
# for the integrated display, set a higher resolution | |
if [ ${#monitors[@]} -eq 1 ]; then | |
xrandr --output $monitors --mode 1366x768 --panning 1920x1080 --scale 1.41 | |
# for multiple monitors, enable them all |