隔天,該同事另一門課程原本也是好好的,結果他終於發現問題了,然後跑來告訴我,原來是因為[新增週數或課程數]他打成年月日,所以系統就建了兩千多萬筆的資料,總共兩門課共四千多萬筆的垃圾資料。
後來直接進資料庫下指令砍掉就可以了,指令如下:
DELETE FROM `mdl_course_sections` WHERE `id` > id編號
最後執行 moodle 網站管理 > 開發 > 清空所有快取 ,這樣課程應該就可以正確顯示了。
DELETE FROM `mdl_course_sections` WHERE `id` > id編號
crontab -eMAILTO='"' 保存,然后 server crond restart 重启 crond#enable sharing 24 grouping 22, 24 algorithm address-based L2 lacp#configure terminal#trunk 5-6 trk1 lacp#vlan XXX#untag trk1#show lacp# show sharing# show lacp#show trunks# show vlans ports trk1#gsad --port 9392 -f -v --http-only #yum install wget#wget -q -O - http://www.atomicorp.com/installers/atomic |sh#yum install openvas
#openvas-setup
Step 1: Update NVT's
Step 2: Configure GSAD
The Greenbone Security Assistant is a Web Based front end
for managing scans. By default it is configured to only allow
connections from localhost.
Allow connections from any IP? [Default: yes]
Stopping greenbone-security-assistant: [ OK ]
Starting greenbone-security-assistant: [ OK ]
Step 3: Choose the GSAD admin users password.
The admin user is used to configure accounts,
Update NVT's manually, and manage roles.
Enter administrator username [Default: admin] :
Enter Administrator Password:
Verify Administrator Password:
ad main:MESSAGE:15385:2013-08-06 14h30.58 CST: No rules file provided, the new user will have no restrictions.
ad main:MESSAGE:15385:2013-08-06 14h30.58 CST: User admin has been successfully created.
Step 4: Create a user
Using /var/tmp as a temporary file holder.
Add a new openvassd user
---------------------------------
Login : user
Authentication (pass/cert) [pass] :
Login password :
Login password (again) :
User rules
---------------
openvassd has a rules system which allows you to restrict the hosts that chyau has the right to test.
For instance, you may want him to be able to scan his own host only.
Please see the openvas-adduser(8) man page for the rules syntax.
Enter the rules for this user, and hit ctrl-D once you are done:
(the user can have an empty rules set)
Login : user
Password : ***********
Rules :
Is that ok? (y/n) [y]
Starting openvas-administrator...
Starting openvas-administrator:
[ OK ]
Setup complete, you can now access GSAD at:
https://<IP>:9392
#/etc/init.d/openvas-administrator start
#openvas-nvt-sync
#openvassd restart
#openvasmd restart#wget https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-#setup -O openvas-check-setup.sh --no-check-certificate
#chmod +x openvas-check-setup.sh
#./openvas-check-setup.sh --server#vi /etc/crontab
00 5 * * * root openvas-nvt-sync
#!/bin/bash
user="backup"
password="YourPassword"
tftp_ip="YourBackupServerIP"
fg_devices="YourFortigateIP"
date="$(date +"%Y%m%d")"
for fg_device in $fg_devices ; do
expect -c "
set timeout 30
spawn ssh $user@$fg_device
expect \"(yes/no)\" { send \"yes\r\"; exp_continue }
expect \"*password:*\"
set send_slow {1 0.05}
send -s \"$password\r\"
send_user \"$password\r\"
expect \"FG*\"
send -s \"execute backup full-config tftp $fg_device-$date.cfg $tftp_ip\n\"
expect \"FG*\"
send -s \"exit\n\"
interact"
done
#!/usr/bin/expect -f
if { $argc != 4 } {
send_user "usage: extreme.exp device_ip username password server_ip \n"
exit
}
set timeout 1
set TERM ANSI
set date [exec date +%Y%m%d]
set DEVICE [lindex $argv 0]
set USERNAME [lindex $argv 1]
set PASSWD [lindex $argv 2]
set SERVER [lindex $argv 3]
spawn telnet
expect "telnet> "
send "open $DEVICE\r"
sleep 1
expect "login:"
send "$USERNAME\r"
sleep 1
expect "password:"
send "$PASSWD\r"
sleep 1
expect "#"
send "upload configuration $SERVER $DEVICE-$date vr VR-Default\r"
sleep 3
expect "#"
send "exit\r"
interact
#!/usr/bin/expect -f
if { $argc != 4 } {
send_user "usage: hp.exp device_ip username password server_ip \n"
exit
}
set timeout 1
set TERM ANSI
set date [exec date +%Y%m%d]
set DEVICE [lindex $argv 0]
set USERNAME [lindex $argv 1]
set PASSWD [lindex $argv 2]
set SERVER [lindex $argv 3]
spawn telnet
expect "telnet> "
send "open $DEVICE\r"
sleep 1
expect continue { send "\r" ; exp_continue }
sleep 1
expect "Username:"
send "$USERNAME\r"
sleep 1
expect "Password:"
send "$PASSWD\r"
sleep 1
send "\r\r"
expect "#"
send "copy running-config tftp $SERVER $DEVICE-$date\r"
sleep 1
expect "#"
send "exit\r"
sleep 1
expect ">"
send "exit\r"
sleep 1
expect "Do you want to log out"
send "y\r"
interact