Postări

Se afișează postări din 2013

Take ownership of a folder

run cmd as administrator takeown /F d:\folder /R

Debug

See logs in real time: tail -f /var/log/apache2/error.log Searching a specific word tail -f /var/log/apache2/access.log | grep .jpg

Linux usual commands

change rights recursive: chmod -R 775 file change owner recursive: chown -R user:group file Process analyze:          #  ps -A and # top , ps -fax Remove package:         apt-get --purge remove package memory info:                  free -m Set timezone in ubuntu:   dpkg-reconfigure tzdata Extract tar archive :        tar jxvf archive.tar.bz2 Create tar.gz archive preserving permisions       tar -pczf name_of_your_archive.tar.gz /path/to/directory Uncompress:   tar zxf archive.tar.gz uncompress bziped:   tar jxf archive.tar.bz2 Add group  # groupadd groupname Add user  # useradd username User Info   # id username Add existing user to group www-data # usermod -a -G www-data username Install imagemagik: #  apt-get install imagemagick --fix-missing Ubutu  timezone set:  fi...

Remove duplicate words

text text other text $phrase= preg_replace("/\b(\w+)\s+\\1\b/i", "$1", $phrase); text other text

regexp

regexp string plus number $str=preg_replace('/mystring \([0-9]+\)/', ' ',$str); regex comma separated values /IN \(([0-9]+)(,\s*[0-9]+)*\)/

Current year in python google apps

import time year=time.gmtime().tm_year

Stats

Stats number of connections on port 80 netstat -an | grep :80 | sort