Sunday, June 3, 2012

Primii pasi in crearea unui site web

Foarte multi care doresc sa creeze/achizitioneze un site web cred ca ar trebui sa aiba macar notiuni elementare despre ceea ce inseamna un site web, costurile ce le implica, promovarea si planurile de viitor legate de acest site.

E bine de stiut de la bun inceput ca un site web implica continuitate dupa ce acesta este creat, daca doriti un site web doar ca sa va "laudati" ca aveti unul, eu va spun ca e o pierdere de timp si de bani!

E bine de stiut ca orice proiect de acest gen pe internet facut intr-un mod profesionist implica o serie de costuri ca sa aduca profit din primele luni. Nu exista decat in cazuri foarte rare site-uri web care sa produca inca din primele doua, trei luni de la creare, nu cereti imposibilul celor care va creaza site-ul.Mai mult partea de optimizare website este foarte importanta, fara de care pozitionarea in motoarele de cautare pare ca un vis indepartat

Va voi descrie acum din punctul meu de vedere pasii pe care trebuie sa ii urmati cand doriti sa va incepeti o afacere pe internet sau pur si simplu sa aveti un site web:

1. Inainte de a incepe sa cautati o firma care ofera servicii web design sau pe cineva care sa va creeze site-ul trebuie sa va ganditi la urmatoarele: "Ce domeniu de activitate vreti sa aiba site-ul?", "Ce urmeaza sa contina site-ul", "Care este concurenta ce o veti avea pe internet?", "Mai exista un alt site la fel ca al dumneavoastra?", "Cate resurse financiare aveti disponibile pentru acest proiect?".

2. Daca v-ati gandit la cele de mai sus aveti doua variante mai departe: cautati o firma de webdesign sau apelati la freelanceri(persoane care lucreaza pe cont propriu). Ce e bine de stiut e faptul ca nu de fiecare data o "mare" firma de hosting va crea un super site de calitate grafica, la nivel de programare si optimizare web.

O firma de webdesign va avea intotdeauna un cost mult mai mare pentru site-ul dumneavoastra datorita faptului ca: au mai multi oameni de platit care lucreaza pentru acelasi proiect, exista costuri destul de mari de intretinere a firmei, dar ar trebui sa ofere profesionalitate, calitate si garantie pentru produsele oferite(firmele serioase asta fac - sunt foarte putine la noi in tara).

Un freelancer va poate oferi deasemenea servicii foarte bune si aveti avantajul ca sunt mult mai flexibili si mai implicati in proiectele care le fac cand primesc o suma motivanta care oricum este sub nivelul celei de la o firma. Trebuie insa sa fiti atenti cu ce persoana lucrati, unde ati gasit acea persoana, mai are recomandari de la alte persoane...si va sfatuiesc sa luati legatura cu cel putin un client din portofoliul afisat de persoana cu care doriti sa va faceti site-ul.

Nota: Asigurati-va ca domeniile web pentru care dati bani sunt cumparate pe numele dumneavoastra, nu pe numele celor care va fac site-ul!

3. Un site web implica urmatoarele costuri: 

  • domeniu web(daca domeniul este .ro se plateste o singura data pe viata, cel putin pana se schimba legea in Romania, daca este alta extensie se plateste anual);
  • gazduire domeniu web(un domeniu are neaparat nevoie de gazduire web);
  • costuri de realizare website;
  • costuri de mentenanta/intretinere lunara a site-ului.

Cam asta.Pe internet au aparut si o serie de firme care pot sa va ofere un site de calitate la preturi competitive.

Continue Reading »

Tuesday, April 17, 2012

Import Sql(dump file) to mysql database

First lets look at what is mySQL database?


MySQL is a relational database management system (RDBMS) which has more than 11 million installations. The program runs as a server providing multi-user access to a number of databases. MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now a subsidiary of Sun Microsystems, which holds the copyright to most of the codebase. The project's source code is available under terms of the GNU General Public License, as well as under a variety of proprietary agreements.

Why use import or export of sql dump file (scenario)?


I have two MySQL databases located on a server somewhere. I connect via secure shell. I don't know all of the details about the configuration of this particular server but it obviously has MySQL installed/configured properly and you can assume that any other 'very likely' items would also be resident. I need to completley copy one database into the other (one is currently quite large, the second is empty).
And the easiest way to do this is use sql export to dump file and sql import of dump file to mySQL database.

How to create mySQL dump file (export database to sql file)?


The easiest way to export is use next syntax in command prompt (cmd):
mysqldump -u USER -p PASSWORD DATABASE > filename.sql
For example we have database with next parameters:

database username
baseu01

database password
h4z56s3

