Skip to content

Instantly share code, notes, and snippets.

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

Matin matinrco

🤔
Thinkering... 😁
View GitHub Profile
@matinrco
matinrco / ubuntuBBR.md
Created December 7, 2022 11:27
Enable bbr in ubuntu 22.04/20.04

Enable bbr in ubuntu 22.04/20.04

Requirements:

  • Linux kernel version must be greater than 4.19

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

    5.4.0-132-generic
    
  • Have the CONFIG_TCP_CONG_BBR and CONFIG_NET_SCH_FQ options compiled and added to the kernel.

@matinrco
matinrco / discordProxy.md
Last active February 8, 2025 05:41
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
matinrco / gitProxy.md
Last active January 17, 2025 09:41
Configure git/ssh to use socks/http proxy in windows, linux & wsl2

Windows

Add this to your ssh config file ( which is located in %USERPROFILE%\.ssh\config ) or create one if it's missing:

Http proxy & repo access via ssh:

Host *
    ProxyCommand "C:/Program Files/Git/mingw64/bin/connect.exe" -H {proxyserver}:{port} %h %p

or (for specific host name)

Host gitlab.com

Run OpenModelica GUI with Docker on Mac OS host

  1. First you need docker , brew , XQuartz and socat on your host.

    • docker : Install docker desktop from here
    • brew : Follow installation instruction from here
    • XQuartz : Install by : brew cask install xquartz
    • socat : Install by : brew install socat
  2. Now run this in new terminal :

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:"$DISPLAY"

@matinrco
matinrco / graphLookup.js
Last active March 27, 2024 16:05
Brief example of MongoDB graphLookup to work with tree structure such as e-commerce product categories
// Insert some data
db.product_categories.insertMany([
{
_id: 1,
name: 'Products',
parent_id: null
},
{
_id: 2,
name: 'Digital & Electronics',
@matinrco
matinrco / hideGrubMenu.md
Created October 1, 2020 14:39
Hide grub menu to fix flickerfree boot on fedora

How to enable hidden GRUB menu?

On new Fedora 29 Workstation installs this will be enabled by default. If your system has been upgraded to F29 from an older release, you can enable it by running these commands:

On a system using UEFI booting ("ls /sys/firmware/efi/efivars" returns a bunch of files):

sudo grub2-editenv - set menu_auto_hide=1
sudo grub2-mkconfig -o /etc/grub2-efi.cfg

On a system using legacy BIOS boot:

@matinrco
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">
<fontconfig>
<!-- 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>
</match>
@matinrco
matinrco / toBase64.js
Last active July 14, 2023 16:11
Convert any file to base64 in javascript
var toBase64=function (file , callBack) {
file=file.files[0];
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
callBack(file,reader.result);
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
@matinrco
matinrco / updateAndCleanImages.sh
Created April 29, 2019 12:45
Update all docker images then remove all untagged images
#!/bin/zsh
####################################################
## Notice : use for development environment only. ##
####################################################
#Update all images
docker images --format "{{.Repository}}:{{.Tag}}" | grep -v "<none>" | xargs -L1 docker pull

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.