Skip to content

Instantly share code, notes, and snippets.

View coenraadhuman's full-sized avatar
🐧

Coenraad Human coenraadhuman

🐧
View GitHub Profile
@coenraadhuman
coenraadhuman / setup-fan-control.sh
Created January 31, 2022 19:33
Dell G5 15 - Fan Control Ubuntu
#!/usr/bin/env bash
set -euo pipefail
function main() {
must_root
sudo apt install i8kutils
sudo snap install dell-bios-fan-control
sudo snap connect dell-bios-fan-control:io-ports-control
}
@coenraadhuman
coenraadhuman / select-java.sh
Created November 19, 2021 07:45
Switch between Java versions installed on Ubuntu Based Linux
#!/usr/bin/env bash
set -euo pipefail
function main() {
must_root
sudo update-alternatives --config java
}
function must_root() {
@coenraadhuman
coenraadhuman / version.sh
Last active November 18, 2021 11:23
Stupid script to see if you have SNAPSHOT in your artifact version or dependencies in you Maven pom.xml
#!/usr/bin/env bash
set -euo pipefail
function main() {
echo "Branch to be checked: $1"
echo "Running evaluation on artifact pom:"
# Reason for code block with || true on grep commands is because it exists with 1 if nothing is found.
@coenraadhuman
coenraadhuman / w-to-u.sh
Last active September 10, 2021 14:18
Change Windows line-ending to Unix version
sed -i.bak 's/\r$//' file.txt
@coenraadhuman
coenraadhuman / dell-vostro-5590-linux-fixes.sh
Last active May 8, 2021 12:16
Dell Vostro 5590 - Linux Notes
#!/bin/bash
# See link in comments for more information from articles.
# NVME Issues
# After install, it was necessary to boot with USB and chroot (https://www.techzim.co.zw/2021/01/how-to-restore-ubuntus-efi-partition-in-ubuntu-20-04/):
sudo fcsk /dev/nvme0n1p2
sudo mount /dev/nvme0n1p2 /mnt
@coenraadhuman
coenraadhuman / linux-utilities.sh
Created September 20, 2020 11:41
Collection of terminal utilities that are handy.
#!/bin/bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install bat
@coenraadhuman
coenraadhuman / rpi-tizonia-buster.sh
Last active April 29, 2020 03:31
Install Tizonia on RPi with working Google Music
#! /bin/bash
echo "Adding required repositories."
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list
curl 'https://bintray.com/user/downloadSubjectPublicKey?username=tizonia' | sudo apt-key add -
echo deb https://dl.bintray.com/tizonia/raspbian buster main | sudo tee -a /etc/apt/sources.list
echo "Updating repositories."
sudo apt update
@coenraadhuman
coenraadhuman / rpiwpafix.txt
Created April 10, 2020 11:14
RPi - Could not communicate with wpa_supplicant: error n2 wifi
Solution
I referred to this official forum.
Raspbian Stretch: Wifi not starting on boot – Raspberry Pi Forums
First,
sudo vim /etc/network/interfaces
@coenraadhuman
coenraadhuman / HttpClientApproach.cs
Created September 28, 2019 06:05 — forked from acamino/HttpClientApproach.cs
4 Ways to Parse a JSON API with C#
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace HttpClientApproach
{
internal class Contributor
{
public string Login { get; set; }
@coenraadhuman
coenraadhuman / chroot.md
Created September 16, 2019 10:52
Chroot recover with Manjaro
  • Become root.
[user@hostname ~]$ sudo -s

Or

[user@hostname ~]$ su