Category Archives: troubleshooting

WordPress HTTP error on image upload (Nginx)

HTTP Error during image upload on wordpress
HTTP Error during image upload on wordpress

Recently, I’ve encountered this kind of problem. Maybe because it has been awhile I’m not uploading any images to my post :p

Anyway, if you came out with this kind of error and using Nginx as your web engine, here how to solve it.

Add:

client_max_body_size 100m;

to your nginx .conf file.

For example, mine looks something like this:

server {
        listen 80;
        root /usr/share/nginx/www;
        index index.php index.html index.htm;
#
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
        fastcgi_read_timeout 180;
        client_max_body_size 100m;
#
        location / {

Hope it helps. πŸ™‚

Credit to aaronjholbrook

Restore grub without live CD on Linux

If you start your Ubuntu and it display a grub shell to you, you can run this command below to fix it:

grub-rescue> prompt
             ls
             set prefix=(hdX,Y)/boot/grub
             set root=(hdX,Y)
             set
             ls /boot
             insmod /boot/grub/linux.mod
             linux /vmlinuz root=/dev/sdXY ro
             initrd /initrd.img
             boot

* Ensure that you entered correct partition (e.g. hd0,1) for hdX,Y. If not, than your grub will be messed.

References :
http://superuser.com/questions/181733/how-can-i-restore-grub-without-a-live-cd1
http://www.linux.com/learn/tutorials/776643-how-to-rescue-a-non-booting-grub-2-on-linux

Remove .svn folder from Github repo

For those who are using Github services, and pushing their code via terminal, you may encounter this problem where you will see a folder named .svn on each folder of your code.

So if you want to delete this folder, follow this step below:

First, pull your code from Github to your computer:

git pull origin master

Then, use this command to find folder .svn and delete it:

find . -name '.svn' | xargs git rm -rf --ignore-unmatch

Last, push your code back to Github server:

git push origin master

BootCamp Assistant error

BootCamp

For Mac users, have you ever encountered something like this?

The disk cannot be partitioned because some files cannot be moved.

This error encountered during partitioning hard disk using BootCamp Assistant to install Windows as dual-boot in your Mac OS.

The Solution.

  • Reboot. Hold the “command-key + S key”
  • After that, a terminal will appears. Type in “fsck -fy” (without quote) and press Enter
  • It will start restoring & repairing your hard disk
  • Wait until it complete
  • After finished, type “reboot” and press Enter to restart

svn error during msfupdate

Subversion Error

Any idea how to solve it? I encounter this when I want to update my metasploit. So, what I do to solve this problem (maybe temporarily) is:
install latest subversion via macports:

add this line:

to your ~/.profile

so, mine look like this:

then perform:

and this:

you will get like this..

Hope this helps. Maybe la. :p

CSRF in SpiceFuse Shoutbox (MyBB)

bagi sape2 yg ade forum yg berasaskan MyBB, dan yg menggunakan SpiceFuse Shoutbox, baik korg baca bnd ni..
sbb ade bnd yg menarik kat sini.. πŸ™‚
bnd ni Johnburn dr tbd.my yg jmp.. jd aku share kn kat sini..
special thanx to Johnburn utk artikel & solution ni.. πŸ™‚

The stories:
Tadi xda keje aku tgk2 code mybb dengan target nk bypass xss filter mybb melalui bbcode dia. dlm aku tgk2 tu aku nmpk satu bnda yg agak menarik pada code shoutbox (aku install plugin SpiceFuse Shoutbox yg sama mcm kt TBD and my0d). Plugin ni vulnerable kepada CSRF melalui image tag.

PoC:
Jika user post yang berikut kat shoutbox, mana2 user len yg view shoutbox secara automatik akan turut post sebarang post jika browser diset untuk load image (default).

http://www.tbd.my/v2/xmlhttp.php?action=add_shout&shout_data=sebarangPost

Quick Fix:
Bleh elak dengan menggunakan token pada shoutbox. Untuk tmbah token, bleh ikut yg berikut:

Edit file ni:

cari line berikut:

dan gantikan dengan line ni:

Edit file ni:

cari line:

tambah line berikut selpas code di atas:

cari line berikut:

dan gantikan dengan line ni:

Edit file ni:

cari line berikut:

tambah code berikut selepas baris code di atas:

p/s: mungkin perlu reactivate blk shoutbox supaya apa yg diubah pada template untuk take effect.

Changing MySQL root user Password

Bagi sapa2 yang selalu menggunakan MySQL database,
pernah tak jadi kat korang dimana korang terlupa password ‘root’ korang?
Haa.. Aku dah terkena dah sekali..
Dan memang sangat tebaik.. Huhu..

Lalai betul aku nih..
Ntah macam mana aku boleh lupa pulak password aku..
So kat sini aku sharekan solution macam mana nak reset password untuk ‘root’ korang..

  1. Stop kan mysql service

  1. Lepas tu korang start kan balik mysql server tu supaya nanti korang boleh akses ke mysql server tu tanpa menggunakan password

  1. Connect ke mysql server dengan menggunakan mysql client

  1. Buat password baru untuk ‘root’ user

  1. Stop kan mysql server

  1. Start balik macam biasa

Haa.. Dengan mengikuti cara ni, insyallah server MySQL tu boleh diakses sebagai ‘root’ user dengan menggunakan password yang baru korang bubuh tu..

Nginx – 413 Request Entity Too Large

Haa.. Seperti tajuk diatas, bagi sape2 yang pernah configure & run server Nginx ni, korang pernah kena macam ni tak?
Benda ni jadi masa aku nak uploadkan theme kat wordpress.. Nak install theme la..
Saiz theme tu dalam 1.2MB.. Sekali keluar error macam tu..
So, dicari2 solutionnya.. Jumpa jugak..

Mari kita tengok macam mana solution dia..
First, kita kena edit file configuration nginx ni.. Kita taip ni:

Masukkan password korang, dan nanti keluarlah configuration dia kat terminal tu..
Lepas tu kita kena masukkan line ni..

Function dia untuk menetapkan jumlah memori untuk server tu..
Letakkan line tadi tu kat sini..

http {
include /etc/nginx/mime.types;

access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 2;
tcp_nodelay on;

gzip on;
gzip_disable “MSIE [1-6].(?!.*SV1)”;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

client_max_body_size 4M;
client_body_buffer_size 128k;
}

Haa.. Nampak tak? Lepas tu korang tekan CTRL-O untuk write-out dan save..
Nak exit tekan CTRL-Z.. Lepas tu korang try restart nginx korang.. taip kan:

Kalau tak ada masalah apa2, dia akan restart dengan elok.. Lepas tu try korang upload theme tu balik..
Insyallah mesti boleh.. Sebab aku da buat & da jadi pun! πŸ˜€
Apa2 pertanyaan bolehlah tanya aku.. Insyallah aku cuba tolong korang..