首先,若你有 edu2016 或 ntpcU 的新北教育作業系統,就可以直接利用 apt-get 來安裝 nmap 這支工具來幫忙快速檢查校內所有的 ip。步驟如下:
- sudo apt-get update && sudo apt-get install nmap
- sudo nmap -sU 53 --script=dns-recursion <target>
$config['enable_hooks'] = TRUE;
$hook['display_override'][] = array(3. ./application/hook/output.php
'class' => '',
'function' => 'images_auto_set_alt',
'filename' => 'output.php',
'filepath' => 'hooks',
'params' => array( 'output_display' => TRUE )
);
/**
* 將輸出的 圖片(<img>) 進行處理;自動配置 alt 屬性。
*
* @param array $setting=array() 設定
* $setting['output_display'] => 是否直接輸出給瀏覽器。FALSE代表不直接輸出,僅回存至buffer。
* @return NULL 不會回傳東西。
*/
function images_auto_set_alt( $setting=array() ) {
$CI =& get_instance();
$CI->load->library( 'simple_html_dom' ); // require_once APPPATH . 'libraries/simple_html_dom.php';
$buffer = $CI->output->get_output();
$DOM = str_get_html( $buffer );
foreach ( $DOM->find( 'img' ) as $key => $img ) {
if ( empty( $img->alt ) && ! strpos( $img->alt, $CI->config->item( 'site_name' ) ) ) {
$img->alt = $CI->config->item( 'site_name' );
}
else {
$img->alt .= ' - ' . $CI->config->item( 'site_name' );
}
}
$CI->output->set_output( $DOM->save() );
if ( $setting['output_display'] ) {
$CI->output->_display();
}
}
[mysqld]
sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
SET sql-mod='';
CREATE TABLE IF NOT EXISTS `ci_sessions` ( `id` varchar(40) NOT NULL, `ip_address` varchar(45) NOT NULL, `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, PRIMARY KEY (id), KEY `ci_sessions_timestamp` (`timestamp`));
$config['sess_driver'] = 'database';$config['sess_save_path'] = 'ci_sessions';
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
$db['default']['swap_pre'] = "";
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
Database 2:$db['otherdb']['hostname'] = "localhost";
$db['otherdb']['username'] = "root";
$db['otherdb']['password'] = "";
$db['otherdb']['database'] = "other_database_name";
$db['otherdb']['dbdriver'] = "mysql";
$db['otherdb']['dbprefix'] = "";
$db['otherdb']['pconnect'] = TRUE;
$db['otherdb']['db_debug'] = FALSE;
$db['otherdb']['cache_on'] = FALSE;
$db['otherdb']['cachedir'] = "";
$db['otherdb']['char_set'] = "utf8";
$db['otherdb']['dbcollat'] = "utf8_general_ci";
$db['otherdb']['swap_pre'] = "";
$db['otherdb']['autoinit'] = TRUE;
$db['otherdb']['stricton'] = FALSE;
function my_model_method()
{
$otherdb = $this->load->database('otherdb', TRUE); // the TRUE paramater tells CI that you'd like to return the database object.
$query = $otherdb->select('first_name, last_name')->get('person');
var_dump($query);
}
Copyright © 2010 Learning in free | Blogger Templates by Splashy Templates
Css Designed by Hot Website Templates