Skip to content

Instantly share code, notes, and snippets.

@Neo2SHYAlien
Neo2SHYAlien / ffmpeg-commands.sh
Created July 12, 2022 05:27 — forked from 44213/ffmpeg-commands.sh
ffmpeg commands.
# To extract the sound from a video and save it as MP3:
ffmpeg -i <video.mp4> -vn <sound>.mp3
# To convert frames from a video or GIF into individual numbered images:
ffmpeg -i <video.mpg|video.gif> <frame_%d.png>
# To combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF:
ffmpeg -i <frame_%d.jpg> -f image2 <video.mpg|video.gif>
# To quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image:
@Neo2SHYAlien
Neo2SHYAlien / convert-mac
Last active January 11, 2021 15:15 — forked from benjyiw/convert-mac
Convert mac address to Cisco format (xxxx.xxxx.xxxx) and back (xx:xx:xx:xx:xx:xx)
#!/bin/bash
mac="$@"
if [[ ${mac} == ??:??:??:??:??:?? ]]; then
sed 's/\://;s/\:/./;s/\://;s/\:/./;s/\://' <<< ${mac}
elif [[ ${mac} == ????.????.???? ]]; then
sed 's/\.//g;s/\(..\)/\1:/g;s/:$//' <<< ${mac}
else
echo 'That does not appear to be a mac address, try harder'
fi

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Neo2SHYAlien
Neo2SHYAlien / parse-tcpdump-udp-port-53.php
Created October 22, 2016 09:10 — forked from jtai/parse-tcpdump-udp-port-53.php
Quick and dirty script to parse output of /usr/sbin/tcpdump -vvv -s 0 -l port 53
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}