Or how to turn this:
into this:
| # Creating a complex hash, with nested keys | |
| my_complex_hash = { | |
| users: [ | |
| {name: "Yukihiro Matsumoto", age: 57}, | |
| {name: "Kabosu the Shiba Inu", age: 16}, | |
| {name: "Thiago Massa", age: 33} | |
| ] | |
| } |
| - Parzialmente ispirato a vari gist sparsi per il web | |
| - Sto ancora facendo tuning dei parametri | |
| # TRASMETTERE: | |
| INTEL e AMD [VAAPI] (libva-mesa-driver): | |
| ffmpeg -f x11grab -s 1920x1080 -framerate 60 -i $DISPLAY -vaapi_device /dev/dri/renderD128 -vf 'format=nv12,hwupload,scale_vaapi=w=1920:h=1080' -c:v h264_vaapi -qp:v 26 -bf 0 -preset superfast -tune zerolatency -b:v 2000K -minrate 2000K -maxrate 2000K -bufsize 512k -f rawvideo udp://192.168.1.222:12345 | |
| NVIDIA (CUDA/NVENC/H264) STREAM: | |
| ffmpeg -hwaccel cuda -hwaccel_output_format cuda -f x11grab -s 1920x1080 -i $DISPLAY -c:v h264_nvenc -zerolatency 1 -delay:v 0 -preset p1 -tune ull -b:v 2000k -bufsize 512k -maxrate 2000k -qmin 0 -temporal-aq 1 -rc-lookahead 0 -i_qfactor 0.75 -b_qfactor 1.1 -f rawvideo udp://192.168.1.222:12345 |
| # Step 1 | |
| def create_subscription(email, plan_id, payment_method_id) do | |
| with %User{customer_id: nil, name: name} = user <- | |
| Repo.get_by(User, email: email), | |
| {:ok, %Stripe.Customer{id: customer_id}} <- | |
| Stripe.Customer.create(%{ | |
| name: name, | |
| email: email, | |
| payment_method: payment_method_id, |
xhost + ${hostname} to allow connections to the macOS host *export HOSTNAME=`hostname`* environment:
| function base64url(source) { | |
| // Encode in classical base64 | |
| encodedSource = CryptoJS.enc.Base64.stringify(source); | |
| // Remove padding equal characters | |
| encodedSource = encodedSource.replace(/=+$/, ''); | |
| // Replace characters according to base64url specifications | |
| encodedSource = encodedSource.replace(/\+/g, '-'); | |
| encodedSource = encodedSource.replace(/\//g, '_'); |
sudo apt-get install xserver-xorg-legacy
Edit /etc/X11/Xwrapper.config
allowed_users=anybody
needs_root_rights=yes
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| # Add this snippet to the top of your playbook. | |
| # It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
| # [email protected] | |
| - hosts: all | |
| gather_facts: False | |
| tasks: | |
| - name: install python 2 | |
| raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |