分类 ISSUE 下的文章

谈谈 docker 的安全性

作为开发人员我很少关注服务器环境的安全性问题,我一般会比较关注我自身代码的安全问题。
现在整站上了docker容器后,其实也会比较关注服务器的安全性,我个人觉得应该是比较安全的,毕竟是在容器中运行,就算我某个服务挂了,也威胁不到我宿主机的安全。


- 阅读剩余部分 -

[Highlight-js]docker容器中的安装

直接上命令了:

git clone https://github.com/highlightjs/highlight.js.git

cd highlight-js

sudo docker build -t highlight-js .

sudo docker run --rm -it --publish 8080:80 highlight-js

浏览器就能打开localhost:8080

找到实例id,并且进入

sudo docker ps
sudo docker exec -it xxxxxxid bash
node tools/build.js -t cdn

KVM nat网络提示不活跃

创建虚拟机的时候,需要联网,这时候竟然提示nat网络不活跃导致无法使用。
简单的方法就是手工启动
首先查看网络状态

[ya@ya-PC ~]$ sudo virsh net-list
 名称      状态   自动开始   持久
-----------------------------------
 default   活动   是         是

如果状态是不活跃,
执行:

sudo virsh net-start default

即可。

图形方式:
1.png

参考文档:
1.kvm虚拟机中virbr0虚拟网络接口的删除与恢复
2.ArchLinux/Manjaro 配置KVM环境

解决网上通传的2033年农历润月为7月的错误

开篇

农历的介绍不多说了,但是一直不是很了解,农历的日子是怎么算的。就很好奇,在某网站上看到算法,然后在研究的过程中,不经意见发现2033年的闰月错误。这里修改下。

很多地方都有引用那段js代码【万年历js】,网上还有很多人都引用了这个js,怕是因为2033年还没到,所以都没发现吧。【错误1 错误2

wangnianlidecuowu.jpg

解决方案

- 阅读剩余部分 -

twitter搜索语法

Operator Finds Tweets...
watching now containing both “watching” and “now”. This is the default operator.
“happy hour” containing the exact phrase “happy hour”.
love OR hate containing either “love” or “hate” (or both).
beer -root containing “beer” but not “root”.
#haiku containing the hashtag “haiku”.
from:interior sent from Twitter account “interior”.
list:NASA/astronauts-in-space-now sent from a Twitter account in the NASA list astronauts-in-space-now
to:NASA a Tweet authored in reply to Twitter account “NASA”.
@NASA mentioning Twitter account “NASA”.
politics filter:safe containing “politics” with Tweets marked as potentially sensitive removed.
puppy filter:media containing “puppy” and an image or video.
puppy -filter:retweets containing “puppy”, filtering out retweets
puppy filter:native_video containing “puppy” and an uploaded video, Amplify video, Periscope, or Vine.
puppy filter:periscope containing “puppy” and a Periscope video URL.
puppy filter:vine containing “puppy” and a Vine.
puppy filter:images containing “puppy” and links identified as photos, including third parties such as Instagram.
puppy filter:twimg containing “puppy” and a pic.twitter.com link representing one or more photos.
hilarious filter:links containing “hilarious” and linking to URL.
puppy url:amazon containing “puppy” and a URL with the word “amazon” anywhere within it.
superhero since:2015-12-21 containing “superhero” and sent since date “2015-12-21” (year-month-day).
puppy until:2015-12-21 containing “puppy” and sent before the date “2015-12-21”.
movie -scary :) containing “movie”, but not “scary”, and with a positive attitude.
flight :( containing “flight” and with a negative attitude.
traffic ? containing “traffic” and asking a question.

Please, make sure to URL encode these queries before making the request. There are several online tools to help you to do that, or you can search at twitter.com/search and copy the encoded URL from the browser’s address bar. The table below shows some example mappings from search queries to URL encoded queries:</p>

Search query URL encoded query
#haiku #poetry %23haiku+%23poetry
“happy hour” :) %22happy%20hour%22%20%3A%29

db2导出表结构以及数据

db2导出数据的时候报错:

Error Message = 

SQL0001N 绑定或预编译未成功完成

SQLCA

Size............

解决方式:
只要做下绑定就行了。
首先CD 进入BND目录,比如当前在:E:\Program Files\IBM\SQLLIB\BIN

cd ..\BND
db2 connection to 【DBName】
db2 set schema = 【SCHEMANAME】
db2 bind db2lksp.bnd blocking all grant public sqlerror continue
db2 bind db2lkfun.bnd blocking all grant public sqlerror continue

绑定结束后,用导出表结构命令
db2look -d 【DBName】 -i 【UserName】 -w 【PASSWORD】 -a -e -o d:\1.sql
导出表数据的话,cd到某个目录下,因为导出的文件,会在当前命令行所在的目录
db2move 【DBName】 export -u 【UserName】 -p 【PASSWORD】