仝 tóng

Linux上一些有用的Notes

Remove software
list software packages

$ rpm -qa|grep example

force remove

$ rpm -e --nodeps example

Hide and Prevent a folder and Directory Listing of Your Website
hide your folder and do not want directory files to show in browser

  • add a empty and no content "index.html" file in your folder or directory

  • add "Options -Indexes" to your .htaccess in your website directory .

  • change "Options Indexes FollowSymLinks" to "Options FollowSymLinks" in your httpd.conf file and restart apache.

Magento Log Cleaning

"System"->"Configuration"->"ADVANCED"->"System"->"Log Cleaning"

Repair mysql table crashed error

"mysqldump -uroot -p your_mysql_name"

your will get error: table_name' is marked as crashed and should be repaired when using LOCK TABLES
and then you can fix it

mysql> use your_mysql_name;
mysql> repair table your_error_table_in_this_mysql;

use tar&openssl to encrypt your files

Encrypt: tar -zcvf - iCloud|openssl des3 -salt -k your-password | dd of=iCloud.des3 (The first "iCloud" is your file name, please change your-password to your password)
Decrypt: dd if=iCloud.des3 |openssl des3 -d -k your-password|tar zxf - (do not forgot the "-").

use ley to login your remote linux server with key

ssh -i your-key-file-path [email protected]

copy remote file to your machine

scp -i your-key-file-path [email protected]:/file-path /server-path
发表新评论