Category: linux

  • sudo without password

    by

    in

    This line should do the job: your_username ALL=(ALL) NOPASSWD: ALL You can edit sudoers file by entering command “visudo”.

  • varnish+nginx as backend and real IP

    by

    in

    With default config nginx all IP addresses shows as localhost. Here is configuration to show real client IP. Snippet from varnish config: sub vcl_pipe { set bereq.http.connection = “close”; if (req.http.X-Forwarded-For) { set bereq.http.X-Forwarded-For = req.http.X-Forwarded-For; } else { set bereq.http.X-Forwarded-For = regsub(client.ip, “:.*”, “”); } } sub vcl_pass { set bereq.http.connection = “close”; if…

  • Replace string in all files using sed in linux

    by

    in

    Replaces all “OLDSTRING” to “NEWSTRING” in all files $ grep -rl OLDSTRING * | sort | uniq | xargs sed -i -e ‘s/OLDSTRING/NEWSTRING/’ or using find: find */public_html/ -iname ‘*.php’ -exec sed -i -e ‘s/OLDSTRING/NEWSTRING/’ {} \;

  • Installing debian to guruplug SD card

    by

    in

    Before installing debian, You need to prepare tftp server and connect to guruplug via serial console. Also You’ll need UTP cable for network connection and SD card for installing the base system.

  • Centos wordpress php-fpm + nginx + apc

    by

    in

    If you tired of having same old apache, and want something more fast and reliable, you can install nginx + php-fpm. Firstly you need to install new repo, to have ability to add those packages. And php-fpm works out of the box (without need to patch PHP) with version PHP 5.3. Official repository does not…

  • Installing uboot to guruplug server plus

    by

    in

    The first thing you have to do, is to read this: http://loginroot.com/disclaimer/ Before installing uboot to guruplug server plus you have to set few things. You have to be able to connect to Guruplug via serial connection. The second thing, is to have tftp server up and running. Also you need to have utp cable…

  • Guruplug serial connection

    Guruplug serial connection

    by

    in

    If you cannot connect to guruplug for some reason via lan interface, for example sshd stopped running or just firewalled yourself out of it, you can connect to it using serial connection.

  • Create tftp server on ubuntu 11.10

    Create tftp server on ubuntu 11.10

    by

    in

    For some tasks, like loading bootloader you need to have tftp server. Here are few steps to set it up and get it running.

  • Recover mysql root password

    Recover mysql root password

    by

    in

    It happens quite often, that You need to do something on database, which was installed long long time ago. And nobody remembers the root password. Kinda good practice is to save mysql password in root user directory with a “.” in front of it (hidden), for example .my.cnf Nobody can read root users directory, except…