首页 文章 精选 留言 我的

精选列表

搜索[设置],共10027篇文章
优秀的个人博客,低调大师

ubuntu16.04设置tomcat自启动

我的tomcat名字叫tomcat8_product 1.拷贝catalina.sh到/etc/init.d/目录下 cd tomcat8_product/bin/catalina.sh /etc/init.d/ 2.改名 mv catalina.sh tomcat8_product 3.编辑tomcat8_product 在#!/bin/sh下添加两行内容后并保存退出 CATALINA_HOME=/home/tomcat8_productJAVA_HOME=/usr/lib/jvm/java-8-oracle 4.注册开机启动 update-rc.d -f tomcat8_product defaults 执行该命令会有两个警告提示,这个可以忽略,如果是报error,就一定不能忽略 5.重启机器 执行 reboot命令 6.重新登录 登录成功后,执行 ps -ef|grep 7.执行ps -ef|grep tomcat8_product 8.看到有相应的tomcat进程再运行,然后输入浏览器地址xxxxxx:8080,出现tomcat欢迎页表示整个流程是顺利,成功让tomcat自启动

优秀的个人博客,低调大师

openstack学习笔记二 网络设置基础

租用这个服务的机构,我们称之"租户/tenant/项目/project" 租户 用户 vxlan划分租户 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [root@h1~] #ipaddr 1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWN link /loopback 00:00:00:00:00:00brd00:00:00:00:00:00 inet127.0.0.1 /8 scopehostlo valid_lftforeverpreferred_lftforever 2:eth0:<BROADCAST,MULTICAST,UP,LOWER_UP>mtu1500qdiscmqstateUPqlen1000 link /ether 00:50:56:a0:b6:6bbrdff:ff:ff:ff:ff:ff inet192.168.1.201 /24 brd192.168.1.255scopeglobaleth0 valid_lftforeverpreferred_lftforever 3:ovs-system:<BROADCAST,MULTICAST>mtu1500qdiscnoopstateDOWN link /ether 36:26:25:65:14:9cbrdff:ff:ff:ff:ff:ff 4:br-ex:<BROADCAST,MULTICAST,UP,LOWER_UP>mtu1500qdiscnoqueuestateUNKNOWN link /ether de:4c:6d:9c:15:4dbrdff:ff:ff:ff:ff:ff 5:br-int:<BROADCAST,MULTICAST>mtu1500qdiscnoopstateDOWN link /ether ce:0b:9b:b5:c1:4dbrdff:ff:ff:ff:ff:ff 6:br-tun:<BROADCAST,MULTICAST>mtu1500qdiscnoopstateDOWN link /ether ae:75:26:fb:f8:42brdff:ff:ff:ff:ff:ff 你想把哪个网络作为数据包的出口,那么你就应该把那个网卡桥接到 br-ex openvswitch 简称 ovs 配置网卡 重点 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [root@h1network-scripts] #catifcfg-eth0 DEVICE=eth0 DEVICETYPE=ovs TYPE=OVSPort OVS_BRIDGE=br-ex ONBOOT= yes BOOTPROTO=none [root@h1network-scripts] #catifcfg-br-ex DEVICE=br-ex DEVICETYPE=ovs TYPE=OVSBridge ONBOOT= yes BOOTPROTO=none IPADDR=192.168.1.201 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS1=202.106.0.20 1 2 3 4 5 6 7 8 9 10 查看网卡 2:eth0:<BROADCAST,MULTICAST,UP,LOWER_UP>mtu1500qdiscmqmasterovs-systemstateUPqlen1000 link /ether 00:50:56:a0:b6:6bbrdff:ff:ff:ff:ff:ff 3:ovs-system:<BROADCAST,MULTICAST>mtu1500qdiscnoopstateDOWN link /ether d2:18:7d:5e:5e:b9brdff:ff:ff:ff:ff:ff 5:br-ex:<BROADCAST,MULTICAST,UP,LOWER_UP>mtu1500qdiscnoqueuestateUNKNOWN link /ether 00:50:56:a0:b6:6bbrdff:ff:ff:ff:ff:ff inet192.168.1.201 /24 brd192.168.1.255scopeglobalbr-ex valid_lftforeverpreferred_lftforever 管理员登陆http://192.168.1.201/dashboard 选择系统--网络--创建网络 创建,点击网络名称put-ex 下一步 创建一个项目,创建一个新的用户,新用户关联项目。 用新的用户登录,创建网络 先创建网络,然后创建路由,连到网络上,最后添加端口 本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/1795705,如需转载请自行联系原作者

优秀的个人博客,低调大师

Openstack 之 网络设置静态IP地址

Openstack网络分配都是动态分配,但是在实际使用当中更多的会用到静态IP,Ocata版本的web管理界面尚未提供完善的操作菜单界面,暂时只能通过命令行解决,其实也很简单,一条命令就解决了。下面是操作方法: 实例连接接口,系统会自动分配一个IP地址,比如192.168.170.153,修改成固定IP(192.168.170.181)方法如下: 1、openstack port list ,找出自动分配的IP和subnet; 2、然后执行下面这个命令进行修改,加--name参数顺便将端口名称修改: openstack port set --name cirros-1 --no-fixed-ip --fixed-ip ip-address='192.168.170.181',subnet='19b1397a-1150-495f-a423-fe0b104602d8' 7e475b34-7ae8-41dd-be10-7079f973926c 3、然后进入虚拟机,将相应的端口地址改为固定IP 192.168.170.181 本文转自yuweibing51CTO博客,原文链接:http://blog.51cto.com/yuweibing/2071351,如需转载请自行联系原作者

优秀的个人博客,低调大师

IPv6设置支持IOS审核

https://www.tunnelbroker.net/ 点击创建以后出现如下界面 检查服务器是否开启IPv6(表示没有开启)http://www.jianshu.com/p/2f6620e5a4f0 vim /etc/sysctl.conf #添加如下三行 sysctl -p net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0 vim /etc/modprobe.d/disable_ipv6.conf #options ipv6 disable=1改为options ipv6 disable=0 alias net-pf-10 off options ipv6 disable=0 vim /etc/sysconfig/network 添加 NETWORKING_IPV6=yes 重启网络systemctl restart network 可以看出已经支持IPv6 服务器执行如下命令上面获取的: modprobe ipv6 ip tunnel add he-ipv6 mode sit remote 216.218.221.6 local 39.107.13.70 ttl 255 ip link set he-ipv6 up ip addr add 2001:470:18:107b::2/64 dev he-ipv6 ip route add ::/0 dev he-ipv6 ip -f inet6 addr DNS控制台解析 测试可以看出已经解析 然后在这台服务器上面大家nginx支持IPv6代理即可 user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; include /usr/share/nginx/modules/.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$http_host" "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for ' '"$upstream_addr" "$upstream_status" "$upstream_response_time" "$request_time"'; access_log /etc/nginx/logs/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/.conf; } stream { upstream tcp_proxy { hash $remote_addr consistent; #远程地址做个hash server slbIP:80; } upstream tcp_proxy_443 { hash $remote_addr consistent; #远程地址做个hash server slbIP:443; } server { listen [::]:80; listen 80; proxy_connect_timeout 1s; proxy_timeout 10s; #后端连接超时时间 proxy_pass tcp_proxy; } server { listen [::]:443; listen 443; proxy_connect_timeout 1s; proxy_timeout 10s; #后端连接超时时间 proxy_pass tcp_proxy_443; } } 本文转自 小小三郎1 51CTO博客,原文链接:http://blog.51cto.com/wsxxsl/2044131,如需转载请自行联系原作者

优秀的个人博客,低调大师

ios7 设置status bar风格

