Skip to content

Instantly share code, notes, and snippets.

View sidewinder040's full-sized avatar
🙂

Mark Crouch sidewinder040

🙂
  • Bedfordshire, England
View GitHub Profile
@sidewinder040
sidewinder040 / realtek-alc898-surround-setup-5.1-analog-3.5mmjacks.md
Created March 21, 2024 20:13 — forked from Brainiarc7/realtek-alc898-surround-setup-5.1-analog-3.5mmjacks.md
Analog surround sound setup on Linux with a Realtek ALC898 sound card on the Clevo P751DM2-G

Setting up analog surround sound on Ubuntu Linux with a 3 3.5mm capable sound card:

A while back, I received the Logitech Z506 Speaker system, and with Windows, setting it up was a pretty plug and play experience. On Linux, however, its' a wholly different ballgame. For one, there's no Realtek HD Audio control panel here, so what gives? How do you around this problem?

Introducing the tools of the trade:

You'll want to use a tool such as hdajackretask , pavucontrol and pavumeter for the pin re-assignments and audio output monitoring afterwards respectively. The tools are installed by running:

sudo apt-get install alsa-tools-gui pavumeter pavucontrol
@sidewinder040
sidewinder040 / Makefile
Created January 14, 2023 15:53
A More Elegant Makefile Example
OBJS = account.o main.o
SOURCE = account.cpp main.cpp
HEADER = account_type.h account.h
OUT = money
CC = g++
FLAGS = -ggdb -c -Wall
LFLAGS =
all: $(OBJS)
$(CC) -g $(OBJS) -o $(OUT) $(LFLAGS)
@sidewinder040
sidewinder040 / CMakeLists.txt
Created January 14, 2023 15:50
An Example of Using VCPKG with CMake
cmake_minimum_required(VERSION 3.20.0)
# change this to your path
set(CMAKE_TOOLCHAIN_FILE "E:/src/vcpkg/scripts/buildsystems/vcpkg.cmake")
project(demo)
add_executable(${PROJECT_NAME} main.cpp)
# use your prefix paht if the toolchain doesn't work
@sidewinder040
sidewinder040 / refector.sh
Created September 22, 2022 18:26
Archlinux Reflector - Update Mirrorlist to fastest list
sudo reflector --country "GB" --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
@sidewinder040
sidewinder040 / Makefile
Created June 24, 2022 19:40
Makefile - Simple Example
CC = g++
CFLAGS = -g -Wall -Werror
test: test.o
test.o: test.cpp
clean:
rm test *.o
# Installation on Dell XPS 9570
# Connect to Internet
wifi-menu
# Sync clock
timedatectl set-ntp true
# Create three partitions:
@sidewinder040
sidewinder040 / enums3.rs
Created April 22, 2021 22:10
Rustlings enums3.rs - Solved
// enums3.rs
// Address all the TODOs to make the tests pass!
// Solved by refering to other peoples attempts, then by trial & error
// Passes all the tests.
enum Message {
// TODO: implement the message variant types based on their usage below
ChangeColor((u8, u8, u8)),
Echo(String),
@sidewinder040
sidewinder040 / safe-input.c
Created January 2, 2021 19:45
A safer way to get user data, limited to size of Buffer
// A safer way to get user data, limited to size of Buffer
#include <stdio.h>
#define BUFFER_SIZE 15
int main(int argc, char const *argv[])
{
printf("Please enter your name: ");
char name[BUFFER_SIZE];
fgets(name, sizeof(name), stdin);
@sidewinder040
sidewinder040 / StaticVector
Created October 17, 2020 13:52
C++ Static Vector Class
#include <iostream>
#include <vector>
using namespace std;
class List
{
private:
static vector<int> Numbers;
public:
colorscheme delek
:let mapleader = " "
set timeout timeoutlen=500 " Set timeout length to 500 ms
function! ToggleLineNumber()
if v:version > 703
set norelativenumber!
endif
set nu!