Skip to content

Instantly share code, notes, and snippets.

View hadret's full-sized avatar

Filip Chabik hadret

View GitHub Profile
@michenriksen
michenriksen / README.md
Created November 4, 2023 15:35
💅 Get italic text and curly underlines in macOS + Alacritty + tmux + Neovim

Italic text and other styles in Alacritty, tmux, and Neovim on macOS

This is a quick guide to get properly set up with italic text, curly underlines and other advanced styles in Alacritty, tmux, and Neovim on macOS. It assumes you're using the latest versions of all three programs.



# Convert from H264 to H265
ffmpeg -i in.mov -c:v libx265 -an -x265-params crf=20 output.mp4
# Tag as HVC instead of HEV1 so iOS can play it
ffmpeg -i output.mp4 -vcodec copy -acodec copy -tag:v hvc1 output2.mp4
# Bonus: it can take a second to play (no more than H264) so here's how to generate
# a thumbnail of the first frame to embed in your view as a placeholder.
ffmpeg -i output2.mp4 -vf "select=eq(n\,34)" -vframes 1 thumbnail.png
@ctsrc
ctsrc / README.md
Last active April 29, 2024 19:18 — forked from niw/README.en.md
Guide: Run FreeBSD 13.1-RELEASE for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc) with HVF acceleration (Hypervisor.framework)
@niw
niw / README.en.md
Last active February 13, 2024 04:24
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@geerlingguy
geerlingguy / molecule-3-up.sh
Last active January 15, 2021 13:52
Molecule 3.0 update script with all the little changes I had to make.
#!/bin/bash
#
# Update things to be compatible with Molecule 3.0.
#
# This script is NOT idempotent, and should never be run again.
exit 1
export LINT_STRING="lint: |
set -e
yamllint .
@h0bbel
h0bbel / sources.list
Last active March 23, 2024 16:17
/etc/apt/sources.list for Ubuntu 18.04.1 LTS Bionic Beaver
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@1hakr
1hakr / example.com
Last active January 31, 2024 01:16
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@hxyconan
hxyconan / haproxy_ssl_request_passthrough_ver2.txt
Last active April 2, 2024 07:35
Haproxy configuration for SSL request passthrough to different backend based on SNI
# Haproxy configuration for SSL request passthrough to different backend based on SNI read from Handshaking stage
# The Loadbalance will not decode the encrpted data but transparently transfer to the backend server in Private subnet.
# With such configuration, you can install multiply services with its own SSL certificate in backend in different EC2 instance, but only explosure to public internet with one Loadbalance IP. There is no need to install SSL certificate in Loadbalancer level.
# Ref:
# How to support wildcard sni: https://stackoverflow.com/questions/24839318/haproxy-reverse-proxy-sni-wildcard
# https://www.haproxy.com/blog/enhanced-ssl-load-balancing-with-server-name-indication-sni-tls-extension/
# https://stuff-things.net/2016/11/30/haproxy-sni/
@mdesantis
mdesantis / upgrade-postgres-9.6-to-10.md
Last active October 11, 2021 08:11 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main