How to change status bar style during launch on iOS 7 up vote 4 down vote favorite When I launch my app, it shows the launch image and a black status bar. How can I change it so the status bar is light during launch? I have set the status bar appearance to light in my AppDelegate didFinishLoading method, and it works for the rest of the app. ios objective-c ios7 share | edit | flag asked Sep 20 at 19:22 user1008096 23 2 add comment 1 Answer active oldest votes up vote 5 down vote To yourInfo.plistfile add this key-value pair: UIStatusBarStyle:UIStatusBarStyleLightContent The default (black) value isUIStatusBarStyleDefault. You can also append~iphoneor~ipadto the key. share | edit | flag answered Sep 20 at 19:28 iMartin 2,015 4 11 add comment 欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 572064792 | Nodejs:329118122 做人要厚道,转载请注明出处! 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/sunshine-anycall/p/3341024.html ,如需转载请自行联系原作者

优秀的个人博客,低调大师

ES设置查询的相似度算法

similarity Elasticsearch allows you to configure a scoring algorithm orsimilarityper field. Thesimilaritysetting provides a simple way of choosing a similarity algorithm other than the defaultBM25, such asTF/IDF. Similarities are mostly useful fortextfields, but can also apply to other field types. Custom similarities can be configured by tuning the parameters of the built-in similarities. For more details about this expert options, see thesimilarity module. The only similarities which can be used out of the box, without any further configuration are: BM25 The Okapi BM25 algorithm. The algorithm used by default in Elasticsearch and Lucene. See Pluggable Similarity Algorithmsfor more information. classic The TF/IDF algorithm which used to be the default in Elasticsearch and Lucene. See Lucene’s Practical Scoring Functionfor more information. boolean A simple boolean similarity, which is used when full-text ranking is not needed and the score should only be based on whether the query terms match or not. Boolean similarity gives terms a score equal to their query boost. Thesimilaritycan be set on the field level when a field is first created, as follows: PUT my_index { "mappings": { "my_type": { "properties": { "default_field": { "type": "text" }, "classic_field": { "type": "text", "similarity": "classic" }, "boolean_sim_field": { "type": "text", "similarity": "boolean" } } } } } COPY AS CURL VIEW IN CONSOLE Thedefault_fielduses theBM25similarity. Theclassic_fielduses theclassicsimilarity (ie TF/IDF). Theboolean_sim_fielduses thebooleansimilarity. Default and Base Similarities By default, Elasticsearch will use whatever similarity is configured asdefault. However, the similarity functionsqueryNorm()andcoord()are not per-field. Consequently, for expert users wanting to change the implementation used for these two methods, while not changing thedefault, it is possible to configure a similarity with the namebase. This similarity will then be used for the two methods. You can change the default similarity for all fields in an index when it iscreated: PUT /my_index { "settings": { "index": { "similarity": { "default": { "type": "classic" } } } } } If you want to change the default similarity after creating the index you mustcloseyour index, send the follwing request andopenit again afterwards: PUT /my_index/_settings { "settings": { "index": { "similarity": { "default": { "type": "classic" } } } } } from:https://www.elastic.co/guide/en/elasticsearch/reference/5.4/index-modules-similarity.html 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7451929.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

elasticSearch空间坐标的设置和查询

