Skip to content

Instantly share code, notes, and snippets.

@USMortality
USMortality / elections_brandenburg.r
Last active September 16, 2024 04:59
Umfragen & Wahlergebnisse [Brandenburg]
library(rvest)
library(dplyr)
library(ggplot2)
library(tidyr)
library(scales)
sf <- 2
options(vsc.dev.args = list(width = 600 * sf, height = 335 * sf, res = 72 * sf))
url <- "https://www.wahlrecht.de/umfragen/landtage/brandenburg.htm"
@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"

@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 September 21, 2024 10:58
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

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.