Skip to content

Instantly share code, notes, and snippets.

@Artiume
Artiume / cuda_11.1_installation_on_Ubuntu_20.04
Last active December 1, 2023 10:25 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
CUDA 11.1 Installation on Ubuntu 20.04
#!/bin/bash
## This gist contains instructions about cuda v11.1 and cudnn 7.6 installation in Ubuntu 20.04 for Tensorflow 2.1.0
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@Artiume
Artiume / gist:c7a6b7dbfb20706538ecf747a280d237
Created November 19, 2020 06:38 — forked from jeoliva/gist:a3c4ef62b7f52926d0f339b395c0cd0c
Get Keyframe interval (GOP size) of a stream/video using ffprobe
ffprobe -of compact -select_streams v -show_packets [VIDEO_FILE OR STREAM_URL] | grep K$ | awk 'BEGIN{FS="|";last=-1}{split($5,a,"="); if(last != -1) {print "Keframe pos: " a[2] ", Interval: " a[2]-last " seconds"} else {print "Keyframe: " a[2]}; last=a[2]}'
@Artiume
Artiume / music_bot_example.py
Created October 26, 2020 20:49 — forked from vbe0201/music_bot_example.py
A simple music bot written using discord.py rewrite and youtube_dl.
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Valentin B.
A simple music bot written in discord.py using youtube-dl.
Though it's a simple example, music bots are complex and require much time and knowledge until they work perfectly.
Use this as an example or a base for your own bot and extend it as you want. If there are any bugs, please let me know.
@Artiume
Artiume / post-process.sh
Created October 25, 2020 04:01 — forked from thornbill/post-process.sh
DVR post processing script for Jellyfin
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
PWD="$(pwd)"
die () {
@Artiume
Artiume / Securing-SWAG.md
Created October 21, 2020 11:53 — forked from quietsy/Securing-SWAG.md
Securing SWAG

Securing SWAG

SWAG - Secure Web Application Gateway (formerly known as linuxserver/letsencrypt) is a full fledged web server and reverse proxy with Nginx, PHP7, Certbot (Let's Encrypt™ client) and Fail2Ban built in. SWAG allows you to expose applications to the internet, doing so comes with a risk and there are security measures that help reduce that risk. This article details how to configure SWAG and enhance it's security.

This article assumes that you already have a functional SWAG setup. Following is the compose yaml used to create the SWAG container referenced in this article. Keep in mind your local mount paths will be different so adjust accordingly.

---
version: "2.1"
services:
  swag:
@Artiume
Artiume / Readme.md
Created May 14, 2020 21:42 — forked from oddstr13/Readme.md
Jellyfin Plugin Tools

Put these scripts in a separate directory — I've got them in ~/Projects/Jellyfin/Plugins/.

pull_all.py grabs all repositories from the Jellyfin Org. with the name prefix of jellyfin-plugin-.

build_all.sh runs dotnet clean & publish (release build) on them all.

issues.sh and pullrequests.sh lists the issues and pullrequests of the repos if any.

Dependencies

  • .NET core
@Artiume
Artiume / update-ffmpeg-rpi.sh
Created May 8, 2020 19:07 — forked from enzanki-ars/update-ffmpeg-rpi.sh
Install/Update FFmpeg with hardware acceleration on the Raspberry Pi
#!/bin/bash
# Compile and install/update (or install via Apt) FFmpeg Codecs
# Compile and install/update FFmpeg suite
# Compile with hardware acceleration
# Modified from https://retroresolution.com/compiling-ffmpeg-from-source-code-all-in-one-script/
echo "Begining Installation of FFmpeg Suite"
#Update APT Repository
echo "Updating the APT repository information"
@Artiume
Artiume / ffmpeg_tut_.md
Created May 7, 2020 23:53 — forked from hsab/ffmpeg_tut_.md
FFMPEG Tutorial: 2-Pass & CRF in x264 & x265

Google FFMPEG H264

Two-Pass: Requires a bitrate. This defines the quality of the video. Youtube and Vimeo usually reduce your bitrate to 25mbs. So if it is higher, it will be compressed by these websites.

Lower bitrate means lower files size.

Calculating Bitrate:

http://192.168.1.17:8096/videos/9c4eb903-c638-ab3f-014c-ee4aac77dfd0/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NzIuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC83Mi4wfDE1ODA4MzA5NDMwNDk1&MediaSourceId=9c4eb903c638ab3f014cee4aac77dfd0&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&SubtitleStreamIndex=6&VideoBitrate=139808000&AudioBitrate=192000&PlaySessionId=8a448ea99b78424f982f368c6d66bdc7&api_key=124c43585e2e422f8fd8c3d300e26b8f&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=482f287bbab852415730f534e4a29dd0&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=SubtitleCodecNotSupported&allowVideoStreamCopy=false
{"Protocol":"File","Id":"9c4eb903c638ab3f014cee4aac77dfd0","Path":"/data/unionfs/media/anime/Hundred/Season 1/Hundred - S01E01 - Little Garden Bluray-1080p.mkv","Type":"Default","Container":"mkv,webm","Size":1275992320,"Name":"Hundred - S01E01 - Little G
import requests # https://www.pythonforbeginners.com/requests/using-requests-in-python
from pprint import pprint
from urllib.parse import urlencode
# Update with your information
server = 'https://jellyfin.example.com'
username = 'testuser'
password = 'badpassword'