Skip to content

Instantly share code, notes, and snippets.

View DevSrSouza's full-sized avatar

Gabriel DevSrSouza

View GitHub Profile
---
PVE delte local-lvm partition
Reference: https://post.smzdm.com/p/awkv4pq4/
lvremove pve/data
lvextend -l +100%FREE -r pve/root
Datacenter >> remove `local-lvm` partition >> edit `local` >> select all options
@DevSrSouza
DevSrSouza / ..xcodegen for compose kmp
Last active November 1, 2025 21:48
Xcodegen configuration for a Compose Multiplatform app sample
Xcode gen Compose Multiplatform
@DevSrSouza
DevSrSouza / ServiceExtensions.kt
Last active July 2, 2025 09:29
Connecting to a service using Kotlin Coroutines
import android.app.Service
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.IBinder
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
suspend inline fun <reified S : Service, B : IBinder> Context.connectService(
#!/usr/bin/env bash
# Copyright (c) 2021-2023 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
@DevSrSouza
DevSrSouza / get-theme.main.kts
Created February 2, 2022 04:40
Kotlin Script that get Linux System Theme based on Dbus appearance color-schema from Gnome 42, KDE and Elementary
@file:DependsOn("com.github.hypfvieh:dbus-java-core:4.0.0")
@file:DependsOn("com.github.hypfvieh:dbus-java-transport-jnr-unixsocket:4.0.0")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.0")
import org.freedesktop.dbus.annotations.DBusInterfaceName
import org.freedesktop.dbus.connections.impl.DBusConnection
import org.freedesktop.dbus.interfaces.DBusInterface
import org.freedesktop.dbus.types.Variant
val connection = DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION)
@DevSrSouza
DevSrSouza / faster_tool_starwey_valley.sh
Last active August 19, 2024 14:04
Stardew Valley Linux script for faster tool (Animation cancelation)
pressTool()
{
xdotool keydown 'c'
sleep 0.090
xdotool keyup 'c'
sleep 0.042
xdotool keydown 'Shift_R+Delete+R'
sleep 0.005
xdotool keyup 'Shift_R+Delete+R'
}
@DevSrSouza
DevSrSouza / JsonItemStack.java
Created December 3, 2017 01:48
Parse Bukkit ItemStack to JSON
import com.google.gson.*;
import org.bukkit.Color;
import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.block.banner.Pattern;
import org.bukkit.block.banner.PatternType;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
@DevSrSouza
DevSrSouza / build.gradle
Created February 6, 2019 19:54
Kotlin + Spigot 1.8.8 + Minecraft dev IntelliJ Plugin
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.20'
id 'com.github.johnrengelman.shadow' version '4.0.3'
}
group = pluginGroup
version = pluginVersion
sourceCompatibility = 1.8
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ProvidableCompositionLocal
import androidx.compose.runtime.remember
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Modifier
@DevSrSouza
DevSrSouza / mtvehicles-migrate-to-oraxen.main.kts
Last active June 11, 2023 05:34
Generate Oraxen configuration for MTVehicles Texture with Furniture support
/** This script will migrate MTVehicles resource pack to Oraxen
* This will include:
* - Fixing ItemFrame position of the models
* - Fix new texture folder that will not anymore bem on custom/cars/, instead it will be at default/mtvehicles
* - For each model that is only a texture replacement, it will generate an Orxen config with Generate enabled with the given name. So... no more bunch of Cars models with only texture change
* - Will remove from models the: "particle": "items/particle" and "texture": "items/texture", that Oraxen says is not proper format.
*/
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")