Archive / linux

RSS feed for this section

ripartizionare disco Centos 7

By default in a CentOS7 install we get a couple of partitions created for the root user and one for home usually something like this: # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 70G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 […]

usermod linux guida completa

After creating user accounts, in some scenarios where we need to change the attributes of an existing user such as, change user’s home directory, login name, login shell, password expiry date, etc, where in such case ‘usermod’ command is used. When we execute ‘usermod‘ command in terminal, the following files are used and affected. /etc/passwd […]

Soluzioni per hide .htaccess, WEB-INF

fonte : f you use Apache as your web server of choice, you may wish to have files or directories that Apache pretends are not there. For me, this is because I like to have Apache proxy a servlet container backend, but I’m too lazy to separate out the files, and so I just point […]

directory protetta apache

passi da seguire: controllo: verificare che in virtuals.conf ci sia per il dominio <Directory “/var/www/domains/nomedominio/www/pathCartellaDaProteggere”> AllowOverride All </Directory>   1.) creare il file .htaccess AuthName “Secure Area” AuthType Basic AuthUserFile /path/to/your/directory/.htpasswd require valid-user 2.) proprieta’ apache.apache 3.) ricordarsi di essere nella root del sito e lanciare il comando htpasswd -c .htpasswd (nomeutente) 4.) mv .htpasswd […]


(sorgente in inglese tradotta e integrata: 10 examples of grep command in UNIX and Linux) 1) Escludere parole non rilevanti: opzione -v grep Exception logfile.txt | grep -v ERROR Trova tutte le righe che contengono “Exception” ed esclude quelle che contengono “ERROR“ 2) Contare una parola/e in un file: opzione -c grep -c “Error” logfile.txt Conta le parole […]

Sample snmpd.conf for cacti use

syslocation System Location syscontact # source community (password) com2sec Mybox localhost public com2sec cacti <you ip> public com2sec Outside default public # sec.model group RWGroup v2c Mybox group ROGroup v1 cacti group ROGroup v2c cacti group Others v2c Outside view all included .1 80 view system included system fe # context […]