Skip to content

Instantly share code, notes, and snippets.

View gturi's full-sized avatar

Giacomo Venturini gturi

View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 14, 2025 00:29
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@joepie91
joepie91 / vpn.md
Last active May 17, 2025 02:36
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@piotros
piotros / .gitconfig
Last active February 17, 2024 14:36
Some useful git aliases and settings that I use
[user]
useConfigOnly = true
# [includeIf "gitdir:~/Projects/company1/"]
# path = ~/Projects/company1/.gitconfig
[alias]
# add all
aa = add .
@trandaison
trandaison / starUML.md
Last active May 15, 2025 16:36
Get full version of StarUML
@MaxXor
MaxXor / btrfs-guide.md
Last active May 15, 2025 14:57
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@raveenb
raveenb / ssh_into_android.md
Last active May 5, 2025 11:07
SSH into Android

Connecting to an Android device over SSH

Initial Setup

Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it to get the latest version, The APK can be downloaded from https://apkpure.com/termux/com.termux/ Install the APK using by running

adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
@morrolinux
morrolinux / linux-full-desktop-container.md
Last active May 9, 2025 15:59
Run a full linux desktop in a container

In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)

The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.

If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.

Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.

Less go!

@e7d
e7d / remove-obsolete-gpg-key-from-dnf.md
Last active April 19, 2025 04:37
Remove obsolete GPG key from DNF (Fedora)
@jstarcher
jstarcher / EndeavourOS-Nvidia-fixes.md
Created July 9, 2024 02:44
Stable Nvidia + Wayland on EndeavourOS (Arch) with working Suspend

This guide was created for EndeavourOs Endeavour Release which if using the Online installer, as of July 2024, will provide Plasma 6.1 and Nvidia 555 drivers. This guide shows using Grub but will work with systemd-boot as well if you follow steps for kernel params.

  1. Create file /etc/modprobe.d/nvidia.conf with the following contents
options nvidia_drm modeset=1
options nvidia_drm fbdev=1
options nvidia NVreg_EnableGpuFirmware=0
options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp