Skip to content

Instantly share code, notes, and snippets.

@queeup
queeup / mirroring.yml
Created August 24, 2023 23:15 — forked from carlos-a-g-h/mirroring.yml
Download a file and upload as a github release (THIS IS NOT LEGAL)
# WARNING: This is not how you should use a CI/CD plaftform, use privately and at your own risk
name: URL uploader
on:
workflow_dispatch:
inputs:
LINK:
type: string
required: true
FILENAME:
type: string
@queeup
queeup / KILL_ALL_PROCESSES_MATCHING_STRING_LINUX.sh
Created August 24, 2023 23:15 — forked from haballan/KILL_ALL_PROCESSES_MATCHING_STRING_LINUX.sh
Shell Script to Kill All Processes having Specific Pattern/String in Their Name or Description
# #############################################################################################################################################
# This script KILLS all linux processes that match specific pattern provided by the user:
# Ver 1.0
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 08-05-23 # # # # #
# Modified:
# #############################################################################################################################################
# Terminate the Script if the OS is not Linux:

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
    
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)

@queeup
queeup / !README.md
Created May 4, 2023 22:42 — forked from baatochan/!README.md
Linux (Manjaro [Arch]) on a Thinkpad P14s [T14] Gen2 with Intel

Linux (Manjaro [Arch]) on a Thinkpad P14s [T14] Gen2 with Intel

These are my installation-tricks and notes for running Linux on a 2021 Thinkpad P14s Gen2 with 11th gen Intel Core i7-1185G7. It should also be suitable for the Thinkpad T14 Gen2 with Intel as they are technically the same model.

Additionally you may find more AMD specific tips on the gist I've forked. I decided to keep this gist forked as I have used some of the tips they shared and because they inspired me to create my note in the first place.

Sadly there is no entry in the arch-wiki for Intel specific model, but some of the info from AMD one were useful for me. Other useful sources are mentioned in the document in their respective chapters.

Not everything in this doc may be 100% correct as I'm writing this note after having my PC set up and I might have forgotten some of the stuff. I will update it I ever decide to reinstall the OS on my PC.

@queeup
queeup / fedora_silverblue.sh
Created May 2, 2023 18:21
setup script for fedora 37 silverblue
#!/bin/bash
# repo
echo -e "deltarpm=True
fastestmirror=True
max_parallel_downloads=10
defaultyes=True" | sudo tee -a /etc/dnf/dnf.conf
sudo rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y
@queeup
queeup / power_limit.conf
Created May 1, 2023 19:12 — forked from garrett/power_limit.conf
ThinkPad 14s overheating issues
# /etc/tmpfiles.d/power_limit.conf
# MSR
# PL1
w /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw - - - - 44000000
w /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_time_window_us - - - - 28000000
# PL2
w /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_1_power_limit_uw - - - - 44000000
w /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_1_time_window_us - - - - 2440
# MCHBAR

How to make a new rpm-ostree desktop variant in Fedora?

So you want to make a new rpm-ostree desktop variant in Fedora to join Silverblue, Kinoite and Sericea? Here are the steps that you should follow.

First, you should figure out what packages should be installed in your image. To do that, you can start from the base container image (https://quay.io/repository/fedora-ostree-desktops/base) and add packages from the comps group corresponding to your desktop in Fedora : https://pagure.io/fedora-comps

At this point, you should consider which apps are going to be shipped by default, included in the image, and which ones are going to be installed by default as Flatpaks.

Once you've got something working, reproduce that in https://pagure.io/workstation-ostree-config using the comps group and the filter and sync script. Look at other variants for example.

@queeup
queeup / README.md
Created April 26, 2023 14:03 — forked from cyberworm-uk/README.md
Fedora IOT AArch64 Kernel 6.2 Boot Fix

Fedora IOT AArch64 Kernel 6.2 Boot Fix

As reported by Fedora CoreOS team, on the AArch64 / ARM64 architecture the new 6.2 kernels will not boot due to older bootloaders in Fedora IoT.


Update

There is now some guidance from the Fedora IoT team on this here. This is probably the better course of action to take than my method below.

@queeup
queeup / create_n_change_gnome-terminal_profile.md
Last active January 28, 2023 18:39
Create profile and change gnome-terminal profile settings programmatically

Create profile and change gnome-terminal profile settings programmatically

new_profile_uuid=$(uuidgen)
new_profile_list=$(gsettings get org.gnome.Terminal.ProfilesList list | tr -d ']') && new_profile_list+=", '${new_profile_uuid}']"
gsettings set org.gnome.Terminal.ProfilesList list "${new_profile_list}"
gsettings set org.gnome.Terminal.ProfilesList default "${new_profile_uuid}"
SETTINGS=( "visible-name 'elementary'"
           "default-size-columns '120'"
           "default-size-rows '30'"