Skip to content

Instantly share code, notes, and snippets.

View matinrco's full-sized avatar
Thinkering... 😁

Matin matinrco

Thinkering... 😁
View GitHub Profile
matinrco / 75-noto-color-emoji.conf
Created July 29, 2023 09:27 — forked from charveey/75-noto-color-emoji.conf
How to better enable Color Emojis! Fontconfig ships with some config files that are simply not enough to enable color emojis globally (the 45-generic.conf and 60-generic.conf) and just by installing Noto Color Emoji font will also not enable colorful emojis on all websites or some apps. However, this can easily be configured by creating a config…
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- Add generic family. -->
<match target="pattern">
<test qual="any" name="family"><string>emoji</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
matinrco /
Created December 7, 2022 11:27
Enable bbr in ubuntu 22.04/20.04

Enable bbr in ubuntu 22.04/20.04


  • Linux kernel version must be greater than 4.19

    to check kernel version, run uname -r. sample output:

  • Have the CONFIG_TCP_CONG_BBR and CONFIG_NET_SCH_FQ options compiled and added to the kernel.

matinrco / findInTree.ts
Created December 5, 2022 16:21
Find path to a node in tree with typescript/javascript (WIP)
const options = [
label: "Mobile Phones",
value: "d0a4aca6-2217-11ed-861d-0242ac120002",
code: "Mobile",
subCategories: [
label: "Samsung",
value: "1d4939c9-7613-43f2-b60c-cf25157b9aa2",
code: "Mobile-Samsung",
matinrco /
Created October 8, 2022 18:38
save windows spotlight images

Image location:


Add extension with cmd :

ren *.* *.jpg

To list qualities:

youtube-dl --external-downloader aria2c --external-downloader-args '-x 8 -k 1M' --proxy http://localhost:8080/ -F URL

To download a quality

youtube-dl --external-downloader aria2c --external-downloader-args '-x 8 -k 1M' --proxy http://localhost:8080/ -f 123 URL
matinrco /
Created March 25, 2022 16:44
Fedora linux internal disk mount permission fix

Allow admin users (wheel group members) to mount internal disks without password and disable polkit password prompt. Create a rule (file) in /etc/polkit-1/rules.d/50-udisks.rules with the following contents:

polkit.addRule(function(action, subject) {
  var YES = polkit.Result.YES;
  var permission = {
    "org.freedesktop.udisks2.filesystem-mount-system": YES
  if (subject.isInGroup("wheel")) {
 return permission[];

This is fedora persian font fix configuration.

For unknown reasons google droid sans font takes higher precedence in fontconfig instead of default dejavu sans which has better font face for persian and it's default sans-serif font in fedora.
This happens mostly in kde desktop because of using noto fonts as a default option in desktop environment which has no support for persian glyphs then droid font used as fallback font.
You cannot delete droid fonts because of many packages are depend on it.
To fix this we are going to black list droid arabic kufi to force using dejavu sans.

matinrco /
Created December 18, 2021 21:22
arch/manjaro persian font fix
  • Install vazir-fonts & vazir-code-fonts

  • Create or update $HOME/.config/fontconfig/fonts.conf with the following content:

    <?xml version='1.0'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
        <!-- Fallback fonts preference order -->


matinrco /
Last active December 3, 2021 14:32
Setup proxy for Discord

Setup proxy for Discord

By default, we assume that you have an HTTP proxy that is running on your system on port 8080.

  • Setup proxy for Update.exe: Discord icon on your desktop or start menu does not directly start the main Discord app. Instead, it runs the Update.exe program to perform the upgrade detection. If there is an update, Discord.exe will be started after downloading the update, so we must first setup proxy for Update.exe. Create Update.exe.config beside Update.exe in Discord installation location with following content:
matinrco /
Last active November 20, 2021 18:30
systemd unit template for oneshot execution after boot/sleep/hibernate/hybridsleep

how to use:

  • update yourServiceName in file name & Description in unit file with proper information.
  • add your script to ExecStart. for example:
    ExecStart=/usr/bin/bash -c 'echo "hello world" > /tmp/hello.txt'
  • move unit files to /etc/systemd/system directory.
  • apply proper permissions to each file:

chown root:root /etc/systemd/system/yourServiceName-boot.service