Skip to content

Instantly share code, notes, and snippets.

@Alee14
Alee14 / win-dism.md
Last active April 15, 2025 09:54
Installing Windows using CMD. (UEFI and BIOS Supported)

Installing Windows using CMD. (UEFI and BIOS Supported)

Guide created by Andrew Lee

Note that this guide does not go into detail, it's just providing the commands to install Windows.

Be cautions when doing this when dualbooting, please backup any existing data or you will lose them all.

Open CMD

First open CMD by pressing the following keys after booting into setup: Shift + F10

Creating Partition

@lemajes
lemajes / JQ-101.md
Created June 22, 2021 16:53
[JQ 101] JQ 101 #jq #101

JQ 101

  • Find path of specific value cat myfile.json|jq '[paths as $path | select(getpath($path) == "myvalue") | $path]'
const escapeHTML = input => input.replace(/[<>&"']/g, char => `&#${char.charCodeAt(0)};`)
@cpcloud
cpcloud / ffgrid.sh
Created January 19, 2021 15:20
hardware accelerated ffmpeg hls mosaic
#!/usr/bin/env nix-shell
#!nix-shell --pure -i bash -p ffmpeg-full -p bc -p findutils -p ripgrep
set -euxo pipefail
function join_by {
local d=$1
shift
local f=$1
shift
@lemajes
lemajes / MOUNT-101.md
Last active October 26, 2024 23:53
[MOUNT 101] Mount 101 #mount #101 #debian #filesystem #bindfs

MOUNT 101

  • Mount SMB Share mount -t cifs -o username=myuser,rw,iocharset=utf8,file_mode=0777 //xxx.xxx.xxx.xxx/winshare windows/

  • Mount BindFS /etc/fstab /this /that fuse.bindfs force-user=www-data,perms=0755 0 0

@docPhil99
docPhil99 / video_loop_back.md
Last active February 9, 2023 16:35
How to pass video to a dummy webcam.
  1. Start the v4l2loopback module:
sudo modprobe v4l2loopback \
      devices=1 exclusive_caps=1 video_nr=5 card_label="Dummy Camera"
  1. I have a short test video call Speed1.avi, this can be played streamed to /dev/video5 with ffmpeg -re -stream_loop -1 -i Speed1.avi -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video5
@lemajes
lemajes / openssl-101.md
Last active October 26, 2024 23:53
[OPENSSL 101] OPENSSL 101 #openssl #ssl #101 #validity #check

OPENSSL 101

Convert DER to CRT

openssl x509 -inform DER -in certificate.cer > certificate.crt

Retrieve CA Certificate

openssl x509 -text -noout -in mycertificatefile.crt

Check validity of remote certificate

@wildrun0
wildrun0 / compile-ffmpeg.sh
Last active May 23, 2024 09:36
Compiling ffmpeg for Raspberry Pi 4 (script only works fine on RPi OS 32bit). x64 does not support mmal (see https://github.com/raspberrypi/userland/issues/688)
#!/bin/bash
# Note that there's no libdrm because this lib cause errors
sudo apt update -y && sudo apt upgrade -y
sudo apt-get -y install \
autoconf \
automake \
build-essential \
@lemajes
lemajes / apache2-log-format.sh
Created May 5, 2020 16:53
[Apache2 Log Format] apache2 log format #bash #apache2 #log
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %{ms}T" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %{ms}T" combined
LogFormat "%h %l %u %t \"%r\" %>s %O **%T/%D**" common
LogFormat "%{Referer}i -> %U **%T/%D**" referer
LogFormat "%{User-agent}i **%T/%D**" agent
@jasny
jasny / create.php
Created April 23, 2020 02:34
Stripe example PHP code
<?php
require 'vendor/autoload.php';
// This is a sample test API key. Sign in to see examples pre-filled with your key.
\Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
# retrieve JSON from POST body
header('Content-Type: application/json');
$json_str = file_get_contents('php://input');