`
meiping
  • 浏览: 47723 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
文章列表

MD5编码

    博客分类:
  • Java
public static String makeMD5(byte[] data) { char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; MessageDigest digest = null; try { digest = MessageDigest.getInstance("MD5"); } catch (Exception e) { log.error("get ...
# The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /tmp/mysql.sock # The MySQL server [mysqld] port = 3306 socket = /tmp/mysql.sock # 避免MySQL的外部锁定,减少出错几率增强稳定性 skip-locking bind-addres ...
主库172.30.6.2,从库172.30.6.114 主库的my.cnf文件加入 # 要使用同步功能, log-bin必须开启 log-bin=/data/bin-logs/master-log-bin relay-log = /data/relay-logs/master-relay-bin # 同步时主机的ServerID, 必须唯一. server-id = 1 #唯一标识 从库的my.cnf文件加入 server-id = 2 #唯一标识 master-host = 172.30.6.2 master-user = replicate master-p ...
一直都是使用 C/C++ 来编写 CGI ,最近碰到一个需要将数据库记录导出到 excel 文件的需求,在 C/C++ 下基本上没有什么好的解决办法,尤其是在 linux 下,但是时下流行的各种脚本语言却对 excel 文件的操作有不错的支持,比如 perl , python 等( php 下所能找到的组件都会或多或少有些问题,比如单元格内字节 255 限制, excel2003 版本限制等),基于 dui 语言的熟悉程度将 python 嵌入到 C++ 的解决思路也就形成了。   Python 下选用的组件是 pyexcelerator ,在 python 的官方网站上就能获得,安装过程这 ...
服务器出问题重启之后需要启动自己的服务,找到/etc/init.d/rc.local或者/etc/init.d/boot.local文件,在其中配置上自己的脚本
samba配置文件路径/etc/samba/smb.conf 1.添加用户 smbpasswd -a root 依照提示输入密码,此密码不必与系统密码相同,但是该用户却需要实现在系统中存在 2.修改配置文件 [global] netbios name = SMBSERVER server string = Linux Samba Server security = share guest ok = yes guest account = root display ...
:%s/$\n\$//g 合并多个空行 :%s/^\n$//g 合并多个空行为单个空行  

SSH端口转发

对于不能直接访问的服务,可以尝试用ssh来做一个通道   ssh -g -L 可访问IP:可访问端口:目标IP:目标端口 目标IP -p目标端口 -f  -f选项可以实现后台运行  
测试的脚本代码   #/bin/sh echo "step 1" i=0 while [ $i -lt 100 ] do expr 1 / 0 i=`expr $i + 1` done echo "step 2" 当错误信息比较少时,不处理错误流中的信息也没有问题 import java.io.*; public class T { public static void main(String[] args) throws Exception { final Process ...
1. 可变长参数在定义的时候只能放在方法的最后一个参数位置,一个方法只允许一个可变长参数;   2. 可变长参数本质就是数组,因此如下方式的定义是错误的: public class Thinking { public void test(String... p) { } public void test(String[] p) { } }   3. 调用的时候会优先选择固定长度参数的方法,如下面代码的输出就是test2: public class Thinking { public static void test(String... p) { ...
1. 定义Annotation package com.thinking.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolic ...
Global site tag (gtag.js) - Google Analytics