杂七杂八

  • avatar:【电脑】(术语)指在虚拟实境中互动地呈现一个人

  • 获取屏幕宽度,双屏有效
1
2
3
4
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
GraphicsConfiguration[] gc = gs[0].getConfigurations();
Rectangle bounds = gc[0].getBounds();

  • 插件开发配置

配置右键->





新建菜单->





  • ubuntu 消息气泡

export DISPLAY=:0.0 && notify-send -i /usr/share/icons/ubuntu-mobile/actions/scalable/voicemail.svg 喂你有个大bug 是大大


  • ctrl+shift+alt+/ 打开idea注册表信息

  • swagger 添加"application/octet-stream;charset=utf-8" 就可以下载文件了

  • unzip -O gbk 添加编码解压,解决乱码问题

  • JENKINS_NODE_COOKIE instead of BUILD_ID
    jenkins 自动构建完成后自动杀掉后台进程,可以设置

               script{
                     withEnv(['JENKINS_NODE_COOKIE=dontkill']) {
                         sh '''
                            cp scs-admin/target/scs-admin.jar /home/hx-pc/my/scs-admin.jar
                            cd /home/hx-pc/my/
                            java -jar scs-admin.jar &
                            sh pause.sh
                        '''
                    }
                }
    

  • curl ifconfig.me 查看自己公网ip地址

  • nginx添加静态文件地址,文件夹
    autoindex on;
    autoindex_exact_size off;
    autoindex_localtime on;

  • idea 帐号 xinhu20170105

  • 安装qt5
    sudo add-apt-repository ppa:hzwhuang/ss-qt5
    sudo apt-get update
    sudo apt-get install shadowsocks-qt5

  • linux代理

    export http_proxy=118.210.42.251:44367 或:export https_proxy=118.210.42.251:44367
    要取消该设置:unset http_proxy 或:unset https_proxy
    env|grep -i proxy 查看当前代理的环境变量
    unset all_proxy 取消代理

  • git 代理 

    设置ss
    git config --global http.proxy 'socks5://127.0.0.1:1080'
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    设置代理
    git config --global https.proxy http://127.0.0.1:1080
    git config --global https.proxy https://127.0.0.1:1080
    取消代理
    git config --global --unset http.proxy
    git config --global --unset https.proxy

  • centos6.5 开放端口

    用vim打开 /etc/selinux/config
    SELINUX=disabled
    /sbin/iptables -I INPUT -p tcp --dport 8500 -j ACCEPT
    /etc/init.d/iptables save
    service iptables restart

  • kerberos

    sudo kinit -k -t hdfs.keytab hdfs/node1.sc.com@SC.COM

  • 线上流量回放工具

  • 主从数据库同步

    查看主库 4.4 - 4.1
    show master status;
    查看主从是否正常同步
    show SLAVE status;
    停掉主从同步关系
    stop slave;
    开始主从同步关系
    start slave;
    改变从库跟主库一致
    change master to master_host = '10.6.4.4 ', master_user = 'root',
    master_port=3306, master_password='xxxxx',
    master_log_file = 'mysql-bin.000123', master_log_pos=208098475;

  • conusl集群

$ consul agent -server -ui -bootstrap-expect=3 -data-dir=/tmp/consul -node=server1 -client=0.0.0.0 -bind=192.168.32.133

$ consul agent -server -ui -bootstrap-expect=3 -data-dir=/tmp/consul -node=server2 -client=0.0.0.0 -bind=192.168.32.134

$ consul agent -server -ui -bootstrap-expect=3 -data-dir=/tmp/consul -node=server3 -client=0.0.0.0 -bind=192.168.32.135

发表评论

电子邮件地址不会被公开。