Month: February 2012

  • Creating debian template for lxc virtualization

    by

    in

    To create debian template for lxc you need fresh copy of debian system. Well, we do have one installed recently on guruplug. All debian install on guruplug steps are here.

  • Adding bridge interface for lxc containers

    by

    in

    You can make a bridge by changing network configuration file: # cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 # iface…

  • Could not chdir to home directory /home/nsc: Permission denied /bin/bash: Permission denied Connection to 192.168.1.13 closed.

    by

    in

    after creating lxc container, I wasn’t able to connect to it as a simple user. Also couldn’t change to simple user using “su”. All I got was an error: Could not chdir to home directory /home/nsc: Permission denied /bin/bash: Permission denied Connection to 192.168.1.13 closed. All permissions of home directory were correct, as to be…

  • 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/’ {} \;