Skip to content

Instantly share code, notes, and snippets.

View LeSpocky's full-sized avatar

Alexander Dahl LeSpocky

View GitHub Profile
@marckleinebudde
marckleinebudde / gs_usb-protocol.rst
Last active March 5, 2025 08:33
gs_usb protocol definition
enum gs_usb_breq {
    GS_USB_BREQ_HOST_FORMAT = 0,
    GS_USB_BREQ_BITTIMING,
    GS_USB_BREQ_MODE,
    GS_USB_BREQ_BERR,
    GS_USB_BREQ_BT_CONST,
    GS_USB_BREQ_DEVICE_CONFIG,
    GS_USB_BREQ_TIMESTAMP,
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@likema
likema / glibc.cmake
Last active January 6, 2025 18:58
CMake macro to detect glibc version by filename.
# - Check glibc version
# CHECK_GLIBC_VERSION()
#
# Once done this will define
#
# GLIBC_VERSION - glibc version
#
MACRO (CHECK_GLIBC_VERSION)
EXECUTE_PROCESS (
COMMAND ${CMAKE_C_COMPILER} -print-file-name=libc.so.6
@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active April 23, 2025 11:07
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
@highgain86j
highgain86j / nginx config for icecast2
Last active February 3, 2023 13:06
nginx configuration for reverse-proxying icecast2 streaming server.
server {
listen 80;
listen [::]:80;
server_name radio.example.com;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
location / {
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active April 24, 2025 23:43
Hyperlinks in Terminal Emulators
@JonathonReinhart
JonathonReinhart / sample_output
Created July 29, 2016 15:12
Show Ethernet drivers on Linux
$ ~/what_eth_drivers.sh
eth0 [52:54:00:aa:bb:cc]: virtio_net (up)
eth1 [52:54:00:dd:ee:ff]: virtio_net (up)
eth2 [52:54:00:99:88:77]: virtio_net (up)
lo [00:00:00:00:00:00]: (unknown)
@topheman
topheman / git-notes.md
Created June 29, 2015 17:39
Git notes cheat sheet
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active December 13, 2024 20:18
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop