Skip to content

Instantly share code, notes, and snippets.

View peters's full-sized avatar
😀
On

Peter Rekdal Khan-Sunde peters

😀
On
View GitHub Profile
@peters
peters / Sony WH-1000XM4.md
Last active April 24, 2024 14:52
Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)

Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)

This guide will help you connect your Sony WH-1000XM4 headset to Ubuntu 22.04 using Bluetooth. Once connected, you'll be able to listen to music and use the microphone on apps like Microsoft Teams.

1. Connect to Bluetooth Headset

Steps:

  1. Open a terminal and launch bluetoothctl:
@peters
peters / pipewire.md
Created October 29, 2023 10:01 — forked from the-spyke/pipewire.md
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@peters
peters / cudnn.sh
Created July 14, 2021 06:33
cudnn 8.2.2
cd ~/Downloads
rm -rf cudnn_tmp
mkdir -p cudnn_tmp
cd cudnn_tmp
wget https://developer.download.nvidia.com/compute/redist/cudnn/v8.2.2/cudnn-11.4-linux-x64-v8.2.2.26.tgz
tar xf cudnn-11.4-linux-x64-v8.2.2.26.tgz
sudo cp -a cuda/include/* /usr/local/cuda/include/
sudo cp -a cuda/lib64/* /usr/local/cuda/lib64/
cd ..
rm -rf cudnn_tmp
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <sstream>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
@peters
peters / ARMDebianUbuntu.md
Created September 22, 2020 19:46 — forked from bruce30262/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@peters
peters / skiasharp_arm64.md
Created September 4, 2020 17:29 — forked from jclapis/skiasharp_arm64.md
Building SkiaSharp on a Raspberry Pi 4B

Recently, I've been playing around with a Raspberry Pi 4B that I just picked up. It's an awesome little device for the price; I'm really impressed with what it can do so far. I'm planning to use it as a driver for a DIY observatory I'm working on. As part of that, I'm writing an application that can remote control my camera and a custom motorized mount for my telescope. I decided to use .NET Core as my framework of choice; I'm a big fan of C# and its ecosystem, and the fact that .NET Core 3.1 works on ARM64 systems (which is what the Pi 4B runs) makes it a no-brainer.

Unfortunately, .NET Core doesn't come with any cross-platform UI frameworks out of the box. I use WPF a lot for Windows projects, but one of its biggest weaknesses is that it isn't supported on anything else. The WPF repo already has a very long thread about this very topic, so it's definitely one that's on a lot of peoples' minds. That be

@peters
peters / .vsconfig
Created July 8, 2020 10:17
Finter Mobility As - Visual Studio 2019 16.6
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.3.1",
"Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.NuGet",
"Microsoft.Net.Component.4.6.1.TargetingPack",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
@peters
peters / nuget.config
Created June 26, 2020 11:37
Snapx publish/update using a local directory
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="demoapp-publish" value="c:\demoapp_nupkgs" />
<add key="demoapp-update" value="c:\demoapp_nupkgs" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
PS C:\github\snapx.demoapp> snapx restore -i
Adding package sources from C:\github\snapx.demoapp\NuGet.Config
Adding package sources from C:\Users\peter\AppData\Roaming\NuGet\NuGet.Config
Adding package sources from C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Adding package sources from C:\Program Files (x86)\NuGet\Config\Xamarin.Offline.config
Applications that will be restored: demoapp. Runtime identifiers (RID): win-x64, linux-x64.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Id: demoapp.
Rid: win-x64
Packages directory: C:\github\snapx.demoapp\.snapx\packages\demoapp\win-x64
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# 1024x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 64.11 MHz
# Modeline "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync
# 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz
# Modeline "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
# 1368x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 85.86 MHz
# Modeline "1368x768_60.00" 85.86 1368 1440 1584 1800 768 769 772 795 -HSync +Vsync