rtmp of mp4 via ffmpeg

FFMPEG is the jack of all trades utility for both audio and video files. You can record, convert, and even live stream an audio or video file in just about any file format. In this example, I will be sending a RTMP stream of a MP4 file to a Wowza streaming server. I can easily send the same stream to YouTube, Facebook or any streaming server that accepts a RTMP source. In this example, I created simple Bash script called play.sh, with all the options needed to live stream to Wowza Streaming server. ...

October 27, 2019 · 1 min · ulysses

rfc 1918

Here’s the original document published back in February 1996 detailing the allocation for private internet addresses. The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets. RFC 1918. 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

October 24, 2019 · 1 min · ulysses

xfs filesystem has duplicate uuid

Here’s how to fix a duplicate UUID on a XFS file system. mount -o rw,nouuid /dev/sda1 /data Mounting with nouuid will work, but not after a reboot. To avoid a duplicate ID, run this command to generate a new UUID. xfs_admin -U generate /dev/sda3 Clearing log and setting UUID writing all SBs new UUID = xxxxx-xxxx-xxxx-xxxxxxxxx

October 7, 2019 · 1 min · ulysses

gcp stackdriver firewall log

Here’s one way how to look at traffic hitting a GCP firewall. To view the traffic activity, go to Stackdriver Logging > Viewer. Enter the following search string. Just replace the network name and firewall name. logName:(projects/project-name/logs/compute.googleapis.com%2Ffirewall) AND jsonPayload.rule_details.reference:("network:network-name/firewall:firewall-name")

October 4, 2019 · 1 min · ulysses

yum rpmdb failed

If you are getting an error similar to the yum error below, yum may be broken in your system. error: rpmdb: BDB0113 Thread/process 2196/139984719730496 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db5 - (-30973) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed Here’s the fix. mv /var/lib/rpm/__db* /tmp yum clean all Run your yum commands. The errors should be gone.

October 4, 2019 · 1 min · ulysses

gcp increase download speed for gsutil

If you’re downloading large files, you can speed up download speeds by modifying gsutil. Decrease the number of threads and increase the number of components. gsutil \ -o "GSUtil:parallel_thread_count=1" \ -o "GSUtil:parallel_process_count=8" \ cp gs://bucket/source.dat /download/dest/file.dat

October 2, 2019 · 1 min · ulysses

gcp service accounts

Here’s how display the Service Account of a particular instance in Google Cloud. gcloud compute instances describe server-name \ --zone us-central1-c \ --project project-id \ --format="flattened(serviceAccounts[].email)" Result is: serviceAccounts[0].email: service-account-name@project-id.iam.gserviceaccount.com

September 25, 2019 · 1 min · ulysses

elapse time on bash script

Here’s a nice little Bash function in a script to display the elapse time. It’s a nice function for showing how long a process ran. #!/bin/bash # pass number of seconds as argument. # Example below calculates 1000s. # elapse.sh 1000 function show_time () { num=$1 min=0 hour=0 day=0 if((num>59));then ((sec=num%60)) ((num=num/60)) if((num>59));then ((min=num%60)) ((num=num/60)) if((num>23));then ((hour=num%24)) ((day=num/24)) else ((hour=num)) fi else ((min=num)) fi else ((sec=num)) fi echo "$day"d "$hour"h "$min"m "$sec"s } show_time $1

September 24, 2019 · 1 min · ulysses

fpsync

Fpsync is command line tool for synchronizing directories in parallel using fpart and rsync tools. You can specify a number of concurrent sync jobs, number of files per sync job, and the maximum byte size per sync among other things. Fpsync is believed to be 4 to 5 times faster than rsync. Fpsync makes sense when syncing massive drives with thousands of directories and small files. To install fpsync. apt install fpart Fpsync with 8 parallel jobs. ...

September 23, 2019 · 1 min · ulysses

gcp add iam role to service account

Here’s how to add an IAM role to a GCP Service Account. gcloud projects add-iam-policy-binding your-project-id \ --member serviceAccount:service-account-name@your-project-id.iam.gserviceaccount.com \ --role roles/storage.objectAdmin

September 22, 2019 · 1 min · ulysses