Kategoria - Linux - liczba wpisów 197
Debian, Ubuntu, Fedora

How to remove array from MDADM Raid Kategoria: Linux | Autor: Bartłomiej Gałęzia

https://ubuntuforums.org/showthread.php?t=884556

sudo fdisk -l
sudo mdadm --detail /dev/md0
sudo umount /dev/md0
sudo mdadm --stop /dev/md0
sudo mdadm --zero-superblock /dev/sdax
sudo mdadm --zero-superblock /dev/sdbx

Firewalld NFS rule Kategoria: Linux | Tagi: firewalld, linux | Autor: Franciszek Musiel

### NFS

firewall-cmd --permanent --add-service=nfs

firewall-cmd --permanent --add-service=mountd

firewall-cmd --permanent --add-service=rpc-bind

firewall-cmd --reload

CentOS7 Installing nmon on Linux Kategoria: Linux | Tagi: monitoring, NMON, stats, linux | Autor: Franciszek Musiel

http://www.cyberciti.biz/faq/nmon-performance-analyzer-linux-server-tool/

 

# Get Root
sudo su

# Download NMON archive
cd /tmp
wget http://nmon.sourceforge.net/docs/MPG_nmon_for_Linux_14a_binaries.zip

# Install unzip if you don't have
yum install unzip

# Unzip archive
unzip MPG_nmon_for_Linux_14a_binaries.zip

# Copy nmon file
cp nmon_x86_64_centos5 /usr/local/bin/
chmod a+x /usr/local/bin/nmon_x86_64_centos5

# Create symbolic link
ln -s /usr/local/bin/nmon_x86_64_centos5 /usr/local/bin/nmon

# vim ~/.bashrc
   alias nmon='. ~/.bashrc'

# . ~/.bashrc

NTP Linux Windows Kategoria: Linux | Autor: Bartłomiej Gałęzia

Wine - całkowite odinstalowanie i wyczyszczenie Kategoria: Linux | Tagi: linux, ubuntu, Wine | Autor: Franciszek Musiel

Całkowite usunięcie i wyczyszczenie systemu po  WINE


sudo apt-get remove wine rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/wine*
rm -rf $HOME/.local/share/applications/wine
rm -f $HOME/.local/share/desktop-directories/wine*
rm -f $HOME/.local/share/icons/????_*.xpm
sudo apt-get remove –purge wine
sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
pdbedit -v username

Zobacz całość

Nagios add check_snmp command Kategoria: Linux | Tagi: nagios, snmp | Autor: Bartłomiej Gałęzia

http://www.linuxquestions.org/questions/linux-networking-3/using-nagios-check_snmp-plugin-to-get-snmp-info-from-computer-751057/

vim /etc/nagios3/commands.cfg
define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o $ARG1$
        }
vim /etc/nagios3/objects/hostname.cfg
define service{
        use                             generic-service
        host_name                       laptop
        service_description             Admin email
        check_command                   check_snmp!.1.3.6.1.2.1.1.4.0
        }

How to check snmp available commands Kategoria: Linux | Tagi: nagios, snmp | Autor: Bartłomiej Gałęzia

Z wiersza poleceń:

snmpwalk -v1 -c public 192.168.1.1

http://cuddletech.com/articles/snmp/node13.html

Nagios nie chce wywoływać zdalnych poleceń przez nrpe:

define service{
          use                 generic-service
          host_name           komputer
          service_description Free Space /dev/sda1
          check_command       check_nrpe!check_sda1
          }

przez stronę pojawia się tylko komunikat

(No output returned from plugin)

Zobacz całość

http://askubuntu.com/questions/471847/brightness-fn-key-shortcut-doesnt-work-on-asus-laptop

sudo gedit /etc/default/grub

change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="
sudo update-grub

Nodimm - Raspbian Kategoria: Linux | Autor: Bartłomiej Gałęzia

https://www.raspberrypi.org/forums/viewtopic.php?t=57552 - nie działa

sudo aptitude install xscreensaver
vim /home/pi/.xscreensaver
mode:           off

Dodawanie nowego Virtual Hosta w Apache 2 Kategoria: Linux | Tagi: apache2 | Autor: Bartłomiej Gałęzia

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts


Najpierw tworzymy nowy katalog na pliki strony

sudo mkdir -p /var/www/example.com/public_html


I nadajemy odpowiednie uprawnienia

sudo chown -R $USER:$USER /var/www/example.com/public_html
sudo chmod -R 755 /var/www


Dodajemy nowy plik konfiguracyjny w katalogu /etc/apache2/sites-available

sudo nano /etc/apache2/sites-available/example.com.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Aktywujemy nową stronę i restartujemy apache

sudo a2ensite example.com.conf
sudo service apache2 restart

Redmine konfiguracja powiadomień e-mail SMTP Kategoria: Linux | Autor: Bartłomiej Gałęzia

vim /usr/share/redmine/config/configuration.yml
# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: smtp.domain.com
      port: 587
      domain: domain.com
      authentication: :login
      user_name: "redmine@domain.com"
      password: "password"
cp /usr/share/redmine/config/configuration.yml /etc/redmine/configuration.yml

W wersji 4+

vim /opt/redmine/config/configuration.yml
# default configuration options for all environments
production:
  delivery_method: :smtp
  smtp_settings:
          #    tls: true
    enable_starttls_auto: true
    address: smtp.domain.com
    port: 587
    domain: domain.com
    authentication: :plain
    user_name: "redmine@domain.com"
    password: "redmine_password"
service apache2 restart

OwnCloud - prywatny dropbox Kategoria: Linux | Autor: Bartłomiej Gałęzia

https://owncloud.org/install/

 

aptitude install mc vim nmap screen
 
aptitude install apache2 mysql-server php5 phpmyadmin php5-curl  libqt4-sql-sqlite
 
 
 
mysql -uroot -p
 
CREATE DATABASE owndb;
 
 
 
https://owncloud.org/install/#install-clients

Mount - w bardziej przejrzystej postaci Kategoria: Linux | Autor: Bartłomiej Gałęzia

vim ~/.bashrc
alias mount='mount |column -t'
/dev/sda1         on  /                         type  ext4                   (rw,errors=remount-ro)
proc              on  /proc                     type  proc                   (rw,noexec,nosuid,nodev)
sysfs             on  /sys                      type  sysfs                  (rw,noexec,nosuid,nodev)
none              on  /sys/fs/fuse/connections  type  fusectl                (rw)
none              on  /sys/kernel/debug         type  debugfs                (rw)
none              on  /sys/kernel/security      type  securityfs             (rw)
udev              on  /dev                      type  devtmpfs               (rw,mode=0755)
devpts            on  /dev/pts                  type  devpts                 (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs             on  /run                      type  tmpfs                  (rw,noexec,nosuid,size=10%,mode=0755)
none              on  /run/lock                 type  tmpfs                  (rw,noexec,nosuid,nodev,size=5242880)
none              on  /run/shm                  type  tmpfs                  (rw,nosuid,nodev)

Scroll Out - email firewall Kategoria: Linux | Tagi: email, firewall, postfix | Autor: Bartłomiej Gałęzia

SSH - wymiana kluczy - automatyczne logowanie Kategoria: Linux | Tagi: ssh | Autor: Bartłomiej Gałęzia

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

ssh-keygen
ssh-copy-id user@11.22.33.44 //remote machine
ssh user@11.22.33.44 //nopassword

Rsync - tutorial Kategoria: Linux | Tagi: Rsync | Autor: Bartłomiej Gałęzia

http://linux.die.net/man/1/rsync

http://www.thegeekstuff.com/2010/09/rsync-command-examples/

 

sudo aptitude install rsync

rsync -av root@10.20.30.1:/home/* /mnt/home

 

-a option is a combination flag. It stands for "archive" and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.

-z If you are transferring files that have not already been compressed, like text files, you can reduce the network transfer by adding compression with the -z option:

-P flag is very helpful. It combines the flags --progress and --partial. The first of these gives you a progress bar for the transfers and the second allows you to resume interrupted transfers

Samba Domain - Remove machine Kategoria: Linux | Tagi: samba | Autor: Bartłomiej Gałęzia

http://superuser.com/questions/446603/samba-domain-controller-remove-1-windows-client

pdbedit -L -w | grep '\[[WI]'  //lista komputerów podłączonych do domeny
pdbedit -L -w | grep '\[[WI]' | grep machine_name
pdbedit -x -m machine_name //usuń komputer