Java string hashing in Go

Java string hashing in Go https://www.manniwood.com/2016_03_20/fun_with_java_string_hashing.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 func ActualHash(s string) int32 { var h int32 for i := 0; i < len(s); i++ { h = 31*h + int32(s[i]) } return h }

docker basic, commands

docker basic, commands commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Docker images by tag docker rmi $(docker images --filter=reference="tag_name_0" -q) # Docker查看容器完整的容器 ID 和镜像 ID docker ps -a --no-trunc docker exec nexus3 cat /nexus-data/admin.password docker ps --filter"name=test-nginx" docker ps --format

ansible create file

ansible create file 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 - name: ensure file exists copy: content: "" dest: /etc/nologin force: no group: sys owner: root mode: 0555 https://stackoverflow.com/questions/28347717/how-to-create-an-empty-file-with-ansible

linux network

linux network https://segmentfault.com/a/1190000008836467 https://segmentfault.com/a/1190000008926093 https://segmentfault.com/a/1190000009249039

隧道协议

隧道协议 隧道技术的实质是用一种网络层的协议来传输另一种网络层协议,其基本功能是封装和加密,主要利用网络隧道来实现。 https://en.wikipedia.org/wiki/Tunneling_protocol https://baike.baidu.com/item/%E9%9A%A7%E9%81%93%E5%8D%8F%E8%AE%AE/5927649

内核态, 用户态

内核态, 用户态 用户态 Ring3运行于用户态的代码则要受到处理器的诸多检查,它们只能访问映射其地址空间的页表项中规定的在用户态下可访问页面的虚

filebeat

filebeat elasticsearch output 配置索引 vim /etc/filebeat/filebeat.yml 1 2 3 4 5 setup.template.name: "filebeat-" setup.template.pattern: "filebeat-*" output.elasticsearch: hosts: ["http://192.168.6.8:9200"] index: "filebeat-%{+yyyy.MM.dd}" 1 sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch Create a file with a .repo extension (for example, elastic.repo) in your /etc/yum.repos.d/ directory and add the following lines: [elastic-6.x] name=Elastic repository for 6.x packages baseurl=https://artifacts.elastic.co/packages/6.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md Your repository is ready to use. For example, you can install

logstash

logstash /etc/logstash/conf.d/logstash.conf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 input { redis { id => "system-log" data_type=>"list" host=>"127.0.0.1" port=>"6379" key=>"system-log" } redis { id => "app-log" data_type=>"list" host=>"127.0.0.1" port=>"6379" key=>"app-log" } } output { if "app-log" in [tags] { elasticsearch { id => "elk-es-app" hosts => "127.

chrome standalone 离线安装

chrome standalone 离线安装 https://www.google.com/chrome/browser/thankyou.html?standalone=1&platform=win&installdataindex=defaultbrowser 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 standalone=1 : 确认下载离线安装包 platform=win : 适用平台为windows installdataindex=defaultbrowser : 安装后设chrome为当前默认浏览器 extra=stablechannel :

golang git server, gogs, gitea

golang git server, gogs, gitea gitea 的文档 只提到了docker compose的部署方式, 想改成podman 还需要折腾一下, gogs 的文档 更清晰一些方便使用podman 1 podman

linux 内存盘 tmpfs

linux 内存盘 tmpfs 1 2 3 4 # archlinux tmp dir resize sudo mount -o remount,size=10G,noatime /tmp mount tmpfs /tmp -t tmpfs -o size=1024m 把内存当硬盘, 提速你的 linux 系统 场景: 电脑内存太大用不了那么多, 空着浪费, 所以利用起来。内存

微内核 宏内核

微内核 宏内核 微内核 Micro Kernel 微内核: 功能被划分成独立的过程,过程间通过IPC进行通信。模块化程度高,一个服务失效不会影响另外一个服务。 在微内核中,

Ansible setup模块

Ansible setup模块 https://www.ipcpu.com/2016/01/ansible-setup-when/ Ansible入门setup模块和条件判断 Linux ipcpu 2年前 (2016-01-11) 5963浏览 Ansible入门setup模块和条件判断.md 一、se

ELK Stack

ELK Stack ELK ELK 是 Elasticsearch、Logstash 和 Kibana 三种软件产品的首字母缩写, 这三者都是开源软件,通常配合使用,而且又先后归于 Elastic.co 公司名

chkconfig

chkconfig 1 2 3 4 5 6 7 8 9 10 chkconfig --list # 如果这个服务尚未被添加到 chkconfig 列表中,则现需要使用 –-add 参数将其添加进去 chkconfig –-add postfix # 比如要将MySQLd设置

memcache basic,command

memcache basic,command run as docker 1 2 3 4 5 6 podman run \ --name memcache \ -d \ -p 11211:11211 \ -v /etc/localtime:/etc/localtime:ro \ memcached -m 16 connect 1 telnet HOST PORT set 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 set key flags exptime bytes