database name
database01

sql export file name
export.sql

Appropriate command line for export is:
mysqldump -u baseu01 -p h4z56s3 database01 > filename.sql
After executing export command you will have file "export.sql" in your folder.
Example how sql export dump file looks like:

-- phpMyAdmin SQL Dump
-- version 2.9.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 26, 2007 at 07:14 AM
-- Server version: 4.1.21
-- PHP Version: 4.4.2
--
-- Database: `optimumd_search`
--

-- --------------------------------------------------------

--
-- Table structure for table `PLD`
--

CREATE TABLE `PLD` (
`ID` int(11) NOT NULL auto_increment,
`TITLE` varchar(255) NOT NULL default '',
`CACHE_TITLE` text,
`TITLE_URL` varchar(255) default NULL,
`CACHE_URL` text,
`DESCRIPTION` longtext,
`PARENT_ID` int(11) NOT NULL default '0',
`STATUS` int(11) NOT NULL default '1',
`DATE_ADDED` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
...

INSERT INTO `PLD` VALUES (1, 'Arts', 'Arts', 'Arts', 'index.php?c=1', '', 0, 2, '2007-, '');
INSERT INTO `PLD` VALUES (2, 'Business', 'Business', 'Business', 'index.php?c=2'01', 264,);
INSERT INTO `PLD` VALUES (3, 'Computers and Internet', 'Computers aernet', 'Compd_I ...);
INSERT INTO `PLD` VALUES (4, 'Games', 'Games', 'Games', 'index.php1', 88, 0, 0, '', '');
INSERT INTO `PLD` VALUES (5, 'Health', 'Health', 'Health', 'index.php?c=5'', 170, 0,, '');
INSERT INTO `PLD` VALUES (6, 'Home', 'Home', 'Home', 'index.php?c=6', '', 0, 0, '', '');
INSERT INTO `PLD` VALUES (7, 'Kids and Teens', 'Kids and Teens', 'Kids_and_Tee2-22 12:46 ...);
INSERT INTO `PLD` VALUES (8, 'News', 'News', 'News', 'index.php?c=8, 53, 0, 0, '', '');
INSERT INTO `PLD` VALUES (9, 'Recreation', 'Recreation', 'Recreati007-02-25 151', 118, ...);

...

So what to do with sql dump file? Simple... Use it as an archive if some disaster happends and you loose your database or windows server crashes - you can allways import sql dump file back in mySQL database.

How to import sql dump file to mySQL database?




The scenario: server crashes and you got mysql dump file stored on your hard drive. First you install mySQL database - then create database, database user and database password and then use next command line:


mysql -u username -p password database_name < filename.sql


If we use the same example as we used for export command line for export is:


mysql -u baseu01 -p h4z56s3 database01 < export.sql

Advanced options for exporting or importing a database



How to Export A MySQL Database Structures Only



If you no longer need the data inside the database’s tables (unlikely), simply add –no-data switch to export only the tables’ structures.


For example, the syntax is:


mysqldump -u username -ppassword –no-data database_name > dump.sql



How to Backup Only Data of a MySQL Database




If you only want the data to be backed up, use –no-create-info option. With this setting, the dump will not re-create the database, tables, fields, and other structures when importing. Use this only if you pretty sure that you have a duplicate databases with same structure, where you only need to refresh the data.

Syntax:

mysqldump -u username -ppassword –no-create-info database_name > dump.sql



How to Dump Several MySQL Databases into Text File



–databases option allows you to specify more than 1 database.


Example syntax:


mysqldump -u username -ppassword –databases db_name1 [db_name2 ...] > dump.sql



How to Dump All Databases in MySQL Server



To dump all databases, use the –all-databases option, and no databases’ name need to be specified anymore.



mysqldump -u username -ppassword –all-databases > dump.sql



How to Online Backup InnoDB Tables



Backup the database inevitable cause MySQL server unavailable to applications because when exporting, all tables acquired a global read lock using FLUSH TABLES WITH READ LOCK at the beginning of the dump until finish. So although READ statements can proceed, all INSERT, UPDATE and DELETE statements will have to queue due to locked tables, as if MySQL is down or stalled. If you’re using InnoDB, –single-transaction is the way to minimize this locking time duration to almost non-existent as if performing an online backup. It works by reading the binary log coordinates as soon as the lock has been acquired, and lock is then immediately released.



Syntax:

mysqldump -u username -ppassword –all-databases –single-transaction > dump.sql



mysql database import-export usage and linking to us




This tutorial can be used with windows server 2003, windows server 2000, windows XP and windows XP proffessional or even unix wervers - as long as mySQL database is installed on your computer.


If you find this tutorial to be usefull please add link to it import-sql-dump-file-to-mysql-database so other people will also find this tutorial page.
Continue Reading »

Friday, April 6, 2012

[MySQL]Reset the root password

For users of the powerful database MySQL, access, as well as right to modify the admin (root) password is important, because both are required when installing and in situations when the master password is lost. The user must be connected to the root password to modify it but for reinitialising the password, this process can be skipped. Resetting the password is possible after connection to theMySQL database with the help of specific commands. In case the password is lost, then it is also possible to get access to the MySQL server through a bypass of the authentication process. To reset the password under the latter condition, the server must be restarted to continue the process.

It's important that you are able to access and modify the admin (root) password of MYSQL, either when installing MySQL for the first time or in situations where the master password is lost.

The root password is lost

To modify the existing root password, you must firstly be connected to it. If you know the root password and just want to reinitialize it, you can skip this part. If you don't have the root password then follow the steps below:
  • Stop the MySQL server
    • #/etc/init.d/mysql stop





  • Restart MySQL, disabling network communication and skipping the authentication procedure


    • #mysqld --skip-grant-tables --skip-networking &









Resetting the password




  • Get connected to the MySQL system database:


    • # mysql mysql -u root





  • Type in the following command and reset your password:


    • UPDATE user SET password=PASSWORD('newpassword') WHERE user="root";





  • If you didn't go through the first step, to validate the changes simply type:


    • FLUSH PRIVILEGES;





  • If you started MySQL manually (bypassing the authentication process), the server must be restarted:


    • #/etc/init.d/mysql restart








Warning: Changing your password can cause connection problems between phpmyadmin and mysql.



PhpMyAdmin - Access denied for user root@localhost

Continue Reading »

Cum resetezi parola de root din Phpmyadmin

Rulezi /etc/init.d/mysql stop

Restartezi Mysql  cu comanda mysqld --skip-grant-tables --skip-networking &

Rulezi mysql mysql -u root

Apoi UPDATE user SET password=PASSWORD('newpassword') WHERE user="root";

Optional FLUSH PRIVILEGES;

Apoi startezi /etc/init.d/mysql restart

Continue Reading »

Thursday, March 29, 2012

Cele mai utile comenzi Linux (index alfabetic de comenzi Linux)

An A-Z Index of the Bash command line for Linux
a
alias Create an alias
apropos Search Help manual pages (man -k)
apt-get Search for and install software packages (Debian)
aspell Spell Checker
awk Find and Replace text, database sort/validate/index
b
bash GNU Bourne-Again SHell
bc Arbitrary precision calculator language
bg Send to background
break Exit from a loop
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)
c
cal Display a calendar
case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
chkconfig System services (runlevel)
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command - ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts
d
date Display or change the date & time
dc Desk Calculator
dd Convert and copy a file, write disk headers, boot records
ddrescue Data recovery tool
declare Declare variables and give them attributes
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
dmesg Print kernel & driver messages
du Estimate file space usage
e
echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject removable media
enable Enable and disable builtin shell commands
env Environment variables
ethtool Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expect Automate arbitrary applications accessed over a terminal
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions
f
false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fg Send job to foreground
fgrep Search file(s) for lines that match a fixed string
file Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
fsck File system consistency check and repair
ftp File Transfer Protocol
function Define Function Macros
fuser Identify/kill the process that is accessing a file
g
gawk Find and Replace text within file(s)
getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)
h
hash Remember the full pathname of a name argument
head Output the first part of file(s)
history Command History
hostname Print or set system name
i
id Print user and group id's
if Conditionally perform a command
ifconfig Configure a network interface
ifdown Stop a network interface
ifup Start a network interface up
import Capture an X server screen and save the image to file
install Copy files and set attributes
j
join Join lines on a common field
k
kill Stop a process from running
killall Kill processes by name
l
less Display output one screen at a time
let Perform arithmetic on shell variables
ln Make links between files
local Create variables
locate Find files
logname Print current login name
logout Exit a login shell
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files
m
make Recompile a group of programs
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mkisofs Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories
mmv Mass Move and rename (files)
n
netstat Networking information
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
nslookup Query Internet name servers interactively
o
open Open a file in its default application
op Operator access
p
passwd Modify a user password
paste Merge lines of files
pathchk Check file name portability
ping Test a network connection
pkill Stop processes from running
popd Restore the previous value of the current directory
pr Prepare files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory
q
quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas
r
ram ram disk device
rcp Copy files between two machines
read read a line from standard input
readonly Mark variables/functions as readonly
reboot Reboot the system
renice Alter priority of running processes
remsync Synchronize remote files via email
return Exit a shell function
rev Reverse lines of a file
rm Remove files
rmdir Remove folder(s)
rsync Remote file copy (Synchronize file trees)
s
screen Multiplex terminal, run remote shells via ssh
scp Secure copy (remote file copy)
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
sftp Secure File Transfer Program
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
slocate Find files
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
ssh Secure Shell client (remote login program)
strace Trace system calls and signals
su Substitute user identity
sudo Execute a command as another user
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory
t
tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program running time
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command
u
ulimit Limit user resources
umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode
v
v Verbosely list directory contents (`ls -l -b')
vdir Verbosely list directory contents (`ls -l -b')
vi Text Editor
vmstat Report virtual memory statistics
w
watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Report all known instances of a command
which Locate a program file in the user's path.
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')
Wget Retrieve web pages or files via HTTP, HTTPS or FTP
write Send a message to another user
x
xargs Execute utility, passing constructed argument list(s)
yes Print a string until interrupted
. Run a command script in the current shell
### Comment / Remark
SS64 Discussion forum
Bash commands for OS X
Links to other Sites, full list of man pages, books etc...

Continue Reading »

Wednesday, March 21, 2012

Bitdefender avertizează asupra unui nou troian periculos care te poate lăsa fară banii din cont

Un nou troian ameninţă conturile bancare ale utilizatorilor din întreaga lume. Mousetrap Troian acţionează ca un veritabil şef de organizaţie criminală care, pentru a evita filtrele poliţiei, săvârşeşte jafurile printr-un lanţ de intermediari.

Concret, troianul care provoacă paguba este adus pe sistem „din mână în mână”, pornind de la un website infectat şi trecînd printr-o sumedenie de alţi troieni.

Primul pas al infecţiei îl reprezintă vizitarea unui site legitim, dar pe care l-a atacat în prealabil un hacker şi pe care acesta a încărcat o aplicaţie periculoasă scrisă în Java.

Această aplicaţie Java îi apare utilizatorului sub forma unui mesaj care îl informează că nu are plug-in-ul de Flash instalat şi se oferă să-l descarce şi să-l instaleze pentru utilizator. Însă o dată cu rularea plug-in-ului impostor, calculatorul este de fapt infectat cu un prim troian, care va pregăti terenul pentru un aşa-zis „bancher”  – troianul responsabil cu furtul banilor.

După instalare, troianul verifică o listă de adrese de la care va descărca şi va executa alţi troiani de tip „bancher”. Aceştia sunt găzduiţi pe mai multe servere compromise, în aşa fel încât, dacă unul dintre servere este închis sau curăţat de viruşi, troianul să poată aduce „bancherii” de pe un altul.

Troianul de e-banking va urmări ce tranzacţii electronice face utilizatorul calculatorului şi va fura datele acestuia de conectare, date care vor ajunge în mâna atacatorului. Din cauza faptului că aceşti „viruşi bancheri” fură informaţii direct din formularul browser-ului, utilizatorul nu-şi poate da seama că datele lui ajung şi altundeva decât la site-ul băncii.

Metoda de distribuţie a troianului este foarte complexă. Acest circuit are ca scop protejarea troianului final faţă de producătorii de soluţii de securitate şi faţă de sistemele lor automate de semnare a viruşilor. Acestea vor identifica şi semna, în multe cazuri, unul dintre troienii intermediari, care sunt uşor de înlocuit, şi nu troianul „bancher”, care e cea mai periculoasă componentă a atacului.

Pentru a evita infectarea, utilizatorii sunt sfătuiţi să nu instaleze nici o aplicaţie care este promovată prin mesaje de tip pop-up. Dacă sistemul informează utilizatorul că îi lipsesc plug-in-uri sau codec-uri, acesta trebuie să descarce manual respectivele aplicaţii de pe paginile producătorilor.

Dacă suspectaţi o infecţie pe calculator, rulaţi o scanare gratuită cu QuickScan, utilitarul Bitdefender care identifică problemele cauzate de viruşi în mai puţin de 60 de secunde.

Continue Reading »

Tuesday, March 20, 2012

Cum spargi sau resetezi parola de root in Centos Linux

Help! I forgot my root password. How do I log in now?

You can log in using single-user mode and create a new root password.

To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:

  1. At the boot loader menu, use the arrow keys to highlight the installation you want to edit and type [A] to enter into append mode.

  2. You are presented with a prompt that looks similar to the following:

    grub append> ro root=LABEL=/




  3. Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. The result should look like the following:



    ro root=LABEL=/ single




  4. Press [Enter] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:



    sh-2.05b#




  5. You can now change the root password by typing



    passwd root


    You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.



Continue Reading »