Skip to content

Commit 7a7d1bf

Browse files
committed
Update uuid, ramfile and h265 nvenc scripts
Signed-off-by: Bensuperpc <[email protected]>
1 parent 96a76aa commit 7a7d1bf

File tree

3 files changed

+62
-5
lines changed

3 files changed

+62
-5
lines changed

linux/uuid-bash.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
#//////////////////////////////////////////////////////////////
4+
#// ____ //
5+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
6+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
7+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
8+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
9+
#// |_| |_| //
10+
#//////////////////////////////////////////////////////////////
11+
#// //
12+
#// Script, 2021 //
13+
#// Created: 23, July, 2021 //
14+
#// Modified: 23, July, 2021 //
15+
#// file: - //
16+
#// - //
17+
#// Source: https://serverfault.com/a/597626/562645 //
18+
#// OS: ALL //
19+
#// CPU: ALL //
20+
#// //
21+
#//////////////////////////////////////////////////////////////
22+
23+
uuid()
24+
{
25+
local N B T
26+
27+
for (( N=0; N < 16; ++N ))
28+
do
29+
B=$(( $RANDOM%255 ))
30+
31+
if (( N == 6 ))
32+
then
33+
printf '4%x' $(( B%15 ))
34+
elif (( N == 8 ))
35+
then
36+
local C='89ab'
37+
printf '%c%x' ${C:$(( $RANDOM%${#C} )):1} $(( B%15 ))
38+
else
39+
printf '%02x' $B
40+
fi
41+
42+
for T in 3 5 7 9
43+
do
44+
if (( T == N ))
45+
then
46+
printf '-'
47+
break
48+
fi
49+
done
50+
done
51+
52+
echo
53+
}
54+
55+
uuid

partition/mount_directory_in_ram.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ set -euo pipefail
1111
#// //
1212
#// Script, 2020 //
1313
#// Created: 20, December, 2020 //
14-
#// Modified: 17, June, 2021 //
14+
#// Modified: 23, July, 2021 //
1515
#// file: - //
1616
#// - //
1717
#// Source: - //
1818
#// OS: ALL //
1919
#// CPU: ALL //
2020
#// //
2121
#//////////////////////////////////////////////////////////////
22-
if (( $# < 2 )); then
23-
sudo mount -t tmpfs -o size=512M tmpfs $1
22+
if (( $# == 2 )); then
23+
sudo mount -t tmpfs -o size=$2M tmpfs $1
24+
else
25+
echo "Usage: ${0##*/} <path> <size>"
2426
fi

video/h265_nvenc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ set -euo pipefail
1111
#// //
1212
#// Script, 2020 //
1313
#// Created: 21, November, 2020 //
14-
#// Modified: 20, December, 2020 //
14+
#// Modified: 23, June, 2021 //
1515
#// file: - //
1616
#// - //
1717
#// Source: - //
1818
#// OS: ALL //
1919
#// CPU: ALL //
2020
#// //
2121
#//////////////////////////////////////////////////////////////
22-
if (( $# < 3 )); then
22+
if (( $# == 2 )); then
2323
ffmpeg -strict 2 -hwaccel auto -i "$1" -c:v hevc_nvenc -preset slow -rc vbr_hq -cq 18 -qmin 16 -qmax 20 -profile:v main10 -b:v 0K -c:a copy -map 0 "$2"
2424
fi

0 commit comments

Comments
 (0)