Skip to content

Instantly share code, notes, and snippets.

View Ghostbird's full-sized avatar

Gijsbert ter Horst Ghostbird

View GitHub Profile
$ ./FreeCAD-0.21.2-Linux-x86_64_41d545329e0f040cf5f08885bf4ba84b.AppImage
(AppImageLauncher:1626793): dbind-WARNING **: 17:28:03.699: Couldn't connect to accessibility bus: Failed to connect to socket /root/.cache/at-spi/bus_0: Permission denied
FreeCAD 0.21.2, Libs: 0.21.2R33771 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2023
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
@Ghostbird
Ghostbird / kdeconnect-share-to-only-device.nemo_action
Created September 13, 2023 08:10
Nemo action to send files to single available KDE connect paired device
# Put file in ~/.local/share/nemo/actions/ (single user) or /usr/share/nemo/actions/ (system install)
# Note: This will only work for a single connected KDE connect device.
[Nemo Action]
Active=true
Name=KDE Connect: Send file(s) to device
Comment=Send file(s) to the first found KDE Connect device.
Exec=sh -c 'kdeconnect-cli -d $( kdeconnect-cli --list-available --id-only ) --share %U && notify-send "File(s) transferred to $( kdeconnect-cli --list-available --name-only )" "$( for f in %F; do echo $f; done )" || notify-send "Failed to transfer, device may be offline" "$( for f in %F; do echo $f; done )"'
Icon-Name=kdeconnect
Selection=notnone
Extensions=any;
@Ghostbird
Ghostbird / pokemon-slots-android.sh
Created January 4, 2023 22:40
Automatically play the slot machine in Pokémon FireRed/LeafGreen (and maybe others) running on Android in an emulator.
#!/bin/sh
# Automatically play the slot machine in Pokémon FireRed/LeafGreen (and maybe others) running on Android in an emulator.
#
# REQUIREMENTS:
# - Android device with pokemon in suitable emulator e.g. John GBA / John GBAC
# - PC with:
# - POSIX compliant shell (duh)
# - adb installed and in PATH
#
#
@Ghostbird
Ghostbird / _obsolete.md
Last active November 5, 2024 17:03
Build FFMPEG with NVIDIA hardware accelleration libraries on Debian 12. Includes non-free libnpp!

Obsolete

It is no longer necessary to use this script to have hardware acceleration in ffmpeg on Debian. The default Debian ffmpeg and dependencies now support this out of the box.

See: #gistcomment-5095112

@Ghostbird
Ghostbird / add-repository
Last active October 19, 2024 18:04
Simple bash script to add apt keys + repositories in a better way than using apt-key. It is intended to make it easy to convert instructions online that still use apt-key, to the newer mechanism.
#!/bin/bash
# Simple script to add apt keys in a better way than using apt-key
# It is intended to make it easy to convert instructions online
# that still use apt-key, to the newer mechanism.
# Download from: https://gist.githubusercontent.com/Ghostbird/83eb5bcd2ffd4a6b6966137a2e1c4caf
# MIT LICENCE:
# Copyright © 2022 Gijsbert “Ghostbird” ter Horst
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIM
2022-09-23 10:43:36,288 [OneDriveGUI.py:2709][fn=get_installed_client_version][DEBUG] - [GUI] Installed client version is 2420
2022-09-23 10:43:36,289 [OneDriveGUI.py:2744][fn=create_global_config][DEBUG] - [GUI] - loading default config {'onedrive': {'sync_dir': '"~/OneDrive"', 'skip_file': '"~*|.~*|*.tmp"', 'monitor_interval': '"300"', 'skip_dir': '""', 'log_dir': '"/var/log/onedrive/"', 'drive_id': '""', 'upload_only': '"false"', 'check_nomount': '"false"', 'check_nosync': '"false"', 'download_only': '"false"', 'disable_notifications': '"false"', 'disable_upload_validation': '"false"', 'enable_logging': '"false"', 'force_http_11': '"false"', 'local_first': '"false"', 'no_remote_delete': '"false"', 'skip_symlinks': '"false"', 'debug_https': '"false"', 'skip_dotfiles': '"false"', 'dry_run': '"false"', 'min_notify_changes': '"5"', 'monitor_log_frequency': '"5"', 'monitor_fullscan_frequency': '"10"', 'sync_root_files': '"false"', 'classify_as_big_delete': '"1000"', 'user_agent': '""', 'remove_source_files': '"
@Ghostbird
Ghostbird / make-appimage-executable.sh
Created September 23, 2022 08:17
Script that prompts to mark AppImage executable, and subsequently launch it
#!/bin/bash
# Put this script somewhere, and mark it as the default program to open AppImage files.
# Now if you click an AppImage that's not marked as executable,
# it will prompt whether you want to make it so, and launch it.
zenity --question \
--title 'AppImage is not executable' \
--text 'This AppImage is not marked as executable. Do you want to mark it as executable and launch the program?' \
--width=512
if [[ $? = 0 ]]
then
@Ghostbird
Ghostbird / git-branch-delete-merged
Last active September 9, 2022 13:59
Script to delete merged branches
#/bin/bash
branches=$(git branch --merged | grep -Ev "^\*|develop|master|main")
if [ "$branches" ]
then
git branch -d $branches
else
echo "Nothing to delete"
fi
@Ghostbird
Ghostbird / wrap-css.js
Last active December 3, 2021 15:31
Node script to load a CSS file as if it is a JS file. Workaround for Angular 13 extractCss deprecation.
#!/usr/bin/env node
process.stdout.write(
`const styleElement = document.createElement('style');styleElement.appendChild(document.createTextNode(\``,
() => process.stdin.pipe(process.stdout, { end: false })
);
process.stdin.on('end', () =>
process.stdout.write(
`\`));document.getElementsByTagName('head')[0].appendChild(styleElement);\n`,
() => process.stdout.end()
)
@Ghostbird
Ghostbird / build-hidapi-android.sh
Last active August 26, 2022 00:45
Build libusb/hidapi for Android
#!/bin/bash
# Run this in a directory where you don't mind cloning a few git repositories. e.g. /tmp
if [[ -f ${AndroidNdkDirectory}/ndk-build ]]
then
git clone [email protected]:libusb/libusb.git
git clone [email protected]:libusb/hidapi.git
cd hidapi/android/jni
# Apply patch from my gist to point Android.mk to correct libusb directory.
curl https://gist.githubusercontent.com/Ghostbird/2485d23afc39fbdac3bda136a46e6577/raw/a0fcbfd4c49b7f78b5faeb4befe3e47d33e93d87/Android.mk.patch | git apply -
# Print the file and ask for the user to confirm that the patch was not ransomware