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 / thumbnail-grid-generator.ps1
Created April 15, 2024 22:15
[PowerShell] Thumbnail Grid Generator with ffmpeg
# Author: Mattias Ghodsian
# Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
# Donate coffee: https://www.buymeacoffee.com/mattiasghodsian
$ffmpeg = ".\ffmpeg.exe"
$directory = $PWD.Path
$video = ".\video.mkv"
$filenameWithExtension = Split-Path -Leaf $video
# Specify the starting time offset
@mattiasghodsian
mattiasghodsian / readme.md
Created August 31, 2023 12:02
[Laravel] Removing API Prefix for API Subdomains

If you are utilizing Laravel as a backend platform serving API routes via a subdomain https://api.example.com/, you may find that the default routing configuration for the api route is not needed.

Edit /app/Providers/RouteServiceProvider.php and locate the prefix('api') line and comment it out or remove it altogether, in my case i don't need the web route group so i commented that part out.

<?php

namespace App\Providers;

use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
@mattiasghodsian
mattiasghodsian / readme.md
Created December 29, 2022 15:29
Play Commander Keen 1 on Debian distros

Play Commander Keen 1 on Debian distros

Easy guide to install and play Commander Keen 1.

1. Install DOSBOX

sudo apt-get install dosbox

2. Commander Keen 1

I do not endorse piracy and do NOT take any responsibility.

@mattiasghodsian
mattiasghodsian / readme.md
Created November 22, 2022 09:41
DBeaver - OutOfMemoryError occurred while reading file

How to fix DBeaver - OutOfMemoryError occurred while reading file

When u encounter OutOfMemoryError occurred while reading file DBeaver needs more memory to read big SQL files

Edit dbeaver.ini

nano /usr/share/dbeaver-ce/dbeaver.ini 
-vmargs
@mattiasghodsian
mattiasghodsian / core-keeper-watcher.sh
Last active April 28, 2023 08:30
Send GameID to Discord Channel for Core Keeper Dedicated Server
#!/bin/bash
# Author: Mattias Ghodsian
# Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
# Donate coffee: https://www.buymeacoffee.com/mattiasghodsian
filename="path-to-game-file-directory/GameID.txt"
m1=$(md5sum "$filename")
while true; do
@mattiasghodsian
mattiasghodsian / readme.md
Last active January 5, 2023 09:37
Install flameshot and bind to Prt Sc key on Ubuntu 20.04

Install flameshot

Remove current bind on Prt Sc key

gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '[]'

Bind flameshot by going to Setttings > Keyboard Shortcuts and then scroll all the way down and press the +

@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 April 25, 2024 14:39
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