【转】FREEBSD升级及优化全攻略

Mcu_Bsdiff_Upgrade MCU BSDiff 升级系统通过使用二进制差分技术,提供了一种在资源受限的微控制器上进行高效固件更新的机制。系统不传输和存储完整的固件映像,而是只处理固件版本之间的差异,从而显著缩小更新包并降低带宽要求。该架构遵循一个由两部分组成的模型:系统采用新旧固件二进制文件,使用 BSDiff 算法创建补丁,将补丁传输到设备,然后应用补丁以就地创建新的固件版本。该系统由几个关键组件组成,这些组件协同工作以实现差异更新机制: 架构遵循模块化设计,其中:补丁应用程序过程包括几个步骤:该系统设计为在嵌入式设备的内存限制内 阅读详情

重庆.樊礼(梦飞) <cqfanli@163.com>

欢迎转载﹐本文遵循GNU协议规则﹗

前言
升级源码树
安装cvsup
升级系统源码树及ports
重新编译内核
优化编译环境
升级操作系统
升级配置文件
重新编译内核
重新启动服务器
优化FREEBSD
检查升级情况
打开防火墙
优化内核参数
安装防火墙
安装数据库MYSQL
安装mysql40-server和mysql40-client
安装phpmyadmin
安装FTP服务器
安装ftp软件(使用pure-ftpd/)
安装pureftpd_php_manager
安装APACHE服务器
安装apache13-modssl
安装PHP语言
安装php
安装ZendOptimizer
安装APACHE其它整合软件
安装mod_bandwidth
安装mod_fastcgi
安装mod_gzip
安装mod_limitipconn
安装mod_perl
安装mod_throttle
安装mod_watch
安装APACHE第三方软件
安装限制每个虚拟主机的并发数软件
安装防止ddos攻击的软件
其它需要安装的软件﹔
安装MRTG
安装net-snmp
安装mrtg
设置虚空间的mrtg和流量分析
安装BIND 9
安装bind9
安装邮件服务器
安装qmail邮件系统
安装WEBMIN和USERMIN
安装webmin
安装usermin
结束语

前言

FREEBSD系统是一种非常 UNIX、非常 Free、非常 BSD -- UNIX 的操作系统,因为它过UNIX化,太过专业化了,教很多新手无从下手学习。我也是从几年前开始学习FREEBSD,并且在王波写的<FREEBSD使用大全>指导下,正式使用FREEBSD的。在这段使用和管理过程中,自己也积累了不少文章和实战经验。为了让更多的朋友喜欢上FREEBSD,喜欢上UNIX,我特地做了几次升级和优化实例,结合自己管理服务器空间的经验写出此文,希望在此抛砖引玉。
本文的目的是使新手可以根据此文章的步骤和方法,架设一台专业,高效,安全的FREEBSD出来,并且可以立即投入实际运用,故文章中对运用及命令的使用多于理论化的知识点的描述,如果您不明白命令有何作用,建议您查查相关资料。
本文假设已经架设好或者新安装了一台FREEBSD系统主机。
本文中引用了很多FREEBSD官方站数据及网上数据,还有更多的是自己在实际工作中的经验,当然,里面的参数并不一定完全适合您,所以请您在使用时,尽可能根据您的实际需要调整一些参数,使您的SERVER的性能完全的发挥出来。本文只是一个总的线索,如果我要拆开来一个一个详细解释,我想会花更多的篇幅来写的,因为我忙着04年1月的自考,只写了实际中的运作情况,请各位朋友见谅。

升级源码树

安装cvsup
进入:/usr/ports/net/cvsup
make clean
make deinstall
make install
make clean
即可

 

升级系统源码树及ports

更新/usr/share/examples/cvsup目录下stand-cvsup和ports-cvsup文件,并执行cvsup –g –L2 standard-supfile和cvsup –g –L2 ports-cvsup两个文件,升级ports树﹔

 

重新编译内核

优化编译环境
更新/etc/make.conf文件,做适当的编译优化,我的CPU是Intel的:
CPUTYPE=i686
CFLAGS= -O3 -pipe
COPTFLAGS= -O3 -pipe

升级操作系统

进入/usr/src
执行make world
整个过程很久,需要2小时左右。

 

升级配置文件

执行mergemaster升级配置文件,在此过程中,需要按i以便系统执行升级﹔

 

重新编译内核

到/sys/i386/conf里面,cp GENERIC onlinecq,再vi onlinecq优化内核,注意加入下面的内容
#disable ctrl+alt+delete
options SC_DISABLE_REBOOT

 

#quota limit
options QUOTA

#ipfw support
options IPFIREWALL
options DUMMYNET
options HZ=3000
options IPDIVERT
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPSTEALTH
options TCP_DROP_SYNFIN
options IPFIREWALL_DEFAULT_TO_ACCEPT
options ICMP_BANDLIM

options ACCEPT_FILTER_DATA
options ACCEPT_FILTER_HTTP

#ipfilter support
#options IPFILTER
#options IPFILTER_LOG
#options IPFILTER_DEFAULT_BLOCK

再执行:

/usr/sbin/config onlinecq
cd ../../compile/onlinecq
make depend
make
make install

重新启动服务器

到此为止,服务器操作系统及内核升级成功
reboot

 

优化FREEBSD

检查升级情况
使用ssh进入系统,使用uname –a 可以查到是否升级成功﹔

 

打开防火墙

更新rc.conf里面的设置,加上:
#enable_quotas="YES"
#check_quotas="YES"
firewall_enable="YES"
firewall_script="/etc/rc.firewall"
firewall_type="/etc/ipfw.rules" #create it!
firewall_quiet="NO"
firewall_logging_enable="YES"
log_in_vain="NO"
tcp_drop_synfin="NO"
tcp_restrict_rst="YES"
icmp_drop_redirect="YES"

优化内核参数

修改系统内核参数,实现微调:vi /etc/sysctl.conf
kern.ipc.somaxconn=8192
kern.ipc.maxsockbuf=2097152
kern.maxfilesperproc=32768
kern.maxfiles=65536
kern.securelevel=-1
net.inet.
FreeBSD使用大全 第二版 FreeBSD使用大全 第二版 doc格式,方便自己做chm 立即下载

相关推荐

FreeBSD使用大全.第2版

FreeBSD使用大全.第2版

freebsd使用大全

学习unix的好东东

Uniapp H5端SEO优化全攻略:提升搜索引擎排名与流量

在移动互联网时代,H5页面因其跨平台、低成本、易传播的特性,成为许多企业的首选。Uniapp作为一款优秀的前端跨端开发框架,能够快速开发H5、小程序、App等多端应用。然而,由于Uniapp默认采用SPA(单页应用)架构,H5端在SEO(搜索引擎优化)方面存在一定劣势,如爬虫难以抓取动态内容、页面标题和描述不易优化等。 本文将系统性地介绍Uniapp H5端的SEO优化方案,涵盖基础优化、SPA优化策略、内容优化、技术优化、外部优化及监测分析,帮助开发者提升网站在搜索引擎中的排名,获取更多自然流量。

vvilkin的学习备忘 1978

Microsoft Visual C++ 14.0 is required 的亲测最全解决方案(包括安装包丢失或损坏解决方法)

在用python调用别的语言(我用的是cache数据库)的方法时,在执行"python setup3.py install"方法时出现“error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”错误,以下是网上能找到的安装过程中“所有”解决方案: 1、首先需要下载Micr...

CDL2017CDL的博客 2万+

GD32F103VBT6串口OTA升级保姆级教程:当硬件没留Boot0引脚时,我是如何用Keil和Ymodem搞定的

本文详细介绍了GD32F103VBT6在无Boot0引脚情况下的串口OTA升级方案,通过Keil工程改造和Ymodem协议实现可靠固件更新。文章涵盖Bootloader配置、APP工程调整、Ymodem传输优化等关键步骤,为嵌入式开发者提供了一套完整的解决方案,特别适用于封闭式设备的远程更新需求。

weixin_28744613的博客 185

uniapp [全端兼容] - 最新详细实现拍摄视频录像并可播放预览视频,调起本机摄像头开启录像录制完毕后保存到本机临时存放,可对拍摄的视频进行压缩处理减少文件大小不损失画质,详解录制视频并读取播放!

uni-app,h5移动端网页,微信小程序,支付宝小程序,Android安卓,苹果ios,app,nvue,录视频,拍视频,拍摄录制视频后上传服务器,调起摄像头录视频并可预览,录视频上传,录像,uniapp录制视频并上传,录制视频并保存到本地设备,如何本地保存并播放预览,提供给用户观看MP4视频录像并上传到后端服务器完整功能源码,视频压缩,mp4文件,删除视频,录像后怎么预览,临时视频文件怎么减少压缩大小,视频压缩及上传,自己录视频并生成可播放的文件,录视频并能打开查看,视频压缩后上传,本机相册,录完怎么预

🏆 前端领域优质创作者 1万+

龙腾CMS downloadFile接口任意文件读取漏洞复现 [附POC]

大连网龙网络科技有限公司专注于在信息科技领域中向客户提供商业解决方案,是专业的互联网服务解决方案提供商和网络营销服务专家,为用户提供一体化的网络营销整体解决方案,龙腾CMS downloadFile接口存在任意文件读取漏洞。

薛定谔嘚喵博客 726

uniapp [全端兼容] - 详细实现引入使用 Google 谷歌地图显示及搜索城市地点,提供地图标点、地址搜索、定位导航、中文显示及汉化、地图打位置标点显示、搜索框搜索功能、省市区详细经纬度数据等

uniapp,h5移动端网页,微信小程序,Android,苹果ios,app,nvue,谷歌地图,官方,谷歌官方文档,googlemap,申请key,uniApp谷歌地图,详细使用教程,无法访问,集成谷歌地图,app引入谷歌地图,选点定位,地图导航,位置搜索,城市搜索,文字地点模糊查询,地点省市区详细数据,经纬度信息,markers地图标记点,一直报错怎么办,接入google地图不显示报错,谷歌地图插件,vue3,vue2,组件,Key申请流程,谷歌key怎么申请,api文档,网站打不开,用什么插件,在u

🏆 前端领域优质创作者 1万+

医疗工具识别(手术器械计数):基于YOLOv8的智能手术器械管理系统

YOLOv8是Ultralytics公司于2023年推出的最新一代目标检测算法,相比前代YOLOv5,在精度和速度上都有显著提升。Anchor-free检测:不再使用预定义的anchor boxes,简化了检测流程更高效的骨干网络:采用CSPDarknet53作为特征提取网络多尺度特征融合:通过PANet结构实现更好的小目标检测损失函数优化:使用CIoU损失提高边界框回归精度YOLOv8提供了多种规模的模型(n/s/m/l/x),可根据实际需求在精度和速度之间进行权衡。

YOLO 485

YOLOv11改进策略【Conv和Transformer】| IJCAI 2024 利用FreqFormer中的SFA 空间 - 频率注意力和CTA 通道转置注意力 二次改进C3k2

在FreqFormer模型中,SFA(Spatial-Frequency Attention)和CTA(Channel Transposed Attention)模块是关键组成部分,它们针对传统Transformer在图像超分辨率任务中的不足而设计,旨在更好地恢复高频细节,提升模型性能。

Limiiiing的博客 761

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

上一篇: 什么是UPS?
下一篇: Windows蓝屏错误代码祥解
cracker_love
博客等级 码龄20年 22粉丝 64原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值