Skip to content

Instantly share code, notes, and snippets.

View highercomve's full-sized avatar
🏠
Working from home for Pantacor 👍

Sergio Marin highercomve

🏠
Working from home for Pantacor 👍
View GitHub Profile
@highercomve
highercomve / gist:9a816f6d1fec740cd36acd0abc3e779a
Created February 6, 2024 19:55 — forked from tranthamp/gist:2721326
D-Bus and Connman notes
# Connman Technology API examples: (Object Path: /net/connman/technology/<wifi/ethernet>, Interface: net.connman.Technology)
# GetProperties
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.GetProperties
# Scan
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.Scan
# Disable/Enable wifi
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:true
#!/bin/bash
set -e
echo "Loading latest revision from github"
version=`curl -L 'https://api.github.com/repos/MediaBrowser/Emby.Releases/releases' -H 'Accept: application/vnd.github.v3+json' -H 'Accept-Language: en-US,en;q=0.5' | jq '[.[] | select(.prerelease == false)][0].assets | (.[] | select(.name | contains("arm64.deb")))'`
downloadurl=`echo "$version" | jq -r .browser_download_url`
versionnumber=`echo "$version" | jq -r .name`
#!/bin/bash
set -e
cmd=`basename $0`
usage() {
echo "USAGE: $cmd power time_window"
echo " power: Power Limit in watts (PL1,PL2)"
echo " time_window: PL1 time window in sec (default: 28 max:128)"
@highercomve
highercomve / plex_install.sh
Last active May 26, 2023 17:13
Install plex on linux
#!/bin/bash
set -e
PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server-new"
PLEX_ARCH="arm64"
echo "Searching for latest version of plex"
if [ -z ${PLEX_RELEASE+x} ]; then \
#!/bin/sh
NETPLAT=${NETPLAT:-awconnect}
IPTABLES_RULESV4_BASENAME=${IPTABLES_RULESV4_BASENAME:-rules.v4}
IPTABLES_RULESV6_BASENAME=${IPTABLES_RULESV6_BASENAME:-rules.v6}
outdir=$PWD/_config/${NETPLAT}/etc/iptables/
if [ -z "$outdir" ]; then
echo "ERROR: need outdir"
#!/bin/bash
set -x
cpio_file=$(mktemp /tmp/magiccpio.XXXXXXX)
cd $1
find . | cpio -o -H newc > $cpio_file
xz --keep --check=crc32 --lzma2=dict=512KiB $cpio_file
#!/usr/bin/env bash
# usage:
# wg-ubuntu-server-up.sh [<number_of_clients>]
clients_count=${1:-10}
working_dir="$HOME/wireguard"
mkdir -p "${working_dir}"
mkdir -p "/etc/wireguard"
#!/bin/bash
[ "$UID" -eq 0 ] || exec sudo "$0" "$@"
imagefile=$1
mountpoint=$2
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: "
echo "mount_image IMAGE_FILE_PATH MOUNT_POINT"

How to use this script

This is a very small utility to run a qemu virtual machine for x64 images. It let you start the vm with a qcow2 disk and a image as instalation media.

Requirements

You need to have qemu installed in your PC and a CPU with virtualization enabled.

How to download it

#!/bin/bash
[ "$UID" -eq 0 ] || exec sudo "$0" "$@"
apt update
apt upgrade
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \