Skip to content

Instantly share code, notes, and snippets.

List available programs

$ ffmpeg -i <URL.m3u8>

Specifying program

$ ffmpeg -i URL.m3u8 -map <SOURCE_IDX>:p:<PROGRAM_NUMBER> -c copy output.ext

Terminal Tips & Tricks

  • Pretty prompt
    # Start colored text with:
    #   %F{red}
    # End colored text with:
    #   %F{red}
    # %n    : user name
    # %m    : computer name
    # %/    : current dir
@crowjdh
crowjdh / offline-nginx-installation.md
Last active November 17, 2023 09:17
Installing nginx for CentOS7 on the host that has no internet connection using yum

This process needs CentOS7 host that has internet connection for creating offline repo.

This particular example illustrates installing nginx specifically, but I think this should work for any other packages.

From CentOS with network connection

host-with-net:/# yum install yum-plugin-downloadonly yum-utils createrepo

host-with-net:/# mkdir -p /root/playground/nginx
host-with-net:/# mkdir -p /root/playground/nginx-installroot
#!/bin/sh
# We don't need extra husky dependency for a simple task
COMMIT_LINT_HOOK_PATH="$PWD/.custom_git_hooks"
COMMIT_LINT_CMT_MSG_HOOK_PATH="$COMMIT_LINT_HOOK_PATH/commit-msg"
ensure_hook_dir() {
if [ ! -d "$COMMIT_LINT_HOOK_PATH" ]; then
mkdir "$COMMIT_LINT_HOOK_PATH"
#!/bin/zsh
line_lengths=($(git log --pretty=format:%s | awk '{ print length($0) - 9 }'))
sum=0
line_count=${#line_lengths}
for line_length in ${line_lengths[@]}; do
sum=$((sum + line_length))
done
@crowjdh
crowjdh / UaaL.md
Last active October 19, 2023 01:26
How to setup Unity as a Library(for iOS/Android) with Vuforia
const fs = require('fs');
const path = require('path');
const target_dir = process.argv[2];
fs.readdir(target_dir, function(err, items) {
for(var i = 0; i < items.length; i++) {
nfd_name = items[i];
nfc_name = items[i].normalize('NFC');
console.log(`nfd_name: ${nfd_name}\nnfc_name: ${nfc_name}`);

Volume

OVPN_DATA="openvpn-data"
docker volume create --name $OVPN_DATA

Server

docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm mjenz/rpi-openvpn ovpn_genconfig -u udp://your.vpnhost.com

Build

user@host $ mkdir node-arch && cd node-arch
user@host $ vim Dockerfile

Dockerfile

FROM ubuntu:20.04

RUN apt update &amp;&amp; apt install -y vim git libaio1 curl build-essential gettext-base

Resources

Hardware

  • MBP Retina mid 2012

OS

  • Main: MacOS Catalina
  • Second: Windows 10 Home Edition
  • Third: Kali Linux 2020.4

Install Windows via BootCampAssistant