This works with youtube-dl and with yt-dlp
yt-dlp --write-auto-sub --sub-lang es --convert-subs=srt --skip-download URL
This works with youtube-dl and with yt-dlp
yt-dlp --write-auto-sub --sub-lang es --convert-subs=srt --skip-download URL
Compiling the Linux Kernel version 5.19.8 in Ubuntu 22.04
First we need to install the following:
sudo apt install git libncurses-dev gawk openssl libssl-dev dkms libudev-dev libpci-dev libiberty-dev autoconf llvm
sudo apt install libncurses5-dev libncursesw5-dev
sudo apt install pkg-config
sudo apt install bison
sudo apt install flex
sudo apt install libelf-dev
sudo apt install openssl
sudo apt-get install libssl-dev
sudo apt-get install liblz4-tool
After downloading and decompressing the Kernel file, under a Terminal go to that directory and run the configuration script:
MyPC:~/Downloads/LinuxKernel/linux-5.19.8$ make menuconfig
lshw
lscpu
lsmod
lspci
lsusb
With that information we can set the configuration file properly.
The compilation process can be started with the command:
make -j 8
The number 8 means that 8 threads will be used for the compilation process. You can check with the command lscpu how many cores and threads your computer support. If you have 4 cores and every core can support 2 threads that makes a total of 8. Using all your threads will speed up the compilation process, in average using 8 threads the compilation would be over in about 30 minutes. If you use just one core or thread it would take over 2 hours to finish the compilation.
If you get the following error:
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'. Stop.
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1847: certs] Error 2
make: *** Waiting for unfinished jobs....
You can fix it editing your ".config" file and changing the line:
CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"
to
CONFIG_SYSTEM_TRUSTED_KEYS=""
and run again the command for compilation.
First download and unzip jGRASP for Linux (the bundled version).
Unzip it in a directory, in this case it was downloaded inside the directory "snap". Then create a link to it in /usr/bin/jgrasp as follows:
sudo ln -s /home/username/snap/jgrasp/bin/jgrasp /usr/bin/jgrasp
You can call the program from command line or you can also create a desktop icon to call its execution.
Adding support for JavaFX:
First download the JavaFX and unzip it in a proper location, it could be also inside the "snap" directory. Then you need to go in jGRASP to "Settings ==> Compiler Settings ==> Workspace", a new window will be opened, and go to the "JavaFX" tab, there browse and input the JavaFX home path.
Note: the JavaFX has to be of the proper architecture, i.e. x64, or any other correctly corresponding to your machine, otherwise graphics won't work.
After that, for testing purposes you can use the following code from Oracle.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class HelloWorld extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World!");
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
}The outcome will be the following:
Every time the button is clicked you will get the string:
Hello World!
That string is in the terminal in pure text mode.---
One solution that usually works is to use pdfjam from the texlive distribution
pdfinfo input.pdf
pdfjam --outfile output.pdf --paper letter input.pdf
Soft links
Commonly referred to as symbolic links, soft links link together non-regular and regular files. They can also span multiple filesystems. By definition, a soft link is not a standard file, but a special file that points to an existing file. Format:
ln -s (file path [original] you want to point to) (the soft path pointing to the original)
Example:
ln -s /home/simon/snap/jgrasp/bin/jgrasp /usr/bin/jgrasp
Hard links
The concept of a hard link is the most basic. Every file on the Linux filesystem starts with a single hard link. The link is between the filename and the actual data stored on the filesystem. Creating an additional hard link to a file means a few different things. The syntax is:
ln (original file path) (new file path)
Example:
ln TestFile /tmp/link2TestF
First, you create a new filename pointing to the exact same data as the old filename. This means that the two filenames, though different, point to identical data. When changes are made to one filename, the other reflects those changes. The permissions, link count, ownership, timestamps, and file content are the exact same. If the original file is deleted, the data still exists under the secondary hard link. The data is only removed from your drive when all links to the data have been removed. If you find two files with identical properties but are unsure if they are hard-linked, use the "ls -i" command to view the inode number. Files that are hard-linked together share the same inode number. Example:
ls -li TestFile /tmp/link2TestF
Conclusion
---
FFmpeg has three concatenation methods:
1. concat video filter
Use this method if your inputs do not have the same parameters (width, height, etc), or are not the same formats/codecs, or if you want to perform any filtering.
Note that this method performs a re-encode of all inputs. If you want to avoid the re-encode, you could re-encode just the inputs that don't match so they share the same codec and other parameters, then use the concat demuxer to avoid re-encoding everything.
ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv \
-filter_complex "[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] \
concat=n=3:v=1:a=1 [v] [a]" \
-map "[v]" -map "[a]" output.mkv
2. concat demuxer
Use this method when you want to avoid a re-encode and your format does not support file-level concatenation (most files used by general users do not support file-level concatenation).
$ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4
3. concat protocol
Use this method with formats that support file-level concatenation (MPEG-1, MPEG-2 PS, DV). Do not use with MP4.
$ ffmpeg -i "concat:input1|input2" -codec copy output.mkv
This method does not work for many formats, including MP4, due to the nature of these formats and the simplistic concatenation performed by this method.
--
If in doubt about which method to use, try the concat demuxer.
---
Source: Stackoverflow.
The following is to download a only a particular part of a video from YouTube
ffmpeg -i $(youtube-dl -f 22 --get-url https://www.youtube.com/watch?v=cmne_rokrs4) -ss 00:10:10 -to 00:12:52 -c:v copy -c:a copy happy.mp4
Or you can download all the video first and then cut some parts following the instructions here.
If you want to concatenate MP4 videos (you can prepare an script):
echo file input1.mp4 > mylist.txt
echo file input2.mp4 >> mylist.txt
ffmpeg -f concat -i mylist.txt -c copy output.mp4
To list all subs for a video:
youtube-dl --list-subs URL
To download all subs, but not the video:
youtube-dl --all-subs --skip-download URL
Or you can only download one subtitle
youtube-dl --write-sub --sub-lang en --skip-download URL
Or for downloading the automatically generated subtitles
youtube-dl --write-auto-sub --skip-download URL
If you want to convert the subtitles do:
ffmpeg -i input.vtt output.srt
The following is to convert videos to a higher speed. For instance, if you want to multiply by 1.15, the command is:
ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.87*PTS[v];[0:a]atempo=1.15[a]" -map "[v]" -map "[a]" output.mkv
#The "setpts" corresponds to the inversed speed (in this case 100/1.25 = 0.8)
#while the "atempo" corresponds to the desired direct speed of the video.
#Those values are proportionally inversed.
#For a 25% higher speed output video the values
#would be "setpts=0.8*PTS" and "atempo=1.25"
100/1.25 = 0.8
References:If Windows was installed to run in UEFI, the Linux OS must also be installed using the UEFI mode. This means that most likely you need to disable in the BIOS the legacy mode and allow secure boot.
Is the "Install Ubuntu alongside Windows 10" option missing?
Please note that in the following circumstances the Ubuntu 20.04 installation option "Install Ubuntu alongside Windows 10" may be missing, if your Windows 10 installation: is not correctly shutdown or is hibernating, has corrupted partition which needs repair, partition has not enough free disk space left for resizing, uses Dynamic Disk or the file system contains uncontrollable file fragmentation.
Another case is if you try to install Linux using legacy boot for your installation media; the installation would be possible but the dual boot won't work.
References: LinuxConfig.org
dd is a great tool to fully wipe out your disk data to forensic levels
# dd if=/dev/zero of=/dev/DISK/TO/WIPE bs=4096
# dd if=/dev/zero of=/dev/sda bs=4096
# dd if=/dev/zero of=/dev/sdX bs=512
If you messed up your master boot record (MBR) you can wipe it using this command:
dd if=/dev/zero of=/dev/hdX bs=446 count=1 #replace X with the target drive letter.
If you are wiping your hard drive for security, you should populate it with random data rather than zeros (This is going to take even longer than the first example.) :
# dd if=/dev/urandom of=/dev/DISK/TO/WIPE bs=4096
# dd if=/dev/urandom of=/dev/sda bs=4096
# dd if=/dev/urandom of=/dev/sdX bs=512
# dd if=/dev/urandom of=/dev/sdX bs=4096 status=progress
---