Category - IT技术

atom windows 编辑器 容器    2017-04-28 16:18:07    922

提示

  1. The following file couldn't be moved to the trash.

解决办法:

  1. 安装插件“permanent-delete”
  2. 打开“Settings”
  3. 点击“Open Config Folder”
  4. 找到“keymap.cson”
  5. 在其中添加内容
  1. '.tree-view':
  2. 'delete': 'permanent-delete:delete'
  3. 'shift-delete': 'tree-view:remove'
  1. 保存后,再删除文件,可以看到右键最上方增加了一个选项“Delete permanently”,点击这个就可以删除文件了

参考文章:

https://github.com/atom/tree-view/issues/666
issue中“50Wliu”的回复


by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(==防止爬虫==):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/

alpine linux crontab BusyBox    2017-04-01 17:21:10    1964

首先alpine内嵌的是BusyBox,使用alpine的crontab实际就是使用BusyBox的crond服务,那么下来就简单介绍下如何使用吧,网上教程还是比较多的:

配置文件存放位置:

配置文件是在如下目录中的

  1. /var/spool/cron/crontabs/root

使用方式

  1. 向crontab的配置文件中添加配置
  1. vi /var/spool/cron/crontabs/root
  2. # 或者
  3. crontab -e
  4. # 填入如下内容,最后一行为我添加的测试任务
  5. # do daily/weekly/monthly maintenance
  6. # min hour day month weekday command
  7. */15 * * * * run-parts /etc/periodic/15min
  8. 0 * * * * run-parts /etc/periodic/hourly
  9. 0 2 * * * run-parts /etc/periodic/daily
  10. 0 3 * * 6 run-parts /etc/periodic/weekly
  11. 0 5 1 * * run-parts /etc/periodic/monthly
  12. * * * * * echo "test" >> /app/test.log
  1. 启动crond
  1. crond
  1. 查看状态
  1. ps
  2. PID USER TIME COMMAND
  3. ·····
  4. 82 root 0:00 crond
  5. 292 root 0:00 ps
  1. 查看/app/test.log是否有输入内容
  1. cat test.log
  2. test
  3. test
  4. test
  5. test
  6. test

OK,至此对于c

java jetty Docker maven    2017-03-26 23:38:30    993

1. 准备好一个非常简单点的web项目(maven项目)

2. 准备好maven环境,并配置pom文件,关于jetty内容如下:

  1. <!-- jetty dependecies begin -->
  2. <dependency>
  3. <groupId>org.eclipse.jetty</groupId>
  4. <artifactId>jetty-server</artifactId>
  5. <version>9.1.4.v20140401</version>
  6. </dependency>
  7. <dependency>
  8. <groupId>org.eclipse.jetty</groupId>
  9. <artifactId>jetty-webapp</artifactId>
  10. <version>9.1.4.v20140401</version>
  11. </dependency>
  12. <dependency>
  13. <groupId>org.eclipse.jetty</groupId>
  14. <artifactId>jetty-continuation</artifactId>
  15. <version>9.1.4.v20140401</version>
  16. </dependency>
  17. <dependency>
  18. <groupId>org.eclipse.jetty</groupId>
  19. <artifactId>jetty-jsp</artifactId>
  20. <version>9.1.4.v20140401</version>
  21. </dependency>
  22. <!-- jetty dependecies end -->

3. 使用eclipse对maven项目进行build,获取build后的项目目录(或者将项目达成war包)

4. 创建运行配置jetty的Server类

运行war包的类

  1. public class WebAppWarServer {
  2. public static void main(String[] args) throws Exception {
  3. Server server = new Server(8080);
DB MySQL 优化 索引    2017-03-26 22:10:18    1013

分区表

建议:
1. 如果要进行分区的表有主键或者唯一键,那么分区键必须包含这个主键或唯一键,否则无法创建分区表
2.

索引

  1. 最适合索引的列是出现在where子句中的列,或者连接子句中指定的列
  2. 使用唯一索引:索引的列的基数越大,索引的效果就越好。如只包含M和F,则索引效果不大
  3. 使用短索引:如果对字符串列进行索引,应该制定一个前缀长度(如果前缀长度范围内,多数值是唯一的)
  4. 不要过度索引:索引都需要占用磁盘空间,会降低写性能,会降低修改的性能(修改表内容时,索引必须进行更新,有时可能需要重构)
  5. 5.

配置文件

  1. 慢查询日志
  2. 使用缓存查询,当表更改(结构和数据)后,查询缓存值的相关条目会被清空
  1. have_query_cache 是否已配置高速缓存(默认为true
  2. query_cache_size 缓存区大小,单位MB,如:16M
  3. query_cache_type 变量值从0~2
  4. 0或者off(缓存关闭)
  5. 1on(缓存打开,使用SQL_NO_CACHE提示的SELECT除外)
  6. 2或者demand(只有带SQL_CACHEselect语句提供高速缓存)
  7. query_cache_limit 单个查询能够使用的缓存大小,默认1M

InnoDB内存优化

  1. innodb_buffer_pool_size

    InnoDB 存储引擎表数据和索引数据的最大缓存区大小(同时为数据块和索引块提供数据缓存),此值越大,缓存命中率就越高,访问InnoDB表需要的磁盘IO就越少,性能就越高。在一个专用的数据库服务器上,可以将80%的物理内存分配给innodb_buffer_pool_size,但是不要太大,以免造成页交换

  2. innodb_buffer_pool_instances

    默认值是1,表示InnoDB缓存池被划分到一个区域。适当地增加该参数(例如将该参数值设置为2),此时InnoDB被划分成为两个区域,可以提升InnoDB的并发性能。如果InnoDB缓存池被划分成多个区域,建议每个区域不小

sublime OmniMarkupPreviewer    2017-03-26 22:07:13    868

OmniMarkupPreviewer 作为 Sublime Text 的一款强大插件,支持将标记语言渲染为 HTML 并在浏览器上实时预览,同时支持导出 HTML 源码文件,使markdown编辑特别方便

1. 打开配置:

  1. Sublime Text > Preferences > Package Settings > OmniMarkupPreviewer > Settings - User

2. 去除extensions配置中的 strikeout ,修改为如下

  1. {
  2. "renderer_options-MarkdownRenderer": {
  3. "extensions": ["tables", "fenced_code", "codehilite"]
  4. }
  5. }

参考:
* 近乎完美的 Markdown 写作体验 - Sublime Text 3 + OmniMarkupPreviewer
* OmniMarkupPreviewer 404

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

24/26