Categories
Linux Solutions Ubuntu Web

WordPress: Error Uploading Media Files

I recently got the following error while uploading media to my wordpress site:

Unable to create directory uploads/2016/06. Is its parent directory writable by the server?

Here are the steps to fix the issue:

  • Possible Issue 1: Incorrect Directory pointed to in the settings:
    • Open your WordPress Admin page (this is usually at /wp-admin)
    • Hover over the sidebar menu “Settings” and then click on “Media
    • Check the section “Uploading Files“(If this section is missing then try the next solution)
    • check the value for “Store Uploads in This Folder
    • Most commonly the value should be “wp-content/uploads“, if not is should be pointing to the correct folder on the server. My setup had it pointing to the wrong directory with the wrong permissions.
  • Possible Issue 2: Wrong permissions
    • Login to your server via ssh or ftp
    • Traverse to the installation folder of the WordPress site
    • Check and see if the user:group settings are correct (Usually for UNIX systems its www-data:www-data)
    • If that is fine look at the permissions for the ‘uploads‘ directory and its sub directories
    • running a command ‘ls -l uploads‘, will give you the permissions set
    • The ideal permission is of 755. For this run the command “chmod -r 755 uploads

Hopefully that will solve your problems.

Categories
Linux Open Source Solutions

ssh-copy-id – Perform SSH Login Without Password

If you regularly ssh to same system, ssh-copy-id allows you to login to the system directly without having to type the password each time. ssh-copy-id is a small script which copies your ssh public-key to a remote host. It appends the key to your remote authorized_keys enabling you to login without having to type your password each time.

Use it by running the following command: ‘ssh-copy-id tech@192.168.1.1‘ where ‘tech’ is the username of the remote system and ‘192.168.1.1’ its IP address. The command will ask you for the remote machine‘s password(one last time).

$ ssh-copy-id tech@192.168.1.1
tech@192.168.1.1’s password:

Now try logging into the machine, with “ssh tech@192.168.1.1“. You should get the remote systems command prompt.

Categories
Hardware Solutions Ubuntu

Ubuntu Check Disk for BadBlocks & Errors

Toshiba HDD2189 2.5" hard disk drive plat...
Toshiba HDD2189 2.5″ hard disk drive platters, head and actuator arm. near 1:1 macro. (Photo credit: Wikipedia)

If your system regularly does ubuntu check disk or scan disks on boot up and if it often finds errors during the check, its highly possible that you have bad sectors on your hard disk.  In such cases its highly recommended to do a disk check to detect if you have bad sectors on the disk.

Categories
Linux Solutions

Compressing files in Linux & Unix – Cheat Sheet

Here is a quick cheat-sheet on How To Compress files in Linux & Unix

Zip
zip archive file1 file2 file3
Compresses file1 file2 file3 into an achive with filename archive.zip

zip archive *
Compresses all files in the current directory into an achive with filename archive.zip

zip -r archive dir
Compresses the directory dir(and its subdirectories) into an achive with filename archive.zip

unzip archive.zip
Uncompresses the archive archive.zip to the current directory

unzip archive.zip -d dir
Uncompresses the archive archive.zip to the directory dir

Categories
Chrome Firefox Open Source Solutions Web

Deleting specific Cookies in Firefox & Chrome

Sometimes when websites are updated,they tend to change the way they manage cookies.  What happens then is that there is a small possibility of certain parts of the website not functioning as the old cookies remain in the browser.  In those cases the best approach is to remove the errant cookie and let the website recreate the cookies.

Here is a quick tutorial on how to do that:

Firefox:

  • Click on Tools, then Options (or Edit | Preferences on Linux)
  • Select Privacy
  • In the Cookies panel, click on Show Cookies
  • To remove a single cookie click on the entry in the list and click on the Remove Cookie button
  • To remove all cookies click on the Remove All Cookies button
  • Voilà, you are done 🙂

Chrome:

  • Click the “wrench” icon on the browser toolbar (usually on the right extreme)
  • Click the Under the Hood tab.
  • Goto the Content settings in the “Privacy” section.
  • Click the Cookies tab in the Content Settings dialog that appears.
  • Click All cookies and site data to open the Cookies and Other Data dialog.
  • To delete all cookies, click Remove all at the bottom of the dialog.
  • To delete a specific cookie, select the site that issued the cookie, then the cookie, and click Remove.
  • Voilà, you are done 🙂