跳至主要内容

博文

目前显示的是 三月, 2016的博文

maven 关于字符集的设置

<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> <build> <defaultGoal>clean test package</defaultGoal> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1...

Mac 的启动组合键

在启动期间按住某些键可以使用一些 Mac 功能。  请在 Mac 开机并听到启动声后立即按住这些键。请一直按住,直至所述行为出现。以下组合适用于 基于 Intel 的 Mac 电脑 。 在启动期间按住 描述 Shift ⇧ 以 安全模式 启动。 Option ⌥ 启动进入 启动管理器 。 C 从可引导的 CD、DVD 或 USB 闪存驱动器(如 OS X 安装介质)启动。 D 启动进入  Apple Hardware Test  或  Apple Diagnostics ,具体取决于您正在使用的 Mac。 Option-D 通过互联网启动进入  Apple Hardware Test  或  Apple Diagnostics 。 N 从兼容的 NetBoot 服务器启动。 Option-N 使用默认的启动映像从 NetBoot 服务器启动。 Command (⌘)-R 从  OS X 恢复功能 启动。 Command-Option-R 通过互联网从  OS X 恢复功能 启动。 Command-Option-P-R 重置 NVRAM 。当再次听到启动声后,请松开这些键。 Command-S 以 单用户模式 启动。 T 以 目标磁盘模式 启动。 X 从 OS X 启动宗卷启动,否则 Mac 将从非 OS X 启动宗卷启动。 Command-V 以 详细模式 启动。 推出键 (⏏)、F12、鼠标键或触控板按钮 推出可移动介质,如光盘。 其他 Mac 键盘快捷键 在 Mac 启动后可用。 上次修改时间:  2015-6-2

Mac 键盘快捷键

您可以按组合键来执行通常需要鼠标、触控板或其他输入设备才能完成的操作。 要使用键盘快捷键,请按住一个或多个修饰键,同时按快捷键的最后一个键。例如,要使用快捷键 Command-C(拷贝),请按住 Command 键并按 C 键,然后同时松开这两个键。Mac 菜单和键盘通常使用 某些按键的符号 ,其中包括以下修饰键: Command ⌘ Shift ⇧ Option ⌥ Control ⌃ Caps Lock ⇪ Fn 如果您使用的是 Windows PC 专用键盘,请用 Alt 键代替 Option 键,用 Windows 标志键代替 Command 键。有些 Mac 键盘和快捷键使用顶行中的特殊按键,这些按键上有音量图标、显示屏亮度图标和其他功能图标。按下图标键可执行相应功能,或将其与 Fn 键组合使用来用作 F1、F2、F3 或其他标准功能键。  要了解更多快捷键,请查看您所用 app 的菜单。每个 app 都有其自己的快捷键,并且一个 app 中使用的快捷键可能不适用于另一个 app。  剪切、拷贝、粘贴和其他常用快捷键           快捷键           描述 Command-X 剪切 :删除所选项并将其拷贝到剪贴板。 Command-C 将所选项 拷贝 到剪贴板。这同样适用于 Finder 中的文件。 Command-V 将剪贴板的内容 粘贴 到当前文稿或 app 中。这同样适用于 Finder 中的文件。 Command-Z 撤销 前一个命令。随后您可以按 Command-Shift-Z 来 重做 ,从而反向执行撤销命令。在某些 app 中,您可以撤销和重做多个命令。 Command-A 全选 各项。 Command-F 查找 :打开“查找”窗口,或在文稿中查找项目。 Command-G 再次查找 :查找之前所找到项目出现的下一个位置。要查找出现的上一个位置,请按 Command-Shift-G。 Command-H 隐藏 最前面的 app 的窗口。要...

mysql 5.7用户账号设置

mysql升级后不再默认root用户本地免密码登录,而是初始生成了一个随机密码。 这个随机密码存放的位置也比较坑爹,可用如下命令看看: cat /var/log/mysqld.log |grep password 创建新用户还是和旧版本一样,具体命令如下: mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'     ->     WITH GRANT OPTION; mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'     ->     WITH GRANT OPTION; mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin_pass'; mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost'; mysql> CREATE USER 'dummy'@'localhost';

linux tcp 优化

Step 1, increase the maximum number of open file descriptors To handle thousands of concurrent TCP connections, we should increase the limit of file descriptors opened. Edit the  limits.conf vi /etc/security/limits.conf Add these two lines * soft nofile 51200 * hard nofile 51200 Then, before you start the shadowsocks server, set the ulimit first ulimit -n 51200 Step 2, Tune the kernel parameters The priciples of tuning parameters for shadowsocks are Reuse ports and conections as soon as possible. Enlarge the queues and buffers as large as possible. Choose the TCP congestion algorithm for large latency and high throughput. Here is an example  /etc/sysctl.conf  of our production servers: fs .file-max = 51200 net .core .rmem_max = 67108864 net .core .wmem_max = 67108864 net .core .netdev_max_backlog = 250000 net .core .somaxconn = 4096 net .ipv4 .tcp_syncookies = 1 net .ipv4 .tcp_tw_reuse = 1 net .ipv4 .tcp_tw_recycle = 0 net .ipv4 ...