Categories
Linux MySql Open Source Solutions

How to Rename Column in Mysql

To Rename a Column in Mysql we need to use the ALTER query with CHANGE COLUMN statement. The standard version of this query is:

ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name
CHANGE [COLUMN] old_col_name new_col_name column_definition
[FIRST|AFTER col_name]


For Example:

ALTER TABLE City CHANGE CityId cityId varchar(25) NOT NULL;

Note: You will need to mention every constraint of the original column as defaults are assumed otherwise.

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

Fixing Open Office Issue – User Installation could not be completed

Encountered this issue while trying to run Open Office from a newly installed Ubuntu box:

This application could not be started.
User installation could not be completed.

To fix this issue you need to basically reset the config of LibreOffice. This can be done using the following command (Warning: This deletes all your settings and config wrt LibreOffice):

rm -rf ~/.config/libreoffice

Note: This issue can also occur when the permissions of the config folder is incorrect (root instead of user), use this command to fix that issue:

chown haas -r ~/.config/libreoffice

Categories
Device Hardware Linux Open Source Solutions Ubuntu

Fixing USB Keyboard & Mouse Boot Problems in Ubuntu

USB Cables
USB Cables (Photo credit: incurable_hippie)

Sometimes on startup, Ubuntu does not recognize my USB Keyboard & Mouse. This problem is frustrating as Windows seems to recognize them.

It took me a while to recognize the root of the problem was with the USB 3.0 ports on the Motherboard. By moving the usb connections to the USB 2.0 ports on the motherboard this problem was solved.

Problem: USB Keyboard and Mouse dont work on boot up.
Solution: Move the connectors to the devices from a standard USB 3.0 port to standard USB 2.0 port(check with your motherboard manual for specifics)

Enhanced by Zemanta
Categories
Hardware Linux Solutions Web

How to Create a Bootable SeaTools USB – SeaGate Linux

Seagate U6 3.5 inch 40 GB hard disk.
Seagate U6 3.5 inch 40 GB hard disk. (Photo credit: Wikipedia)

SeaTools is a diagnostic tool to check your hard disk for errors and failure. Its an extremely useful tool to have around as hard disks fail all the time and recognizing a failing hard disk can save you a lot of trouble in the long run.

You can get a copy of the bootable iso from here: http://www.seagate.com/support/downloads/item/seatools-dos-master/
{adinserter 3}
So here is a guide to create a bootable SeaTools USB drive for Ubuntu:

  1. Install syslinux:
    $ sudo apt-get install syslinux
  2. Format the USB drive and Repartition it as FAT
    Give it a name like  “SEATOOLS”
  3. Mark the newly created partition as bootable – You can use Gparted to do this.
  4. Copy “syslinux” master boot record to drive (The code below is assuming your drive is loacated at “sdb”):
    $ sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdb
  5. Install syslinux on the drive partition:
    $ sudo syslinux /dev/sdb1
  6. Mount drive. You can do this by reinserting the drive or by using a command like:
    $ sudo mount /dev/sdb1 /mnt
  7. Copy the MEMDISK bootloader from /usr/share/syslinux/memdisk to the drive:
    $ cp /usr/lib/syslinux/memdisk /media/SEATOOLS
  8. Copy the SeaToolsDOS223ALL.ISO to the drive
  9. Create a file named ‘syslinux.cfg’ on the drive, with this in it (use correct .iso name):
    DEFAULT SeaTools
    LABEL SeaTools
    LINUX memdisk
    INITRD SeaToolsDOS223ALL.ISO
    APPEND iso

 

Thats it you’re done 🙂  Try booting with it. Here’s what my usb stick looks like at the end of all of this:

$ ls -l
total 3136
-r--r--r-- 1 username username 32768 2013-12-22 17:44 ldlinux.sys
-rw-r--r-- 1 username username 25244 2013-12-22 17:51 memdisk
-rw-r--r-- 1 username username 3137536 2013-12-22 13:22 SeaToolsDOS223ALL.ISO
-rw-r--r-- 1 username username 97 2013-12-22 17:54 syslinux.cfg