Fix WordPress Permissions

Here’s the recommended permissions for WordPress.

Permissions

Directories = 755
Files = 644

Install From Scratch

If you’re starting from scratch, follow the instructions below.

Assuming you’re logged in as normal user. Use sudo to execute commands as superuser.

cd /var/www/
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xzvf latest.tar.gz
sudo chown -R www-data:www-data wordpress

Fix Current

If your permissions are wrong, then perform the following.

sudo find /var/www/wordpress/ -type d -exec chmod 755 {} \
sudo find /var/www/wordpress/ -type f -exec chmod 644 {} \

Nextcloud

Nextcloud is the next generation open source file storage and file synching platform. It’s similar to Dropbox, Google Drive and Microsoft OneDrive. The main difference is that you run the software on your own server. This is a perfect solution if you’re worried about mass surveillance. It’s safe enough to place on the cloud. Better yet, you can run it on your local network at home. It behaves somewhat similar to a NAS (Network Attached Storage) but with a better web interface, and a few more apps.

In addition, you can install the client software on your Desktop (PC, MAC and Linux) or to any mobile device (iOS, Android and Windows). The clients automatically sync data to the server software that’s installed on a Linux server. Files can also be accessed using WebDav as well. It has an online office, a video chat feature and Outlook email integration, but I’m not really interested with those additional features. I use it primarily for storage and file synching only. It works great by the way.

Give Nextcloud a try.

Packages Have Been Kept Back

What do you do when you get this message “the following packages are being kept back.” And what exactly does it mean?

When performing updates in Ubuntu, you typically run these two commands from the command line.

$ sudo apt-get update
$ sudo apt-get upgrade

If there are updates, it will sometimes ask you to type “Y” or “yes.”

Sometimes you get this message.

$ sudo apt-get upgrade                                                                                                
Reading package lists... Done                                                                                                          
Building dependency tree                                                                                                               
Reading state information... Done                                                                                                      
The following packages have been kept back:                                                                                            
  linux-headers-server linux-image-server linux-server                                                                                 
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

This means that these packages were not installed or kept back because they have additional packages that are introduced, and the upgrades depend on them.

You can fix this by running:

$ sudo apt-get dist-upgrade

Or you can individually install the packages you want instead of globally.

$ sudo apt-get install package-name

How to Live Stream Using FFmpeg

FFmpeg is a complete cross-platform command-line tool for recording, converting and streaming audio and video files. FFmpeg is widely used for converting files from one format to another. It also used by some to record videos from the screen or camera. It’s also used by others to live stream a recorded file or camera to a RTMP streaming server such as Wowza, YouTube or Facebook Live.

How to record your camera to a video file.

$ ffmpeg -f avfoundation -i "1:0" -t 00:00:15 -s 1280x720 -r 30 -b:v 3500k -b:a 128k out.mpg
$ ffmpeg -f avfoundation -i "2:0" -t 00:00:15 -s 1280x720 -r 30 -b:v 3500k -b:a 128k out.mpg

-i = “video:audio”
-t = duration
-r = fps
-b:v = video bitrate
-b:a = audio bitrate

How to stream a video file to a RTMP server

$ ffmpeg -re -i input.mp4 -vcodec libx264 -preset veryfast -maxrate 1500k 
  -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://yourserver:1935/live/mystream

How to live stream your screen monitor to a RTMP server

$ ffmpeg -f avfoundation -i "2:0" -vcodec libx264 -preset ultrafast 
  -pix_fmt yuv420p -s 1280x720 -r 30 -b:v 1500k -bufsize 1500k -maxrate 7000k 
  -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://yourserver:1935/live/mystream

How to stream your camera to a RTMP server

$ ffmpeg -f avfoundation -i "1:0" -vcodec libx264 -preset ultrafast 
  -pix_fmt yuv420p -s 1280x720 -r 30 -b:v 1500k -bufsize 1500k -maxrate 7000k 
  -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://yourserver:1935/live/mystream

To learn details of FFmpeg options, read the documentation.

If you need assistance with the install, please see my previous post.

Homebrew

Homebrew is the missing package manager for the Mac OS. It’s missing because the MacOS doesn’t have one. Homebrew is the MacOS equivalent of apt-get or aptitude in Ubuntu Linux. With Homebrew installed on your MacOS, you can easily install and uninstall programs, packages, and utilities via the command line. For example, to install the wget, apache, git and ffmpeg, you can run the following commands from the Terminal.

$ brew install wget
$ brew install apache
$ brew install git
$ brew install ffmpeg

If you don’t have Homebrew installed, run the following command from the Terminal.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

If for some unexplained reason you’re having problems with Homebrew, you can uninstall and reinstall it.

$ rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"