Skip to content

Instantly share code, notes, and snippets.

@USMortality
USMortality / chart_elections_brandenburg.r
Last active October 25, 2024 00:12
Umfragen & Wahlergebnisse [Brandenburg, Germany]
library(rvest)
library(dplyr)
library(ggplot2)
library(tidyr)
library(scales)
sf <- 2
width <- 600 * sf
height <- 335 * sf
@Nitesh8998
Nitesh8998 / amdDisplay_CudaGPU.md
Created October 15, 2021 08:48
Instructions To Succesfully Install Linux with Cuda in AMD machine
  1. Check the AMD Radeon Software for Linux latest version that is available. This is because until these graphics drivers support a linux kernel version there is no use trying to install linux in your machine.

  2. Check the kernel version supported and create a bootable drive of the linux distro with exactly that kernel.

  3. While installation DONOT agree 'download updates while installation'. Random updates are installed which can be a problem.

  4. After installing there is a high chance that the neither(internal gpu nor dedicated GPU) drivers are installed. If the linux doesnt boot under GUI, try TTY (ctrl+alt+F[1-6]) and change the following parameter in /etc/default/grub

    GRUB_CMDLINE_LINUX_DEFAULT = "nomodeset"

@goyuix
goyuix / HDR-to-SDR.txt
Created July 16, 2021 23:22
How to use FFMPEG to convert HDR video to SDR (standard dynamic range) while (mostly) retaining the same depth and intensity of colors, without washed-out colors, as the original HDR10+ video.
ffmpeg -i video-input.mp4 -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx265 -crf 22 -preset medium -tune fastdecode video-output.mp4
@edsu
edsu / mix.sh
Last active July 26, 2024 16:55
Concat two mp4 files with different resolutions.
# concatenate two videos with different resolution
ffmpeg -i part1.mp4 -i part2.mp4 -filter_complex "[0]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];[1]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];[v0][0:a:0][v1][1:a:0]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" out.mp4
@marcduiker
marcduiker / ffmpeg_video_for_twitter.md
Last active June 1, 2024 04:35
FFmpeg command for creating video for Twitter

Convert pngs to mp4

This FFmpeg command reads images named frame_[4 char digit].png and converts it to an mp4 using the h264 encoding which Twitter accepts. The bitrate is set to 5M to reduce blocking as much as possible while keeping the size small.

ffmpeg -framerate 10 -i frame_%04d.png -c:v h264_qsv -b:v 5M video.mp4

Convert and scale an existing mp4 to 1080:

ffmpeg -i input.mp4 -c:v h264_qsv -vf: scale=1080:-1 -b:v 5M output.mp4

# from https://github.com/WonderBeat/docker-archive/blob/master/firehol.conf
# FireHOL config file with docker tunnel 
# 
#  eth0 (World) <-> FireHOL <->
#                               <-> Docker
#  tun0 (Internal VPN)      <->
#
version 5
server_ssh_ports="tcp/222"
@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@denji
denji / nginx-tuning.md
Last active May 13, 2025 13:10
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@gdamjan
gdamjan / README.md
Last active April 5, 2025 23:28
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements