2021年3月30日
摘要: 做为程序员,从感性角度讲评一下7年里我使用过的9款机械键盘,确实更有特色,这种特殊的触听体验非常美妙!
posted @ 我爱佳娃 阅读(346) | |
2020年1月19日
搬了个家,想通过a410点播imac上下载的电影,通过系统自带共享samba怎么都不成功。
想到是13年买的a410,应该升级一下,可凯发k8网页登录官网都没了,最后搜索到这个16年的最新固件:
通过usb顺利更新了一把。
再查看mac可以开nfs,方法如下:
sudo vi /etc/exports
加入:
/ -sec=sys
/users /users/popeye /users/popeye/movies -ro -mapall=popeye:staff -alldirs
检查配置:
sudo nfsd checkexports
重启:
sudo nfsd restart
这里要注意movies目录是我重新建立的755权限,不要用系统原来的目录,不然总是访问不了。
再到a410里网络浏览里就能找到了。
posted @ 我爱佳娃 阅读(615) | |
2012年12月21日
http://mathias-kettner.de/checkmk_livestatus.html下载并解压最新的包:
check_mk-1.2.1i3.tar.gz
再解压其中的到livestatus目录:
livestatus.tar.gz
进入:livestatus/src
再:make clean livestatus.o
会发现一堆错误,根据编译ndo的选项:
ndoutils-1.4b7/src:
make clean ndomod-3x.o
gcc -fno-common -g -o2 -dhave_config_h -d build_nagios_3x -o ndomod-3x.o ndomod.c io.o utils.o -bundle -flat_namespace -undefined suppress -lz
在最后的编译选项里添上:
-flat_namespace -undefined suppress -lz
就可以编译出:
livestatus.o
--------------------------
livecheck编不过,报找不到n_short:
ip_icmp.h:92: error: expected specifier-qualifier-list before ‘n_short’
vi ./check_icmp.c
把这个调整到include序列的最后即可:
#include "/usr/include/netinet/ip_icmp.h"
posted @ 我爱佳娃 阅读(1517) | |
2012年12月1日
摘要:
场景
想要用到的场景:用户访问web服务,web访问非web服务1,服务1又再访问2、3,合并计算后,把数据返回给web及前端用户。想让访问链上的所有服务都能得到认证和鉴权,认为本次请求确实是来自用户的。所以想到用cas,让用户在一点登录,所有服务都到此处认证和鉴权。
posted @ 我爱佳娃 阅读(9742) | |
2012年11月12日
june 30, 2011 | by
this tutorial will walk you through how to configure ssl (https://localhost:8443 access) on tomcat in 5 minutes.
for this tutorial you will need:
- (used version 6 for this tutorial)
- (used version 7 for this tutorial)
the set up consists in 3 basic steps:
- create a keystore file using java
- configure tomcat to use the keystore
- test it
- (bonus ) configure your app to work with ssl (access through https://localhost:8443/yourapp)
1 – creating a keystore file using java
fisrt, open the terminal on your computer and type:
windows:
cd %java_home%/bin
linux or mac os:
cd $java_home/bin
the $java_home on mac is located on “/system/library/frameworks/javavm.framework/versions/{your java version}/home/”
you will change the current directory to the directory java is installed on your computer. inside the java home directory, cd to the bin folder. inside the bin folder there is a file named keytool. this guy is responsible for generating the keystore file for us.
next, type on the terminal:
keytool -genkey -alias tomcat -keyalg rsa
when you type the command above, it will ask you some questions. first, it will ask you to create a password (my password is “password“):
loiane:bin loiane$ keytool -genkey -alias tomcat -keyalg rsa enter keystore password: password re-enter new password: password what is your first and last name? [unknown]: loiane groner what is the name of your organizational unit? [unknown]: home what is the name of your organization? [unknown]: home what is the name of your city or locality? [unknown]: sao paulo what is the name of your state or province? [unknown]: sp what is the two-letter country code for this unit? [unknown]: br is cn=loiane groner, ou=home, o=home, l=sao paulo, st=sp, c=br correct? [no]: yes enter key password for (return if same as keystore password): password re-enter new password: password
it will create a .keystore file on your user home directory. on windows, it will be on: c:\documents and settings\[username]; on mac it will be on /users/[username] and on linux will be on /home/[username].
2 – configuring tomcat for using the keystore file – ssl config
open your tomcat installation directory and open the conf folder. inside this folder, you will find the server.xml file. open it.
find the following declaration:
uncomment it and modify it to look like the following:
connector sslenabled="true" acceptcount="100" clientauth="false" disableuploadtimeout="true" enablelookups="false" maxthreads="25" port="8443" keystorefile="/users/loiane/.keystore" keystorepass="password" protocol="org.apache.coyote.http11.http11nioprotocol" scheme="https" secure="true" sslprotocol="tls" />
note we add the keystorefile, keystorepass and changed the protocol declarations.
3 – let’s test it!
start tomcat service and try to access https://localhost:8443. you will see tomcat’s local home page.
note if you try to access the default 8080 port it will be working too: http://localhost:8080
4 – bonus - configuring your app to work with ssl (access through https://localhost:8443/yourapp)
to force your web application to work with ssl, you simply need to add the following code to your web.xml file (before web-app tag ends):
securedapp /* confidential
the url pattern is set to /* so any page/resource from your application is secure (it can be only accessed with https). the transport-guarantee tag is set to confidential to make sure your app will work on ssl.
if you want to turn off the ssl, you don’t need to delete the code above from web.xml, simply changeconfidential to none.
reference: (this tutorial is a little confusing, that is why i decided to write another one my own).
happy coding!
posted @ 我爱佳娃 阅读(3133) | |
2012年9月27日
extjs和d3都很强大,不解释了,把d3绘的图直接放到一个ext的tab里,直接上图上代码:
代码中的d3例子来自:
https://github.com/mbostock/d3/wiki/force-layout
可用于绘制拓扑结构图.
ext.define('eb.view.content.singleview', {
extend : 'ext.panel.panel',
alias : 'widget.singleview',
layout : 'fit',
title : 'single view',
initcomponent : function() {
this.callparent(arguments);
},
onrender : function() {
var me = this;
me.doc = ext.getdoc();
me.callparent(arguments);
me.drawmap();
},
drawmap : function() {
var width = 960, height = 500
var target = d3.select("#" this.id "-body");
var svg = target.append("svg").attr("width", width).attr("height",
height);
var force = d3.layout.force().gravity(.05).distance(100).charge(-100)
.size([width, height]);
// get from: https://github.com/mbostock/d3/wiki/force-layout
// example: force-directed images and labels
d3.json("graph.json", function(json) {
force.nodes(json.nodes).links(json.links).start();
var link = svg.selectall(".link").data(json.links).enter()
.append("line").attr("class", "link");
var node = svg.selectall(".node").data(json.nodes).enter()
.append("g").attr("class", "node").call(force.drag);
node.append("image").attr("xlink:href",
"https://github.com/favicon.ico").attr("x", -8).attr("y",
-8).attr("width", 16).attr("height", 16);
node.append("text").attr("dx", 12).attr("dy", ".35em").text(
function(d) {
return d.name
});
force.on("tick", function() {
link.attr("x1", function(d) {
return d.source.x;
}).attr("y1", function(d) {
return d.source.y;
}).attr("x2", function(d) {
return d.target.x;
}).attr("y2", function(d) {
return d.target.y;
});
node.attr("transform", function(d) {
return "translate(" d.x "," d.y ")";
});
});
});
}
});
posted @ 我爱佳娃 阅读(4435) | |
2012年8月5日
到这里下载最新pkg:
http://www.mysql.com/downloads/
下来后先装:mysql-5.5.27-osx10.6-x86_64.pkg
它是装到/usr/local/mysql,到此目录运行下:
./scripts/mysql_install_db --user mysql
通过这个启动:
./bin/mysqld_safe
排错:
看下上面的log提示.
can't find file: './mysql/host.frm' :一般是没权限,把data目录删除,再用上面命令建一次
unknow option:把/etc/my.cnf删除掉,里面有新版本不认识的上一版本遗留配置
说mysql.sock找不到,这个版本是在/tmp/目录下哦!
再把剩下两个包装了,就可以通过配置面板启动了:
mysql.prefpane
mysqlstartupitem.pkg
下次升级可能要给下/usr/local/mysql/data目录的权限
posted @ 我爱佳娃 阅读(2601) | |
2011年10月9日
摘要: 非常浅显易懂的perl编码说明.
一目了然perl编码,注意是转的
posted @ 我爱佳娃 阅读(3172) | |
2011年10月3日
下面以mac为例,如果是linux需要把dyld发为ld
把下面代码加到代码开头,它就可以自启动了,不需要再export或者-i
begin {
#需要加到loadpath的路径
my $need= '/usr/local/nagios/pkg/ebase/';
push @inc, $need;
if ( $^o!~ /mswin32/ ) {
my $ld= $env{dyld_library_path};
if ( !$ld) {
$env{dyld_library_path} = $need;
}
elsif ( $ld!~ m#(^|:)\q$need\e(:|$)# ) {
$env{dyld_library_path} .= ':' . $need;
}
else {
$need= "";
}
if ($need) {
exec 'env', $^x, $0, @argv;
}
}
}
@import ;@import url(/uploads/css/css/cuteeditor.css);
posted @ 我爱佳娃 阅读(1724) | |
限制用户在自己目录下载文件:
建立nagiosdnld
指向软链接:/usr/local/nagios/dnld -> /users/nagiosdnld/dnld
编辑/etc/sshd_config
match user nagiosdnld
x11forwarding no
allowtcpforwarding no
forcecommand internal-sftp
chrootdirectory /users/nagiosdnld
重启下服务:
launchctl stop org.openbsd.ssh-agent
launchctl start org.openbsd.ssh-agent
@import ;@import url(/uploads/css/css/cuteeditor.css);
posted @ 我爱佳娃 阅读(1779) | |