Skip to content

Instantly share code, notes, and snippets.

View underdoeg's full-sized avatar
💭
I may be slow to respond.

Philip Whitfield underdoeg

💭
I may be slow to respond.
View GitHub Profile
@underdoeg
underdoeg / gist:8174076
Last active January 1, 2016 16:59
black box debian

Notizen zur Installation

Debian

  • Debian Small Installation image laden http://www.debian.org/distrib/
  • Beim Installieren darauf achten, dass keine GUI mitinstalliert wird
  • Nachträglich xorg installieren sudo apt-get install xorg
  • Xorg so konfigureren, dass jeder user startx ausführen kann dpkg-reconfigure xserver-common

DWM

  • dwm runter laden von http://dwm.suckless.org/ oder git clone http://git.suckless.org/dwm
  • dwm anpassen (config.h editieren, showbar=False, topbar = False) und kompilieren mit make

X11

@underdoeg
underdoeg / main.cpp
Created August 5, 2016 09:09
Simple property animation with cluttermm
#include <cluttermm.h>
#include <gdkmm/wrap_init.h>
#include <gdkmm/pixbuf.h>
#include <iostream>
int main(int argc, char *argv[])
{
Glib::init(); //Otherwise Gdk::wrap_init() will fail.
@underdoeg
underdoeg / createKTX.cpp
Created November 24, 2016 20:03
Create mipmap ktx textures from png files with freetype and gli
#include <cstring>
#include "cxxopts.hpp"
#include <iostream>
#include "gli/type.hpp"
//#include "gli/texture2d.hpp"
#include "gli/convert.hpp"
#include "gli/copy.hpp"
#include "gli/generate_mipmaps.hpp"
#include "gli/save.hpp"
#include <FreeImage.h>
@underdoeg
underdoeg / InlineEdit.vue
Created June 27, 2018 08:49
minimal inline edit vue component
<template>
<div class="editable" contenteditable="true" :placeholder="placeholder" @input="update" @focusin="onFocus" @focusout="checkEmpty"></div>
</template>
<script>
export default {
name: "InlineEdit",
props: {
data: String,
placeholder: {
@underdoeg
underdoeg / SCsub
Created June 11, 2016 14:35
godot serial hints
# SCsub
Import('env')
env.Append(CPPPATH = ['libs/libserial/src/')]
env.add_source_files(env.modules_sources,"libs/libserial/src/*.cc")
env.add_source_files(env.modules_sources,"libs/libserial/src/*.cpp")
env.add_source_files(env.modules_sources,"*.cpp")
@underdoeg
underdoeg / readSMS.py
Created October 4, 2011 18:02
retreive sms via python, serial connection and AT commands
import serial
import time
from messaging.sms import SmsDeliver
ser=serial.Serial('/dev/ttyACM0', baudrate=9600, timeout=.1, rtscts=0)
def sendCommand(com):
ser.write(com+"\r\n")
time.sleep(2)
ret = []
#include <iostream>
#include <brigand/brigand.hpp>
template<typename Members>
class TaggedTuple{
template<typename TagType>
struct createMember{
using type = typename TagType::type;
};
@underdoeg
underdoeg / ofxRaspberryPiWindow.cpp
Created October 25, 2012 19:15
basic openframework window to run on the raspberry pi (.cpp file)
/*==============================================================================
Copyright (c) 2011, 2012 Christopher Baker <http://christopherbaker.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@underdoeg
underdoeg / pam_authenticate.cpp
Created August 8, 2019 11:41
test user auth with pam on linux
#include <security/pam_appl.h>
#include <security/pam_misc.h>
#include <string>
int pam_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {
auto pass = static_cast<std::string *>(appdata_ptr);
auto reply = (struct pam_response *) malloc(sizeof(struct pam_response));
reply->resp = strdup(pass->c_str());
reply->resp_retcode = 0;
*resp = reply;
@underdoeg
underdoeg / mapping.py
Last active November 12, 2019 14:13
HDE PS2 controller mapping for linux
from __future__ import print_function
import hid
import time
import uinput
buttons = [
uinput.BTN_START,
uinput.BTN_SELECT,
uinput.BTN_NORTH,