• Pievienot visus lietotājus pie aliases

    Do the following.

    1.
    find /home/* -maxdepth 0 | cut -d’/’ -f3 > /etc/mail/team

    2. add the following line in the file /etc/aliases
    allusers: :include:/etc/mail/team

    3. run the following command
    newaliases

    4. run this command too
    /etc/init.d/postfix reload


  • Chrome, Safari notifikācijas

    function notify(html) {
    var havePermission = window.webkitNotifications.checkPermission();
    if (havePermission == 0) {
    // 0 is PERMISSION_ALLOWED
    var notification = window.webkitNotifications.createNotification(
    'http://www.kautkas/abc.jpg',
    'title',
    ' description'
    );

    notification.onclick = function () {
    //window.open("http://www.linksuzurli.lv");
    notification.cancel();
    }
    notification.show();
    // Hide the notification after the timeout
    setTimeout(function(){
    notification.cancel()
    }, 30000);

    } else {
    window.webkitNotifications.requestPermission();
    }
    }


  • Kā rīkoties ar LVM

    apt-get install lvm2 dmsetup mdadm reiserfsprogs xfsprogs

    fdisk -l

    pvcreate /dev/hda3

    vgcreate fileserver /dev/hdb /dev/hdc

    pvdisplay

    vgscan

    vgdisplay

    lvcreate --name share --size 40G fileserver

    mkfs.ext3 /dev/fileserver/share

    df -h

    fstab:
    /dev/fileserver/share /var/share ext3 rw,noatime 0 0

    Mainam izmēru

    lvextend -L50G /dev/fileserver/share
    e2fsck -f /dev/fileserver/share
    resize2fs /dev/fileserver/share
    mount /dev/fileserver/share /var/share

    Darīts!

    lvreduce -L1G /dev/fileserver/media
    lvextend -L1.5G /dev/fileserver/media
    lvremove /dev/fileserver/films
    vgrename fileserver data
    vgremove data


  • Screen

    screen -h 24 /sbin/check & >/dev/null 2>&1
    screen -ls
    screen -r [session name]


  • Ubuntu hardware devices

    sudo lshw -short

    sudo lshw -html > hardware.html


  • ApacheTOP

    apachetop -f /var/www/vhosts/howtogeek.com/statistics/logs/access_log


  • Dzīvajā skaties logus

    tail -f /var/log/apache/myvirtualhost.log | grep 192.168.206.1


  • kā noskaidrot UUID ?

    blkid


  • Bekupojam linuxu

    tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /


  • CSF Firewall

    rm -fv csf.tgz
    wget http://www.configserver.com/free/csf.tgz
    tar -xzf csf.tgz
    cd csf
    sh install.sh