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 | |
# | |
# LYWSD03MMC read out temperature & humidity | |
# report it to Home Assistant as a new sensor over MQTT | |
# | |
# 1. Setup the MAC address (hcitool lescan if you don't know) and MQTTT parameters | |
# 2. Initialize the MQTT structure: ./push-to-ha.sh init | |
# 3. Send in the reading: ./push-to-ha.sh | |
# | |
# Setup a periodic cron job -> profit! |
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
#!/usr/bin/python3 | |
import sys, signal, traceback, serial, time | |
def signal_handler(sig, frame): | |
global ser | |
print('Ctrl-C, quitting.') | |
if ser: | |
ser.close() |
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 | |
# | |
# Simple script to download the running configuration from the HP 1920S switch | |
# through the HTTP "APIs" | |
# | |
# Run it as: | |
# $ ./hp1920-getconfig.sh --host="10.1.2.3" --user="admin" --pass="hello" --file=startup-config | |
# | |
# Attila Sukosd <[email protected]> | |
# |
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 | |
PID=$1 | |
while [ 1 ]; do | |
ps -q $PID -eo %cpu,%mem |tail -n1 >> process.log | |
sleep 0.1; | |
done |
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
Your code looks reasonable to me. Any chance you could throw a binary and a couple of instructions onto github or similar so I can give it a quick test and see what state the GPU is in? | |
Also have you tried sudo vcdbg log msg to see if there are any useful messages logged by the GPU? If you do sudo vcgencmd set_logging level=0xc0 first, then you should get all the logging from the IL components that's going. | |
http://www.raspberrypi.org/forums/viewtopic.php?f=38&t=81310 |
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
CGDirectDisplayID display[32]; | |
uint32_t displayCount = 0; | |
CGGetActiveDisplayList(32, display, &displayCount); | |
for(int i = 0; i < displayCount; i++) { | |
io_service_t service = CGDisplayIOServicePort(display[i]); | |
CFStringRef nameRef = IORegistryEntryCreateCFProperty(service, CFSTR("CFBundleIdentifier"), kCFAllocatorDefault, 0); | |
if(CFStringCompare(nameRef, CFSTR("info.ennowelbers.framebuffer"), 0)==0) { | |
// success! - display[i] is the display using the proxy framebuffer | |
} | |
} |
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 <stdio.h> | |
int main(int argc, const char *argv[]) { | |
char buffer[512], found = 0; | |
for(int i=0;i<argc;i++) | |
if (strcmp(argv[i], "-Wabc") == 0) { found = 1; break; } | |
if (!found) return 1; | |
while (!feof(stdin)) { | |
int bytes = fread(buffer, sizeof(char), 512, stdin); | |
fwrite(buffer, sizeof(char), bytes, stdout); | |
fflush(stdout); |
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
// From https://raw.githubusercontent.com/ahmedammar/imx-testing-apps-misc/master/libvpu_encode.c | |
include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <fcntl.h> /* fcntl */ | |
#include <sys/mman.h> /* mmap */ | |
#include <sys/ioctl.h> /* fopen/fread */ | |
#include "vpu_io.h" |
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 | |
# Stash uncommited changes | |
git stash -q --keep-index | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object |
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 syntax=on | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab |