Enter this at the boot prompt, instead of pressing
linux acpi=off noapic nolapic
Misc. Sys Admin related notes, Linux tips, tricks, notes to self, etc.
Here are some really good SElinux resources:
http://www.linuxsecurity.com/content/view/120567/49/ http://www.linuxsecurity.com/content/view/120622/49/http://www.linuxsecurity.com/content/view/120700/49/
Touch up a folder for apache to access (change file context labels recursively):
chcon -R -t httpd_sys_content_t
Touch up a folder for samba to access (change file context labels recursively):
chcon -R -t samba_share_t /backups
To reset the labels on all mounted filesystems:
restorecon -Rv /
If you need the filesystems to be relabeled on bootup, do this and then reboot:
touch /.autorelabel
To boot once with SELinux enforcement disabled, add the enforcing=0 flag to the kernel boot line.
To get the kernel's enforcement status:
getenforce
To change the kernel's enforcement status to "permissive" (aka log-only):
setenforce 0
To change the kernel's enforcement status to "Enforcing" (aka block access):
setenforce 1
(edit /etc/selinux/config to make the changes persistent across reboots)
telnet myserver.com 25...
Connected to myserver.com
Escape character is '^]'.
220 myserver.com ESMTP SendmailHELO local.domain.com250 myserver.com Hello local.domain.com [1.2.3.4]MAIL FROM: myaddress@domain.com250 2.1.0 myaddress@domain.com... Sender okRCPT TO: otheraddress@myserver.com250 2.1.0 otheraddress@myserver.com... Recipient okDATASubject:my subject
followed by the enter key twice, to conform to RFC 882.Hello, world
Then, close your message with . QUIT
ALTER TABLE problem_table TYPE=INNODBGet mysql version:| Comment from rsrsm Date: 12/11/2003 07:29PM PST | Comment | |
If the log file is deleted for the database and SQL server is not able to locate it..you can rebuild the log. try the following steps (But if the log file is not deleted then you can ignore this comment): REBUILD LOG and recover a suspect database: 1. Back up the .mdf/.ndf and .ldf files. 2. Change the database context to Master and allow updates to system tables: Use Master Go sp_configure 'allow updates', 1 reconfigure with override Go 3. Set the database in Emergency (bypass recovery) mode: select * from sysdatabases where name = ' -- note the value of the status column for later use begin tran update sysdatabases set status = 32768 where name = ' -- Verify one row is updated before committing commit tran If you run DBCC REBUILD_LOG without setting the database in Emergency mode, the command does not work. You do not receive an error, but the log is not rebuilt either. 4. Stop and restart SQL server. If you run DBCC REBUILD_LOG without recycling the server, the following message displays: Server: Msg 5023, Level 16, State 2, Line 1 Database must be put in bypass recovery mode to rebuild the log. DBCC execution completed. If DBCC printed error messages, contact your system administrator. 5. The syntax for DBCC REBUILD_LOG is as follows: DBCC REBUILD_LOG(' where the physical path to the new log file, not a logical file name. If you do not specify the full path, the new log is created in the Windows NT system root directory (by default, this is the Winnt\System32 directory). If the file is placed in the Winnt\System32 folder, you can move it to a different folder by running the following commands from the SQL Query Analyzer: sp_detach_db ' Go Move the log file over from the Winnt\System32 folder to the preferred folder. sp_attach_db ' Go If a log file with the same name as specified in DBCC REBUILD_LOG already exists in that directory, then the following message occurs: Server: Msg 5025, Level 16, State 1, Line 1 The file 'C:\MSSQL7\Data\ renamed or deleted so that a new log file can be created. DBCC execution completed. If DBCC printed error messages, contact your system administrator. You will need to specify a different filename or rename or delete the existing one. Rebuild the log with this code: DBCC TRACEON (3604) DBCC REBUILD_LOG(' Go If the command is successful, the following message appears: Warning: The log for database ' Transactional consistency has been lost. DBCC CHECKDB should be run to validate physical consistency. Database options will have to be reset, and extra log files may need to be deleted. After the log is successfully rebuilt, the database is placed in DBO Use Only mode. That is, the status of the database is 2048 irrespective of what the status was previously. You must reset the status using sp_dboption or through the SEM. 6. Set the database in single-user mode and run DBCC CHECKDB to validate physical consistency: sp_dboption ' DBCC CHECKDB(' Go begin tran update sysdatabases set status = -- verify one row is updated before committing commit tran Go 7. Turn off the updates to system tables by using: sp_configure 'allow updates', 0 reconfigure with override Go WARNING: After verifying the consistency of the database by running DBCC CHECKDB, and fixing any errors, please make sure to check the database for logical consistency as well. Because a new log has been built, the transactions in the old log are lost, hence you must also verify the logical consistency of the data as well. | ||
Ctrl + A : Go to the beginning of the line you are currently typing on
Ctrl + E : Go to the end of the line you are currently typing on
Ctrl + L : Clears the Screen, similar to the clear command
Ctrl + U : Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H : Same as backspace
Ctrl + R : Let’s you search through previously used commands
Ctrl + C : Kill whatever you are running
Ctrl + D : Exit the current shell
Ctrl + Z : Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W : Delete the word before the cursor
Ctrl + K : Clear the line after the cursor
Ctrl + T : Swap the last two characters before the cursor
Esc + T : Swap the last two words before the cursor
Alt + F : Move cursor forward one word on the current line
Alt + B : Move cursor backward one word on the current line
Tab : Auto-complete files and folder names
Status Bit Description
BOT The tape is positioned at the beginning of the first
file.
EOT A tape operation has reached the physical End Of
Tape.
EOF The tape is positioned just after a filemark.
WR_PROT The tape (or drive) is write-protected. For some
drives this can also mean that the drive does not
support writing on the current medium type.
ONLINE The drive has a tape in place and ready for
operation.
DR_OPEN Door is open. Depending on the type of drive, this
usually means that the drive does not have a tape in
place.
IM_REP_EN Immediate report mode. This bit is set if there are
no guarantees that the data has been physically
written to the tape when the write call returns. It
is set to zero only when the driver does not buffer
data and the drive is set not to buffer data.
SM The tape is currently positioned at a setmark. DDS
specific.
EOD The tape is positioned at the end of recorded data.
DDS specific.
D_6250
D_1600
D_800 This "generic" status information reports the current
density setting for 9-track 1/2 inch tape drives only.
(from the SGI XFS mailing list)
If you have compiled in kdb and you get an oops (at least in 2.4 series kernels):
Next time it hangs, enter these kdb commands and
capture the output on the serial console.
set LINES 10000
set BTAPROMPT 0
-md1c320 system_utsname
-id %eip-0x40
-cpu
-ps
-dmesg 200
-bt
-bta
ServerTokens ProductOnly
ServerSignature OffNote that this won't actually fix any vulnerabilities, but it will make an attacker have to either guess or scan to determine what vulnerabilities you may have.expose_php = Off