• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Archives for October 2022

Bulk FFMPEG Resize

October 31, 2022

Here’s how to resize videos and pictures using FFMPEG.

Bulk Resize Pictures

for filename in *.JPG; do 
  ffmpeg -i "$filename" -vf scale=-1:720 final/"$filename";
done

for filename in *.JPG; do ffmpeg -i "$filename" -vf scale=-1:720 final/"$filename"; done

Bulk Resize Video and Create Thumbnail

for filename in *.MP4; do 
  ffmpeg -i "$filename" -s 1080x720 -pix_fmt yuv420p -crf 18 "$filename".mp4; 
  ffmpeg -ss 00:00:00 -i "$filename" -vframes 1 "$filename".jpg;
done

for filename in *.MP4; do ffmpeg -i "$filename" -s 1080x720 -pix_fmt yuv420p -crf 18 "$filename".mp4; ffmpeg -ss 00:00:00 -i "$filename" -vframes 1 "$filename".jpg; done

Filed Under: Linux Tagged With: bulk, ffmpeg, pictures, resize, videos

Vim Cheatsheet

October 27, 2022

Almost all are not able to remember all the shortcuts that are available for the vi or vim editor. I will call it vim throughout this article. There are several cheatsheets out there, but the one that works for me is the one provided by rtorr in Github. I use the cheatsheet often. I suggest that you start small. At the very least learn how to navigate in vim. Once you feel comfortable doing that, you can learn other advanced shortcuts such as editing, search and replace, working with multiple files and many much more. I hope you’ll find the cheatsheet as helpful as it has done for me. Again if you missed the link above, I posted it below.

Vim Cheatsheet

Filed Under: Linux Tagged With: cheatsheet, commands, vi, vim

FFMPEG Resize

October 25, 2022

How to resize JPEG using FFMPEG.

ffmpeg -i TREE.JPG -y -vf scale=iw*.2:ih*.2 tree.jpg

ffmpeg -i TREE.JPG -y -vf scale=iw*.2:ih*.2 tree.jpg

Another option is to set resolution.

ffmpeg -i TREE.JPG -y -vf scale=-1:720 tree.jpg

ffmpeg -i TREE.JPG -y -vf scale=-1:720 tree.jpg

How to resize video using FFMPEG.

ffmpeg -i TREE.MP4 -s 640x360 -pix_fmt yuv420p -crf 18 tree.mp4

ffmpeg -i TREE.MP4 -s 640x360 -pix_fmt yuv420p -crf 18 tree.mp4

How to create a thumbnail from a video.

ffmpeg -ss 00:00:00 -i tree.mp4 -vframes 1 tree.jpg

ffmpeg -ss 00:00:00 -i tree.mp4 -vframes 1 tree.jpg

Filed Under: Linux Tagged With: create, ffmpeg, image, resize, thumbnail, video

Vim Colors

October 25, 2022

I had trouble getting my vi editor to display all black background color. This includes the background color after the end of the file. I just wanted an all black background for better visibility. I did a little bit of googling and found this nice little gem. I happen to like the dessert theme and went with that instead of the recommended mustang theme which I don’t have installed. Hope you’ll find this helpful.

set t_Co=256
set background=dark
colorscheme dessert
highlight Normal ctermbg=NONE
highlight nonText ctermbg=NONE

set t_Co=256 set background=dark colorscheme dessert highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE

Filed Under: Linux Tagged With: background, black, dark, theme, vim

Git Remove Files From Repo After Commit

October 4, 2022

If you need to remove files from a repo after committing, use …

Remove file

git rm --cached file.ext

git rm --cached file.ext

Push to repo

git push

git push

Filed Under: Linux Tagged With: cache, commit, git, push, rm

Install Cockpit on Rocky 9

October 3, 2022

Cockpit is a web-based graphical interface for Linux users and admins.

Install

dnf install cockpit

dnf install cockpit

Start and Enable

systemctl start cockpit
systemctl enable cockpit.socket

systemctl start cockpit systemctl enable cockpit.socket

Status

systemctl status cockpit

systemctl status cockpit

Web access

http://192.168.0.20:9090

http://192.168.0.20:9090

Filed Under: Linux Tagged With: admins, cockpit, install, interface, users, web

  • Home
  • About
  • Archives

Copyright © 2023