Thursday, November 23, 2017

Create bootable USB from .iso file - Linux

Plug-in USB drive into your computer. Open up terminal and type :

fdisk -l

You'll see listing of drives available on your computer. Normally the USB drive will be shown like this :

/dev/sdb1 or /dev/sdc1

Now run this command:

sudo umount /dev/sd<?><?>

where first question mark is letter and second question mark is number. Then run this command:

sudo dd bs=4M if=the_image_file.iso of=/dev/sd<?><?>

Wait until finish and run command sync

Done!

Friday, January 27, 2017

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

I ran this command:

LOAD DATA INFILE '/root/tk_worker_latestjan17.csv' INTO TABLE tk_worker_temp FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 ROWS;

I got the following error:

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

Solution:

  1. Run this command  SHOW VARIABLES LIKE "secure_file_priv"; to show the configured directory.
  2. Move the file to the directory specified by secure-file-priv 

Thank you

Thursday, December 29, 2016

Laravel 4 - unserialize(): Error at offset

Enter both command below:

php artisan cache:clear <enter>
php artisan key:generate <enter>

Done!

Thursday, August 25, 2016

VMWARE Player 6.0.3 running on Centos 6 "Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module `vmmon' is loaded."


Before this I'm using the older version of vmplayer on Centos 6. Everything work fine. Last week I upgraded the vmware player to 6.0.3 and I got problem to load the guest OS. The VMware player complain that "Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module `vmmon' is loaded."

After a long time searching for a solution, finally I found it. Just follow the simple stpes below:

  1. Open your terminal
  2. Type sudo mv /usr/lib/vmware/modules/binary /usr/lib/vmware/modules/binary.old
  3. Then type sudo vmware-modconfig --console --install-all --appname="VMware Player" --icon="vmware-player"

Now I can start guest OS without any problem. Hope it helps!

Wednesday, June 29, 2016

MySQL - Error code 1140



Error Code: 1140. In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'dbname.a.column_name'; this is incompatible with sql_mode=only_full_group_by

In order to resolve this issue, we have to turn off ONLY_FULL_GROUP_BY sql_mode.

  1. Check sql_mode by issue this command:
    SELECT @@sql_mode;
  2. You'll see the output like below:
    ONLY_FULL_GROUP_BY
  3. Now turn off the ONLY_FULL_GROUP_BY by issuing this command:
    SET sql_mode = '';
Done!

Tuesday, June 28, 2016

Remove index.php from Codeigniter running on Nginx

  1. Edit your config.php file located at application/config/config.php Change value $config['uri_protocol'] = "AUTO"; to $config['uri_protocol'] = "REQUEST_URI";
  2. Put this line try_files $uri $uri/ /index.php?r=$request_uri; on nginx.conf file located at /etc/nginx/nginx.conf. The nginx.conf file should be like this: 
  3. location / {
           index  index.php;
           try_files $uri $uri/ /index.php?r=$request_uri;
    }
  4. Restart nginx service nginx restart
  5. Done!

Sunday, June 26, 2016

APACHE - Disable directory browsing


  • otoworkz
    • upload
      • images
      • sound

Let say we have a directory structure like above, and we want to block any direct access to the upload folder the child folder (images, sound). So how? follow these instruction:

  1. Create .htaccess file with the following content:
    Options -Indexes
  2. Put it under upload folder.
  3. Change file permission to 755:
    sudo chmod 755 .htaccess
  4.  Restart the Apache and done!

* if still not work, try to enable mod_rewrite module on Apache httpd.conf file.