原文网址:http://blog.csdn.net/yangwenbo214/article/details/54411004 一、数据准备 为了方便起见,我模拟臆造了json格式的数据 {"timestamp":"2017-01-13T13:13:32.2516955+08:00","deviceId":"myFirstDevice","windSpeed":17,"haze":284,"city":"Beijing","lat":33.9402,"lon":116.40739} 1 模拟数据我用的是c#,大概如下: static void SendingRandomMessages() { //var eventHubClient = EventHubClient.CreateFromConnectionString(connectionString, eventHubName); int len = 4; string[] citys = { "Beijing", "Shangjhai", "Guangzhou", "Shenzhen" }; int[] avgWindSpeed = { 10, 16, 5, 7 }; int[] avgWindSpeed1 = { 10, 16, 5, 7 }; int[] avgHaze1 = { 200, 100, 50, 49 }; int[] avgHaze = { 200, 100, 50, 49 }; double[] latitude = { 39.3402, 31.23042, 23.13369, 22.54310 }; double[] longitude = { 116.40739, 121.47370, 113.28880, 114.057860 }; Random rand = new Random(); while (true) { try { for (int i = 0; i < len; i++) { avgWindSpeed[i] = avgWindSpeed1[i] + rand.Next(1, 11); avgHaze[i] = avgHaze1[i] + rand.Next(10, 100); var telemetryDataPoint = new { timestamp = DateTime.Now, deviceId = "myFirstDevice", windSpeed = avgWindSpeed[i], haze = avgHaze[i], city = citys[i], lat = latitude[i], lon = longitude[i] }; var message = JsonConvert.SerializeObject(telemetryDataPoint); //eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(message))); Console.WriteLine("{0} > Get message: {1}", "eventHubName", message); } } catch (Exception exception) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("{0} > Exception: {1}", DateTime.Now, exception.Message); Console.ResetColor(); } Thread.Sleep(200); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 此处我是作为消息发到一个eventhub中,你正确的做法可以将json写到文本文件中,再通过logstash读取即可 我的目的有两个: 获取数据中的lat、lon经纬度数据在kibana Map中进行绘图 获取数据中的timestamp作为我在kibana中的搜索时间,默认情况下是@timestamp 二、解决问题的整体思路 lat、lon本质上是float类型,此处需要设计一个mapping 日志内的时间,本质上应该是个字符串。我们得先卡出这个字段,然后用date match进行转换 三、解决实例 1. mapping的设计,我给出一个template { "template": "geo-*", "settings": { "index.refresh_interval": "5s" }, "mappings": { "_default_": { "_all": {"enabled": true, "omit_norms": true}, "dynamic_templates": [ { "message_field": { "match": "message", "match_mapping_type": "string", "mapping": { "type": "string", "index": "analyzed", "omit_norms": true } } }, { "string_fields": { "match": "*", "match_mapping_type": "string", "mapping": { "type": "string", "index": "analyzed", "omit_norms": true, "fields": { "raw": {"type": "string", "index": "not_analyzed", "ignore_above": 256} } } } } ], "properties": { "@version": { "type": "string", "index": "not_analyzed" }, "lonlat": { "type": "geo_point" } } } } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 大概解释如下: “template”: “geo-*”,所有geo开头的索引,都将会套用这个template配置 “lonlat”: { “type”: “geo_point” } 这个定义了lonlat为geo_point类型,为以后Map绘制奠定基础,这个是关键。 NOTE:这个lonlat名字不能取成特定的关键名字?,我取成location一直报错。 更加详细的介绍你可以查看官网文档 2. 给出logstash的配置文件 input { file { path => "/opt/logstash/1.log" start_position => "beginning" sincedb_path => "/dev/null" } } filter { json { source => "message" } mutate { add_field => [ "[lonlat]", "%{lon}" ] add_field => [ "[lonlat]", "%{lat}" ] } date{ match=>["timestamp","ISO8601"] timezone => "Asia/Shanghai" "target" => "logdate" } } output { stdout { codec => rubydebug } elasticsearch { hosts =>"wb-elk" index => "geo-%{+YYYY.MM.dd}" # template => "/opt/logstash/monster.json" # template_overwrite => true } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 大概解释一下: json {source => “message”}这个能将json数据格式分解出一个个字段 mutate 这个是向geo_point中加入经纬度数据 date {match=>}这个是将匹配json数据分解出来的timestamp,并以时间格式赋值给logdate output中注释掉的是template文件。我采用的是直接put template的方式,因此注释掉了。两个方法都可行 补充:经纬度信息格式确定和重命名: mutate { convert => { "lon" => "float" } convert => { "lat" => "float" } } mutate { rename => { "lon" => "[lonlat][lon]" "lat" => "[lonlat][lat]" } } 3.运行过程

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册