Skip to content

Instantly share code, notes, and snippets.

View mattiasghodsian's full-sized avatar
🏠
Working from home

mattiasghodsian

🏠
Working from home
View GitHub Profile
@mattiasghodsian
mattiasghodsian / readme.md
Created July 13, 2021 22:37
Turn off .NET SDK telemetry On Debian/Ubuntu
"The .NET SDK includes a telemetry feature that collects usage data and exception information when the .NET 
CLI crashes. The .NET CLI comes with the .NET SDK and is the set of verbs that enable you to build, test, 
and publish your .NET apps. It's important that the .NET team understands how the tools are used so they 
can be improved. Information on failures helps the team resolve problems and fix bugs."

The .NET SDK telemetry feature is enabled by default but should be prompt witch Yes/No while setting up. To turn off Telemetry open up the terminal and run

@mattiasghodsian
mattiasghodsian / readme.md
Created May 10, 2021 16:53
Setup RAIDZ on Ubuntu Server 20.04 LTS

Setup RAIDZ on Ubuntu Server 20.04 LTS

In this walkthrough we'll be using 4 brand new Seagate IronWolf Pro 10TB 7200rpm 256MB hard drives to setup a ZFS storage pool (RAIDZ 10).

1. ZFS

If you don't have ZFS already installed go ahead and run

sudo apt install zfsutils-linux

2. Disk Identifier & Sector sizes

Before we do anything with the drives we need the disk identifier and sector size for each drive for step 3.

@mattiasghodsian
mattiasghodsian / .bash_aliases
Last active August 31, 2023 07:58
My bash aliases
###########################################################################
# #
# ------- Aliases -------- #
# --------- #
# ------- https://gist.github.com/mattiasghodsian ------- #
# #
# # Usage: #
# dpanic : FBI panic remove containers (0.0) #
# dex <container>: execute shell inside <container> #
# dnames : names of all running containers #
@mattiasghodsian
mattiasghodsian / readme.md
Last active July 6, 2024 19:26
Valheim Dedicated Server Setup on Ubuntu 20.04.1 LTS

Port forwarding

Open ports (udp)

2456 2457 2458 27060

Uncomplicated Firewall

sudo ufw allow 2456/udp
@mattiasghodsian
mattiasghodsian / readme.md
Last active May 31, 2025 14:42
Install Go Lang on Ubuntu/Pop!_OS 20.04 LTS (zsh)

Install Go Lang on Ubuntu/Pop!_OS 20.04 LTS (zsh)

  • Get Go lang from golang.org
  • Extract the archive sudo tar -xvf go1.15.6.linux-amd64.tar.gz
  • Move the go directory to /usr/local directory sudo mv go /usr/local
  • Add global variable to your shell (zsh) nano ~/.zshrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
@mattiasghodsian
mattiasghodsian / functions.php
Last active January 27, 2025 04:33
[Wordpress] Fix Password Protect pages with Elementor
/**
* Fix Password Protect pages with Elementor
*
* Author: Mattias Ghodsian
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
*
* @param string $content
* @return html
*/
@mattiasghodsian
mattiasghodsian / functions.php
Last active April 28, 2023 08:31
[Wordpress] Bootstrap 4+ Pagination
/**
* Bootstrap 4+ Pagination for Wordpress
*
* Author: Mattias Ghodsian
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
*
* @param integer $paged
* @param integer $max_num_pages
* @param string $wrap_classe
@mattiasghodsian
mattiasghodsian / functions.php
Last active April 28, 2023 08:32
[Wordpress] Modify the page title (<title>)
/**
* Modify the page title (<title>)
* Author: Mattias Ghodsian
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
*/
add_filter('wp_title', 'filter_page_title', 99);
add_filter( 'bloginfo', 'filter_page_title', 10, 2 );
function filter_page_title($title) {
@mattiasghodsian
mattiasghodsian / functions.php
Last active April 28, 2023 08:32
[Woocommece] Add Author to WooCommerce Products
/**
* Add Author to WooCommerce Products
* Author: Mattias Ghodsian
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
*/
add_action('init', 'add_author_support_woocommerce', 999 );
function add_author_support_woocommerce() {
add_post_type_support( 'product', 'author' );
}
@mattiasghodsian
mattiasghodsian / functions.php
Last active April 28, 2023 08:32
[Wordpress] Add more users to Auther box
/**
* Add more users to Auther box
* Author: Mattias Ghodsian
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
*/
add_filter('wp_dropdown_users', 'add_users_to_dropdown_users');
function add_users_to_dropdown_users()
{
global $post; // remove if not needed