• download folder from web

    Get only zip files
    wget -A zip -r -l 1 -nd http://url.com/

    Get all files except html etc.
    wget -R html,htm,php,asp,jsp,js,py,css -r -l 1 -nd http://url.com

  • Get file header

    head test2.svn.gz|hexdump -C

  • Virtualmin DNS error


    prepend domain-name-servers;

  • opened port -> PID

    fuser -n tcp 1024

  • Build debian kernel

    Install required packages

    sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc
    sudo apt-get --no-install-recommends install kernel-package
    Download kernel
    wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.xz
    unxz linux-4.4.tar.xz
    tar xvf linux-4.4.tar
    Copy your config file and configure
    cd linux-4.4
    $ cp /boot/config-$(uname -r) .config

    make menuconfig
    make-kpkg clean
    fakeroot make-kpkg --initrd --revision=1.0.myname kernel_image kernel_headers -j 4
    sudo dpkg -i ...

  • dmesg erroru meklēšana

    dmesg | more
    dmesg | egrep -i --color 'error|critical|failed'

  • opcache




    opcache_revalidate_freq = 240

    sudo php5enmod opcache

    sudo service apache2 restart

  • WordPress behind nginx

    if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] )
    && preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/',

  • vlc as root

    sed -i 's/geteuid/getppid/' /usr/bin/vlc

  • proftpd shut down issue

    Find this line:
    start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
    Change to this:
    start-stop-daemon --stop --signal $SIGNAL --retry 1 --quiet --pidfile "$PIDFILE"