Skip to content

Instantly share code, notes, and snippets.

@tsunghanlin
tsunghanlin / script.sh
Created October 6, 2022 16:01 — forked from vielhuber/script.sh
ffmpeg: Video convert m2ts to mp4, mp4 to webm, mp4 to ogv #tools
MP4 TO MP4 (MEDIUM)
ffmpeg -i input.mp4 -b 1000000 output.mp4
M2TS TO MP4
ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4
MP4 TO WEBM (HIGH)
ffmpeg -i input.mp4 -aq 5 -ac 2 -qmax 25 -threads 2 output.webm
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus output.webm
@tsunghanlin
tsunghanlin / WHY_HW_BREAK_POINT
Last active November 22, 2018 17:42
QEMU SCRIPT
https://lists.gnu.org/archive/html/qemu-devel/2012-03/msg03390.html
Two major issues with this procedure:
1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap
instruction into the guest image - which is not yet loaded after the
bios ran. You need to use a hardware breakpoint in this case.
2. Due to gdb limitations, you cannot switch between 16/32-bit mode (the
CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb
@tsunghanlin
tsunghanlin / mac_os_ssh.txt
Created April 12, 2018 10:05
Mac OS ssh Port
/etc/services && /System/Library/LaunchDaemons/ssh.plist
@tsunghanlin
tsunghanlin / ssh_lxc.md
Created February 28, 2018 02:04
SSH to LXC guest
@tsunghanlin
tsunghanlin / kernel_net_note.md
Last active March 12, 2022 09:15
Kernel Networking related Notes

Structure Note

  • include/linux/skbuff.h: struct sk_buff
    • Timing of creation:
      • When applications pass data from socket
      • Packets arrive at NIC (dev_alloc_skb())
    • Contain real data's information and pointer to the real data
    • used by all the network layers
  • when packet is passing UP through layers, old headers are not removed.
@tsunghanlin
tsunghanlin / uboot-dgb.md
Created January 11, 2017 05:29
Debugging u-boot with relocation

Debugging in uboot, especially after uboot relocated, can refer to:

For armv8 target, 'relocaddr' is stored in register x0 (arch/arm/lib/crt0_64.S:102)

$ aarch64-elf-gdb u-boot -x start.gdb 
GNU gdb (Linaro GDB 2015.08) 7.10.0.20151014-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
@tsunghanlin
tsunghanlin / kernel.ld
Last active October 13, 2016 06:11
armv7ar startup
ENTRY(_start)
SECTIONS
{
. = 0x0;
.ro : {
*(.text)
*(.rodata)
}
. = 0x00100000;
.rw : {
@tsunghanlin
tsunghanlin / Makefile
Last active September 11, 2020 15:49
Pandoc Latex PDF HOWTO
PANDOC = pandoc
PANDOC_MD = doc.md
TEX_TEMPLATE = mincho.tex
PDF_FILE = em.pdf
PANDOC_OPTS += --highlight-style tango -N --toc
PANDOC_OPTS += --latex-engine=xelatex -H $(TEX_TEMPLATE)
PANDOC_OPTS += --filter pandoc-citeproc --csl ieee.csl --bibliography=ref.bib
# make citation number in article linkable
PANDOC_OPTS += --metadata link-citations=true
FONTS_OPTS += --variable mainfont="Noto Sans CJK JP"