Skip to content

Instantly share code, notes, and snippets.

View FarisR99's full-sized avatar

Faris FarisR99

  • Goldman Sachs
  • London, UK
View GitHub Profile
@FarisR99
FarisR99 / ffmpeg_options
Created November 27, 2022 17:24
Basic ffmpeg options with oneVPL
--disable-gnutls
--disable-stripping
--enable-gpl
--enable-shared
--enable-nonfree
--enable-libass
--enable-libcodec2
--enable-libfontconfig
--enable-libfreetype
--enable-libfribidi
@FarisR99
FarisR99 / Guide.md
Last active May 12, 2023 17:04
Intel Arc on Ubuntu 22.04 with ffmpeg & mpv

I recently received an Intel A750 from an Intel run contest. My idea for it was to replace the GTX 1660 in my media server with it, as it has AV1 encode/decode and faster encoding. Before installing my A750 in my media server, I had to make sure it will actually work, and work well with ffmpeg.

This took some time spanning a couple of days to figure out, but I managed to get it almost completely working thanks to coming across this post, and the very helpful user who wrote it (u/Mr_Deathproof): https://www.reddit.com/r/Tdarr/comments/yvsq3n/got_my_intel_arc_a380_dg2_to_work_with_booshs_qsv/iwhsezk/

I've adapted this to include solutions to issues I faced, and following method should work on a fresh install of Ubuntu 22.04.

Disclaimer: I'm not proficient at Linux, and there may be a much simpler method of doing this. This will also be using a "bleeding edge" kernel.

Make sure your user is in the render and video groups:

@FarisR99
FarisR99 / CustomConfiguration.java
Last active January 27, 2019 01:35
Configuration loading and saving with comments.
import org.bukkit.*;
import org.bukkit.configuration.*;
import org.bukkit.configuration.file.*;
import java.io.*;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
@FarisR99
FarisR99 / ViewController.swift
Last active August 29, 2015 14:05
BlockClicker game for iOS.
//
// ViewController.swift
// Block Clicker
//
// Created by Faris on 19/08/2014.
// Copyright (c) 2014 KingFaris10. All rights reserved.
//
import UIKit
@FarisR99
FarisR99 / ReflectionUtilities.java
Last active January 18, 2016 23:06
Reflection utility for Bukkit.
import org.bukkit.Bukkit;
import java.lang.reflect.*;
import java.util.*;
/**
* @author KingFaris10
* @version 1.2.0
*/
@SuppressWarnings("rawtypes")
@FarisR99
FarisR99 / BeaconActivator.java
Last active August 29, 2015 14:05
Set a beacon active.
public static class ReflectionUtils {
public static String getVersion() {
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
}
public static Class<?> getNMSClass(String name) {
Class<?> clazz = null;
try {
clazz = Class.forName("net.minecraft.server." + getVersion() + "." + name);
} catch (ClassNotFoundException e) { e.printStackTrace(); }
@FarisR99
FarisR99 / Main.java
Last active August 29, 2015 14:04
Minecraft Premium account validator - ignores demo accounts!
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import javax.swing.*;
import java.io.*;
import java.net.*;
import java.util.*;
public class Main extends JFrame {
@FarisR99
FarisR99 / Currency.java
Last active August 29, 2015 14:04
MCSG Bot - Plugin - CurrencyConverter
import com.skype.Chat;
import com.skype.User;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.mcsg.bot.skype.Bot;
import org.mcsg.bot.skype.ChatManager;
import org.mcsg.bot.skype.McsgBotPlugin;
import org.mcsg.bot.skype.commands.SubCommand;
import java.io.BufferedReader;
@FarisR99
FarisR99 / Lang.java
Last active August 29, 2015 14:04
Custom Lang - thanks to 1Rogue for a base idea
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
public enum Lang {
PREFIX("Prefix.Plugin", "&6[&4<plugin>&6] &a"), COMMAND_NO_PERMISSION("Command.No permission", "&4You do not have access to that command."), COMMAND_PLAYER("Command.Player", "&cYou must be a player to use that command.");
@FarisR99
FarisR99 / CustomMap.java
Last active August 29, 2015 14:04
CustomMap
import java.util.*;
public class CustomMap<K, V> implements Cloneable {
private List<K> keys = null;
private List<V> values = null;
public CustomMap() {
this.keys = new ArrayList<K>();
this.values = new ArrayList<V>();