Jump to content


Active Members
  • Posts

  • Joined

  • Last visited


14 Good

About gorski

  • Rank
    Registered user
  • Birthday 07/26/1994


  • Biography
    From the smallest necessity to the highest religious abstraction, from the wheel to the skyscraper, everything we are and everything we have comes from one attribute of man -- the function of his reasoning mind.
  • Location
  • Interests
    Multe, vrute si nevrute.
  • Occupation

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The Blue Stones - Rolling with the Punches
  2. #!/usr/bin/env python """ Scanner pentru orice cu o adresa IP si care nu are parola && user (sper sa-i fie de folos cuiva) """ import sys import socket import struct raw_ip = raw_input("Enter the starting IP address: ") port = raw_input("Enter the port you want to scan: ") ip_number = raw_input("Enter the numer of IPs you want to scan: ") print "Working..." ip2int = lambda ipstr: struct.unpack('!I', socket.inet_aton(ipstr))[0] int2ip = lambda n: socket.inet_ntoa(struct.pack('!I', n)) ip_number = int(ip_number) inted_ip = ip2int(raw_ip) i = 1 while i <= ip_number: if i == ip_number: print 'Job Done.' try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = sock.connect_ex((raw_ip, int(port))) if result == 0: f = open('list.txt', 'w') f.write(int2ip(inted_ip) + ':' + port + '\n') else: print "Nothing found." inted_ip+=i sock.close() except KeyboardInterrupt: print "Exiting..." sys.exit() except socket.error: print "Could not connect to the server. Exiting..." sys.exit() i += 1;
  3. "Tehnici esentiale de supravietuire" (tehnici de dezvoltare software) TutsPlus - Agile Design Patterns Un framework destul de bun, merita incercat. -> Laravel Tutsplus - Laravel Essentials Titlul vorbeste de la sine. TutsPlus - PHP Fundamentals TutsPlus - SQL Essentials Nu e cine stie ce, dar pentru un incepator e numai bun. P.S. Sper ca nu se supara nimeni ca am postat aici, m-am gandit ca ar fii inutil sa fac alt thread pe acelasi subiect.
  4. 1. Ce este PDO? PDO, un acronim pentru PHP Data Objects, este o extensie PHP care poate fi folosita ca un nivel de abstractizare pentru conexiunea dintre programele PHP si diverse baze de date. PDO defineste o interfata simpla si consistenta intre diverse baze de date. Pentru fiecare din driverele specifice implementate in PDO se pot folosi functiile specifice. PDO ofera un nivel de abstractizare pentru accesarea datelor, ceea ce inseamna ca indiferent la ce baza de date suntem conectati, se folosesc aceleasi functii pentru a trimite interogari si pentru a primi date. PDO nu ofera un nivel complet de abstractizare, nici transformare mapare automata in obiecte, nu rescrie SQL si nici nu emuleaza caracteristici absente in unele baze de date. 2. Conexiunea la baza de date $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); Unde: mysql - driver-ul folosit pentru a ne conecta la baza de date $db_host = 'localhost'; $db_name = 'numele bazei de date'; $db_user = 'userul cu care va conectati la server-ul MySQL'; $db_pass = 'parola cu care va conectati la server-ul MySQL'; Modul default pentru erori este PDO::ERRMODE_SILENT. Ca sa-l schimbam si sa si afisam erorile(in caz ca sunt), punem totul intr-o structura try/catch. try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOExpcetion $e) { echo: 'Eroare: ' . $e->getMessage(); } Pentru mai multe detalii, intrati aici: PHP: Errors and error handling - Manual 3. Extragerea datelor Sunt 2 moduri prin care putem extrage date din baza de date si anume: a) query execute a) QUERY(nerecomandata) $username = $_POST['username']; try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $data = $conexiune->query('SELECT * FROM tabela WHERE username = ' . $conexiune->quote($username)); foreach($data as $row) { print_r($row); } } catch(PDOExpcetion $e) { echo: 'Eroare: ' . $e->getMessage(); } EXECUTE(recomandata) $id = 13; try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $conexiune->prepare('SELECT * FROM tabela WHERE id = :id'); $statement->bindParam(':id', $id, PDO::PARAM_INT); $statement->execute(); while($row = $statement->fetch()) { print_r($row); } } catch(PDOExpcetion $e) { echo: 'Eroare: ' . $e->getMessage(); } 4. Cateva exemple a) Executii multiple try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $conexiune->prepare('INSERT INTO tabela VALUES(:username)'); $statement->bindParam(':username', $username,); $username = "gogu"; $statement->execute(); $username = "goaga"; $statement->execute(); } catch(PDOExpcetion $e) { echo: 'Eroare: ' . $e->getMessage(); } INSERT try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $conexiune->prepare('INSERT INTO tabela VALUES(:username)'); $statement->execute(array( ':username' => 'gogu' )); } catch(PDOExpcetion $e) { echo: 'Eroare: ' . $e->getMessage(); } c) UPDATE $id = 13; $username = "gogu"; try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $conexiune->prepare('UPDATE tabela SET username = :username WHERE id = :id'); $stmt->execute(array( ':id' => $id, ':username' => $username )); } catch(PDOException $e) { echo: 'Eroare: ' . $e->getMessage(); } d) DELETE $id = 13; try { $conexiune = new PDO("mysql:host=$db_host;$dbname=$db_name", $db_user, $db_pass); $conexiune->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $conexiune->prepare('DELETE FROM tabela WHERE id = :id'); $statement->bindParam(':id', $id); $statement->execute(); } catch(PDOException $e) { echo: 'Eroare: ' . $e->getMessage(); } Link-uri utile: PHP: PDO - Manual php-pdo-wrapper-class - Minimal extension for PHP's PDO class designed for ease-of-use and reducing development time/effort when accessing a database. - Google Project Hosting by HackYard
  5. OFF: Nu stiu cum sunteti voi dar eu cand am vazut referral, am vazut pierdere de timp. In timpul ala pe care-l pierzi facand posturi si strangand like-uri pentru cativa $ pe care nu-i sigur ca-i primesti, mai bine te-ai apuca sa inveti ceva(ex: limbaj de programare, mecanica, web design etc.) ca apoi sa obtii ceva "palpabil" + experienta de viata + multumire de sine. ON: Cand primesti banii pe PayPal, posteaza un screenshot aici.
  6. Lyrics: Far over the Misty Mountains cold, To dungeons deep and caverns old, We must away, ere break of day, To find our long-forgotten gold. The pines were roaring on the heights, The winds were moaning in the night, The fire was red, it flaming spread, The trees like torches blazed with light.
  7. Parerea mea: Banii pe care i-ai investit in licenta de vBulletin, puteai sa-i investesti in host si foloseai ceva open-source.
  8. gorski

    Fun stuff

  9. Raman fidel mediafire.
  10. Off: Tu ti-ai facut cont numai ca sa-ti faci reclama? On: Un link, ceva?
  11. This video explains the concept of changing the default IPTables policy and the importance of doing it. Then how to configure your Linux server to explicitly allow certain ports or services both the incoming and outgoing connections.
  • Create New...