Xem Các Cổng Đã Mở Trên Linux
sudo ufw status | grep 'Open'
Mở Một Cổng Mới
sudo ufw allow 81/tcp
Tải Lại Cấu Hình Firewall
sudo ufw reload
Thay Đổi Ngẫu Nhiên Biểu Tượng Trang Web
Ngăn Chặn Google Dịch Tự Động
Thêm dòng sau vào file hosts:
203.208.46.200 translate.googleapis.com
Công Cụ SRE của NSA
Ghidra Framework
Kiểm Tra WebSocket trên Trình Duyệt
ws = new WebSocket("ws://test.server.local:8080");
ws.onopen = function() { alert("Kết nối thành công"); ws.send('Hello'); };
ws.onmessage = function(e) { alert("Nhận được: " + e.data); };
Xử Lý Excel với PHPExcel
include __DIR__ . "/lib/PHPExcel.php";
$excelDoc = new PHPExcel();
$excelDoc->getProperties()->setCreator("admin")->setTitle("Test Document");
$excelDoc->getActiveSheet()->getColumnDimension('A')->setWidth(35);
$excelDoc->getActiveSheet()->getStyle('A1:B1')->getFont()->setBold(true);
$data = pdo_fetchall("SELECT item, price FROM products");
foreach ($data as $index => $row) {
$excelDoc->getActiveSheet()->setCellValue('A' . ($index + 2), $row['item']);
$excelDoc->getActiveSheet()->setCellValue('B' . ($index + 2), $row['price']);
}
$excelDoc->getActiveSheet()->setTitle("Product List");
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="product_data.xlsx"');
$objWriter = \PHPExcel_IOFactory::createWriter($excelDoc, 'Excel2007');
$objWriter->save('php://output');
Cấu Hình Nginx Với PhpStudy
server {
listen 80;
server_name example.com;
root /var/www/html/example;
location / {
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?/$1 last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Lựa Chọn Tất Cả Biểu Tượng Từ Thư Viện Icon
let iconSet = document.querySelectorAll('.icon-select');
iconSet.forEach(icon => icon.click());