Time Server 快速搭建

node-media-server搭建流媒体直播服务 现如今视频直播已经不是什么新鲜的话题了,像抖音直播、快手直播作为一种全新的娱乐方式已经融入到大众的生活中,成为群体生活方式的一部分。今天我们就使用nodejs技术搭建一套自己的流媒体直播服务。 阅读详情

Time Server 时间服务器,我们经常会发现服务器上的时间不正确,这样会影响到我们的应用,有时甚至会带来一些不良后果。比如影响我们的备份,影响我们的数据库的更新等。比较常见的解决方行了,后面的195.13.1法是与公网上的时间服务器同步(只用使用crontab执行00 02 * * * /usr/sbin/ntpdate 195.13.1.153就.153就是公网上可以用的时间服务器之一),但这样做计算机必须能连接公网,这样也许会有一些安全问题。并且如果你的计算机在内网不能直接连接公网的时间服务器的话,那就…… 今天我们就来讲一讲搭建我们自己的时间服务器的做法。

方法一:时间服务器与公网上的时间服务器同步,其它机器与自己的时间服务器同步。

缺点:时间服务器还要暴露在公网上;步骤如下:

 1. 检查是否有相应的包:
   # rpm -qa |grep ntp
   cyrus-imapd-nntp-2.2.3-11
   chkfontpath-1.10.0-1
   ntp-4.2.0-7

   如果没有ntp这个包,则从光盘上装上,执行下面命令安装NTP的RPM包:# rpm -ivh ntp-4.2.0-7.i386.rpm;

 2. 修改配置文件
   /etc/ntp.conf 是ntp的主要配置文件,里面设置了你用来同步时间的时间服务器的域名或者IP地址,下面是到互联网同步时间的最基本的配置:
   首先我们来定义自己喜欢的时间服务器:(可用的时间服务器,参看http://chinaunix.net/jh/5/100591.html,或者参看:http://www.eecis.udel.edu/~mills/ntp/servers.html)
       server 195.13.1.153
       server 210.72.145.44
   接下来,我们设置上面两台服务器的访问权限,在这个例子中我们不允许它们修改或者查询我们配置在Linux上的NTP服务器。
       restrict 195.13.1.153 mask 255.255.255.255 nomodify notrap noquery
       restrict 210.72.145.44 mask 255.255.255.255 nomodify notrap noquery
   说明:掩码255.255.255.255 是用来限制远程NTP服务器的掩码地址。然后设置允许访问的内网机器。请注意,配置中noquery已经去掉了:
       restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
   在此例中,掩码地址扩展为255,因此从192.168.1.1-192.168.1.254 的计算机都可以使用我们的NTP服务器来同步时间。如果你想限制的更严格一点,你可以修改你的掩码。
   最后,也是最重要的是默认的限制配置要从你配置文件中删除,否则它将覆盖你所有的配置选项,你会发现如果不删除该配置,你的时间服务器将只能和自己通讯。如果ntp.conf 中有以下一行,请将它注释:# restrict default ignore

/etc/ntp.conf  范例:
# Prohibit general access to this service.
# restrict default ignore

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
# restrict 127.0.0.1

# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service.  Do not permit those systems to modify the
# configuration of this service.  Also, do not use those
# systems as peers for synchronization.
restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap

# --- OUR TIMESERVERS -----
# or remove the default restrict line
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.

# restrict mytrustedtimeserverip mask 255.255.255.255 nomodify notrap noque
restrict 210.72.145.44 mask 255.255.255.255 nomodify notrap noquery
restrict 195.13.1.153  mask 255.255.255.255 nomodify notrap noquery
# server mytrustedtimeserverip
server 210.72.145.44
server 195.13.1.153

# --- NTP MULTICASTCLIENT ---
#multicastclient                        # listen on default 224.0.1.1
# restrict 224.0.1.1 mask 255.255.255.255 notrust nomodify notrap
# restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
# server        127.127.1.0     # local clock
# fudge 127.127.1.0 stratum 10

# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /var/lib/ntp/drift
broadcastdelay  0.008

#
# Authentication delay.  If you use, or plan to use someday, the
# authentication facility you should make the programs in the auth_stuff
# directory and figure out what this number should be on your machine.
#
authenticate yes

#
# Keys file.  If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
keys            /etc/ntp/keys

  3. 检查可用性

   a.保存你的配置文件,然后对每个你在ntp.conf里配置的时间服务器执一下查询命令,确保这些上游时间服务器可用。
       # ntpdate 195.13.1.153
       27 Jun 10:12:01 ntpdate[25475]: adjust time server 133.100.11.8 offset -0.127154 sec

    b.执行下列命令
       #  ntpq -p
       …… ……输出略
      一个可以证明同步问题的证据是所有远程服务器的jitter值是4000并且delay和reach的值是0;
     remote                          refid                   st t when poll reach   delay       offset      jitter
     ===================================================================
     *210.72.145.44          .ACTS.                1 u   40    16     377   55.211      9.172      16.620
     xntp2.belbone.be       195.13.23.6      2 u   106  128  367    384.904   -63.946   6.518

 4. 设置自启动

   为了使NTP服务可以在系统引导的时候自动启动,执行:
    # chkconfig ntpd on
   启动/关闭/重启NTP的命令是:
    # /etc/init.d/ntpd start
    # /etc/init.d/ntpd stop
    # /etc/init.d/ntpd restart

 5. 客户端的设置
    a. linux 客户端
       以root身份登录,执行crontab -e 输入00 02 * * * /usr/sbin/ntpdate 192.168.1.1(换成你的Time Server的ip)
       这样就会在每天的凌晨两点自动与Time Server同步时间。
    b. windows Xp 客户端
       双击右下角的时间,出现“日期和时间属性”的窗口,选择Internet 时间,在服务器一栏中输入你的Time Server的ip,点击"立即更新",过几秒钟将能看到更新成功的提示。然后勾选“自动与Internet时间服务器同步”。点击确定。

方法二:时间服务器与自己的硬件时钟同步,其它机器与时间服务器同步。

缺点:如果Time Server的硬件时钟不准确,则所有的时间将不准确。优点:更安全,没有暴露在公网上的机器。

unix 类系统的时钟都有两种,一种是硬件时钟,一种是系统时钟。在此不在详述。步骤如下:
1.校准Time server的硬件时钟(可以直接在bios中设置),或者用hwclock 命令来校对,例如: hwclock --set --date="6/16/04 11:14:05"

2.设置系统时间和硬件时钟同步:# hwclock --hctosys.

3.修改配置文件
   vi /etc/ntp.conf,我的ntp.conf如下

# Prohibit general access to this service.
# restrict default ignore
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1

# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service. Do not permit those systems to modify the
# configuration of this service. Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap

# --- OUR TIMESERVERS -----
# or remove the default restrict line
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
# restrict mytrustedtimeserverip mask 255.255.255.255 nomodify notrap noquery

# --- NTP MULTICASTCLIENT ---
#multicastclient # listen on default 224.0.1.1
# restrict 224.0.1.1 mask 255.255.255.255 notrust nomodify notrap
# restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap

# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition
#
#server 127.127.1.0 # local clock
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 10
#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /etc/ntp/drift
broadcastdelay 0.008
#
# Authentication delay. If you use, or plan to use someday, the
# authentication facility you should make the programs in the auth_stuff
# directory and figure out what this number should be on your machine.
#
authenticate yes
#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
keys /etc/ntp/keys

其它设置和方法一相同,启动ntp服务,配置客户端即可。

Dify新手必看:MCP Agent插件配置全流程(附Time MCP Server实战) 本文为Dify新手提供了MCP Agent插件的详细配置全流程,并以Time MCP Server为例进行实战演示。文章深入解析了Dify、Agent与MCP的协同关系,并分步指导了从环境准备、插件安装、服务器配置到工具集成与测试的完整操作,帮助开发者快速掌握如何为AI应用扩展外部工具调用能力。 阅读详情

相关推荐

RTC温度补偿:如何让时间分秒不差?

RTC(实时时钟)温度补偿技术通过"检测温度→计算误差→动态调整频率"的闭环机制,解决振荡器频率随温度变化导致的时间误差问题。核心步骤包括:1)高精度温度检测;2)基于温度-频率误差模型计算偏差;3)通过硬件(可编程电容/DAC)或软件方式调整振荡频率。该技术需突破温度检测精度、误差模型拟合、频率调整分辨率等关键点,根据不同应用场景(消费电子±5ppm至军工±0.1ppm)选择匹配方案。典型实现如STM32的分段线性补偿算法,可将工业级RTC精度提升至±2ppm以内。

