Skip to content

Instantly share code, notes, and snippets.

View ppcamp's full-sized avatar

Pedro Augusto Campos Dos Santos ppcamp

View GitHub Profile
@ppcamp
ppcamp / jq.md
Created October 5, 2025 14:25
jq Tips
jq '.settings.tenants[] as $t
    | $t.customers[] as $c
    | $c
    | {
        "tenant": $t.name,
        "customer": $c.name,
        "clientKey": $c.clientKey,
        "orgId": $c.orgId,
        "clientId": $c.clientId,
@ppcamp
ppcamp / Flatpak.md
Last active August 3, 2025 14:45
Flatpak related configs and tutos

Install in deb-based

sudo apt install flatpak
# sudo apt install gnome-software-plugin-flatpak # if you want to install gnome software store
# sudo apt install plasma-discover-backend-flatpak # if you want to install in Kde discover
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Fixing dark theme

@ppcamp
ppcamp / Distros Linux.md
Last active July 3, 2025 12:03
Linux and Unix flavours, and its descriptions.
Distro Descr Notes
Fedora server OS server focused on containerziation without gui
CoreOS docker mainly
Fedora IOT for rasp, focused in container
Fedora KDE Plasma Workstation with KDE DesktopEnvironment Wayyy too buggy. I had to restart to recognize the monitors, and VERY often, occurred an issue with the screenlocker feature, that was kept hanging.[^1]
Fedora sway Fedora immutable OS (system as image RO)
Fedora silverblue Immutable with different DE
Rocky Linux Server OS -- CentOS equivalent
@ppcamp
ppcamp / APT sources.md
Created June 26, 2025 21:22
some sources file for apt

File: /etc/apt/sources.list.d

  1. brave.sources
Enabled: yes
Types: deb
URIs: https://brave-browser-apt-release.s3.brave.com
Suites: stable
Components: main
@ppcamp
ppcamp / Hold Packages linux.md
Created June 26, 2025 21:20
Hold Packages linux

In Debian-based systems (like Ubuntu), you can "hold" a package using apt-mark. This prevents the package from being upgraded or removed during system updates. Here's how to do it:

  1. Hold a package: To hold a package, use the following command:

    sudo apt-mark hold <package_name>

    For example, if you want to hold the vim package:

@ppcamp
ppcamp / Wayland discord issue.md
Last active June 26, 2025 21:21
Discord not sharing screen when using wayland and ubuntu

Note

Context: By default, Discord, depending on the operating system version and the way Discord was installed, may have a bug with Wayland. The company's computers do not come with this restriction to force the use of XOrg (system graphics servers). Therefore, the default Discord application cannot access the graphics server, and therefore cannot share the screen.

Important

In the Gnome=46 version (gnome-shell --version), using flatpak (Discord v0.0.96), this error no longer occurs. A guide for Discord screen sharing on Wayland. [1]

@ppcamp
ppcamp / Print system files.md
Created June 24, 2025 23:31
Check passwords and pretty print password-related files in Ubuntu/Linux systems

/etc/gshadow

# show pretty formatted 
column -J -s : --table-columns group_name,password,admin_user_list,member_user_list < /etc/gshadow | jq .table
# show groups
column -J -s : --table-columns group_name,password,admin_user_list,member_user_list < /etc/gshadow | jq '.table[] | .group_name'

/etc/group

@ppcamp
ppcamp / Use different packages versions or envs in a flatpak application.md
Last active May 31, 2025 16:23
Changing java version of dbeaver flatpak app.
asdf install java openjdk-24
asdf set java openjdk-24
asdf which java # prints correct location of java folder (not just bin symlink)

export REAL_JAVA_HOME=$(dirname $(dirname $(asdf which java)))
flatpak override --user io.dbeaver.DBeaverCommunity --filesystem=$REAL_JAVA_HOME:ro
flatpak override --user io.dbeaver.DBeaverCommunity \
  --env=JAVA_HOME=$REAL_JAVA_HOME \
 --env=PATH=$REAL_JAVA_HOME/bin:/app/bin:/usr/bin
@ppcamp
ppcamp / README.md
Created April 16, 2025 20:27
Go datetime problem (subtract month, minus month,)

When you try to subtract a date by a month, the go behavior quem be a bit tricky.

Example

parsedTimestamp, _ := time.Parse(time.DateOnly, "2025-03-31")
subDate := parsedTimestamp.AddDate(0, -1, 0) // 2025-03-03

year, month := parsedTimestamp.Year(), parsedTimestamp.Month()-1
@ppcamp
ppcamp / README.md
Created April 10, 2025 23:50
Create diff from Gists (remote raw files)

Create the diff in some machine

With this, you achieve similar behavior as on using git control (but without the need to have a provider)

diff <(curl -sL $URL) local_file.txt > ~/patch

Apply the diff