Skip to content

Instantly share code, notes, and snippets.

View jaysonwcs's full-sized avatar

Jayson Weslley Cezar Silva jaysonwcs

  • São Paulo/SP - Brazil
View GitHub Profile
@lidgnulinux
lidgnulinux / get_cursor_coordinate_wayland.sh
Created February 5, 2024 02:32
How to get cursor's coordinate on wayland.
#!/bin/bash
# Dependencies :
# - slurp (https://wayland.emersion.fr/slurp/).
# - awk.
# - cut.
# - sed.
# - Wayland compositor with layer_shell support.
# How to use :
@sloonz
sloonz / sandbox.py
Last active July 26, 2024 19:48
Sandboxing wrapper script for bubblewrap ; see https://sloonz.github.io/posts/sandboxing-3/
#!/usr/bin/python
import argparse
import os
import shlex
import sys
import tempfile
import yaml
config = yaml.full_load(open(os.path.expanduser("~/.config/sandbox.yml")))
@morrolinux
morrolinux / linux-full-desktop-container.md
Last active November 9, 2024 01:17
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!

@savegame
savegame / pulse_sreaming.md
Last active October 30, 2024 13:25
PulseAudio / PipeWire streaming audio from Client to remote PulseAudio / PipeWire Server

We have Server machine, this computer with Headphones, and we have Client computer, this is remote PC with music =) On Server we should first open port for listening connections from Client :

# on ubuntu 
sudo ufw allow from <Client_IP> to any port 4656 proto tcp
# on fedora ( with firewalld ) 
sudo firewall-ctl --add-port 4656/tcp

note: port 4656 just for sample. you can use any port you want
than on Server, from current user add listening for connections

@eloylp
eloylp / Fedora35Hibernation.md
Last active November 5, 2024 16:49
Fedora 35 hibernation with swapfile, only for hibernation and resume

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
@sgarciav
sgarciav / pass.md
Last active November 9, 2024 13:39
Initialize your password store

About

Summarizing the instructions of the pass tool (as seen on its website).

Getting Started

Installation

Execute: $ sudo apt install pass

@Demiu
Demiu / move_appdata_win10.md
Last active September 4, 2024 23:48
How to properly move AppData in Windows 10

Moving AppData folder on Windows 10

  1. Create a new user with administrator permissions
  2. Sign out of the current user and sign in as the newly created user
  3. Navigate to C:\Users in File Explorer
  4. Click into the account you want move AppData from
    • There could be a popup telling you that you need to allow yourself to access that user's data, do so
  5. Cut the AppData folder
    • If invisible, go to View and check Hidden Items
  6. Paste in the desired location
@palto42
palto42 / com.borgbase.Vorta.policy
Last active June 28, 2024 04:39
pkexec policy for running Vorta as root, install in folder `/usr/share/polkit-1/actions/`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>Vorta for Borg Backup</vendor>
<vendor_url>https://vorta.borgbase.com/</vendor_url>
<icon_name>com.borgbase.Vorta</icon_name>
<action id="com.borgbase.Vorta">
@benigumocom
benigumocom / debug_from_qr.py
Last active October 28, 2024 02:31
Connect Wireless Debug from Terminal on Android11
#!/usr/bin/env python3
"""
Android11
Pair and connect devices for wireless debug on terminal
python-zeroconf: A pure python implementation of multicast DNS service discovery
https://github.com/jstasiak/python-zeroconf
"""
@fnky
fnky / ANSI.md
Last active November 16, 2024 01:32
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27