上市公司前技术负责人,20 年软硬件深耕 + 百人研发团队管理经验,名校理工科背景加持。从技术攻坚到团队掌舵,沉淀海量项目实战与管理心得,专注分享软硬件干货、疑难问题解决方案,既是靠谱知识传播者,也盼链接优质项目共成长。 1230

Netty入门之TimeServer

嗨,大家好!!! 最近,上级给我安排了个任务,要把系统中与websocket的的模块独立出来,并用Netty重写,哈哈,从毕业到现在一直做的都是业务方面的开发,这方面的工作还没怎么做过,很高兴的接了这个任务。 下面就带大家初识JAVA界大名鼎鼎的Netty,从这篇文章中,大家可以学到的内容如下: 什么是Netty JDK中的I/O的缺点 为什么选择Netty ...

nuoWei_SenLin的博客 2184

【FLINK+Kerberos+kafka】在华为云上 bootstrap.server使用IP的GSS initiate failed 问题处理

目前互联网上所有的资料显示都是说没有正确设置KDC之类的,但本博主实际通过java代码低版本 如使用kafka-client 0.11.0 ,2.4.0等版本手动创建kafkaconfig 或者使用华为云的LoginUtils类 都能够正常链接,所以应该是高版本添加了相关配置,或者flink在subtask 创建kafkaAdminClient时 丢弃或使用了默认的一些配置行为,导致了客户端和kdc验证之间出现了principal 不一致导致验证失败。client.dns.lookup配置项作用。

honghanyue1791的博客 576

时间同步服务器NTP的搭建

一、ntp简介 网络时间协议,英文名称:Network Time Protocol(NTP)是用来使计算机时间同步化的一种协议,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做同步化,它可以提供高精准度的时间校正(LAN上与标准间差小于1毫秒,WAN上几十毫秒),且可介由加密确认的方式来防止恶毒的协议攻击。NTP的目的是在无序的Internet环境中提供精确和健壮的时间服务。 二、简单的...

践踏记忆的博客 994

别再瞎调参数了!分子动力学模拟新手必看的力场选择与验证实战指南

本文为分子动力学模拟新手提供力场选择与验证的实战指南,详细解析主流力场特性及适用场景,并通过水分子案例演示完整的验证流程。文章重点对比SPC/E、TIP3P和OPLS-AA三种力场在GROMACS中的表现,帮助读者避免常见参数调整误区,提升模拟准确性。

weixin_26934905的博客 426

ESP32-C3模组上跑通OTA升级(3)

ESP32-C3模组上跑通OTA升级(3)

phmatthaus的专栏 1353

ntp时钟服务器

时间服务器作用: 大数据产生与处理系统是各种计算设备集群的,计算设备将统一、同步的标准时间用于记录各种事件发生时序, 如E-MAIL信息、文件创建和访问时间、数据库处理时间等。 大数据系统内不同计算设备之间控制、计算、处理、应用等数据或操作都具有时序性, 若计算机时间不同步,这些应用或操作或将无法正常进行。 大数据系统是对时间敏感的计算处理系统,时间同步是大数据能够得到正确处理的基础保障,是大数据得以发挥作用的技术支撑。 大数据时代,整个处理计算系统内的大数据通信都是通过网络进行。 时间同步也

weixin_45465483的博客 1676

cesium 实时轨迹

运用cesium中model和polyline添加模型和轨迹线,用CallbackProperty方法来实时改变经纬度。

God's asylum的博客 1964

NTP Time Server使用

NTP对时服务。

chenfeng666的博客 2864

别再瞎改网络结构了!解决YOLO小目标检测痛点,我用这招把mAP提了15%

本文基于我7年工业PCB缺陷检测、无人机航拍、安防监控项目的一线落地经验,针对YOLO小目标检测最痛的「漏检率高、特征丢失、精度难提升」三大核心问题,拆解出。本文全程配套小目标特征丢失原理图、分块训练流程图、切图前后效果对比图、mAP提升柱状图、多方案性能对比表等可视化内容,从YOLO天生不擅长小目标的底层根源、方案核心原理、可直接复制的代码实现,到工业场景实测验证、新手必踩的10个坑位避坑指南,全链路讲透。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 388

RAG测评实战代码

本文主要介绍了RAG测评实战代码,希望对使用RAG的同学们有所帮助。 文章目录 1. 前言 2. 实战代码 2.1 实战代码一 2.2 实战代码二

herosunly的博客 1万+

时间服务器(time server)名单

我收集的国外time server的名单,欢迎测试使用。 Active Servers AR time.sinectis.com.ar (216.244.192.3) AR tick.nap.com.ar (200.49.40.1) AR tock.nap.com.ar (200.49.40.15) AU ntp.saard.net (203.21.37.18) BE ntp1.belbone.b

得峰的专栏 [网络收藏] 9406

深度学习工具包 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")

快速搭建Time Server

作者:梁尚锋 网名:好好先生/longfei 原出处:www.chinaunix.net 参考文档:http://www.chinalinuxpub.com/read.htm?id=1337      http://www.fengnet.com/showart.asp?art_id=395&cat_id=10      http://chinaunix.net/jh/6/16555.html 感

bon_jovi的专栏 1827

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

快速搭建Time Server与NIS Server.(转)

快速搭建Time Server与NIS Server.(转)[@more@]作者:梁尚锋 网名:好好先生/longfei原出处:www.chinaunix.net参考文档:http://www.chinalinuxpub.com...

congjukun0600的博客 235

MCP Server Boot Starters:快速构建AI助手工具扩展的脚手架指南

1. 先搞清楚 MCP Server Boot Starters 到底解决什么问题 如果你正在接触 Claude、Cursor 这类 AI 开发工具,或者在使用一些支持模型上下文协议(Model Context Protocol,简称 MCP)的智能体平台,那你很可能遇到过一个问题:为了让 AI 助手能访问本地文件、数据库或调用外部 API,你需要自己写一个 MCP 服务器(MCP Server)。这个过程涉及协议理解、网络通信、错误处理,对很多只是想快速验证一个想法的开发者来说,门槛不低。 MCP Ser

anvt77205的博客 335

SQL Server性能优化实战:STATISTICS TIME 使用技巧与解析

其内置的在线编辑器能直接运行带STATISTICS TIME的查询,即时看到时间统计结果,特别适合做性能对比实验。当启用该命令后,SQL Server会在查询执行过程中收集三个关键时间指标:解析时间(将SQL文本转换为可执行结构)、编译时间(生成执行计划)和执行时间(实际运行查询)。建议每次只修改一个变量进行对比测试,比如先测原始查询,再添加索引后测试,最后调整JOIN方式测试。对于复杂查询,可能发现编译时间过长,这时需要考虑简化查询或使用查询提示;首次运行查询时编译时间可能较长,因需要生成执行计划。

BlueTiger92的博客 325

Time MCP Server:全球化时间管理的智能解决方案

在全球化协作日益频繁的今天,跨时区沟通、多地域时间同步已成为团队协作的关键痛点。你是否曾因跨国会议时间换算失误而错过重要沟通?是否在处理分布式系统日志时因时区混乱而耗费额外精力?Time MCP Server(Model Context Protocol Server)作为一款轻量级时间服务组件,通过标准化的时间查询与转换接口,为开发者和运营人员提供了开箱即用的全球化时间管理解决方案。本文将从核心...

gitblog_01112的博客 509

passage-of-time-mcp完全指南:5分钟搭建AI时间计算服务器

passage-of-time-mcp是一款强大的MCP服务器,它赋予语言模型时间感知和时间计算能力,通过协作工具开发帮助AI理解时间流逝的意义。无论是处理时间差计算、时间戳解析还是获取时间上下文,这款工具都能让AI轻松应对各类时间相关任务。 ## 🌟 为什么选择passage-of-time-mcp? 在与AI交互的过程中,你是否遇到过这样的问题:当询问"两个日期之间相差多久"或"某个时间

gitblog_00562的博客 1083

HustOJ快速搭建

简单记录一下搭建过程 腾讯云 Ubuntu Server 16.04.1 LTS 64位 + HustOJ HustOj Github地址 1、使用以下脚本快速安装 wget https://raw.githubusercontent.com/zhblue/hustoj/master/trunk/install/install-ubuntu16+.sh sudo bash install-ubun...

Psychosocial的博客 4582

快速使用json-server搭建静态api

什么是JSON Server JSON Server是基于nodejs的静态API框架,能将本地静态文件快速映射成静态的REST API。 至于什么是REST API?请参考廖雪峰老师的网站上这篇解释,非常的通俗易懂。https://www.liaoxuefeng.com/wiki/1022910821149312/1105003357927328 快速上手 安装json-s...

Chardonnay2011的博客 316

Time MCP Server 服务说明文档

提供时间和时区转换能力的Model Context Protocol服务器

rengang66的博客 296

Docker Time Machine与macOS Time Machine协议深度解析

Docker Time Machine是一个强大的Docker镜像,能够运行Samba或AFP(netatalk)服务,为macOS提供兼容的Time Machine备份解决方案。本文将深入解析Docker Time Machine的核心功能、协议选择、安装配置以及常见问题解决,帮助用户快速搭建稳定高效的macOS备份系统。 ## 核心功能与协议选择 Docker Time Machine支持

gitblog_01137的博客 825

Ubuntu上快速搭建Nagios监控

转自:http://my.oschina.net/julienbin/blog/69186 Nagios是常用的系统监控工具,提供了很多基本服务的监控脚本,如HTTP,MYSQL等,同时具有不错的可扩展性,自己可定制针对特定参数的监控脚本以及报警的方式。但Nagios的配置相当复杂,本文总结了我最近在Ubuntu Server上搭建Nagios的过程,以方便大家将来更加快速的安装

1052

Ubuntu快速搭建内网NTP Server

根据报错提示,没有来源可以安装,这种情况下,我们需要先执行`sudo apt-get update` 进行更新。

par@ish的博客 3168

如何用 uv 搭建 Python MCP Server 的本地开发环境(uv sync、pytest、pyright、ruff)

本仓库(servers)是 Model Context Protocol 的参考实现集合,其中 3 个 Python 服务器位于 `src/fetch`、`src/git`、`src/time`,对应发布包 `mcp-server-fetch`、`mcp-server-git`、`mcp-server-time`。如果你要在本地运行、测试或二次开发这些 Python MCP Server,需要按仓

gitblog_00075的博客 782
上一篇: 查看Linux系统信息
下一篇: Ghost 系统备份与恢复(图解)
老伊万
博客等级 码龄21年 31粉丝 66原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值