/** * 根据 user id 获取 sessionId * * @param user 用户 id * @return 用户关联的 sessionId */ public Set<String> getSessionIds(String user) { Set<String> set = this.userSessionIds.get(user); return set != null ? set : Collections.emptySet(); }
/** * 根据用户 id 注册一个 session * * @param user 用户 id * @param sessionId Socket 会话 id */ publicvoidregisterSessionId(String user, String sessionId) { Assert.notNull(user, "User must not be null"); Assert.notNull(sessionId, "Session ID must not be null"); synchronized (this.lock) { Set<String> set = this.userSessionIds.get(user); if (set == null) { this.userSessionIds.put(user, newCopyOnWriteArraySet<>()); } set.add(sessionId); } }
/** * 根据用户 id 删除一个 session * * @param user 用户 id * @param sessionId Socket 会话 id */ publicvoidunregisterSessionId(String user, String sessionId) { Assert.notNull(user, "User Name must not be null"); Assert.notNull(sessionId, "Session ID must not be null"); synchronized (this.lock) { Setset=this.userSessionIds.get(user); if (set != null && set.remove(sessionId) && set.isEmpty()) { this.userSessionIds.remove(user); } } } }
# 检查是否为Root [ $(id -u) != "0" ] && { echo"Error: You must be root to run this script"; exit 1; }
# 检查系统信息 if [ -f /etc/redhat-release ];then OS='CentOS' elif [ ! -z "`cat /etc/issue | grep bian`" ];then OS='Debian' elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then OS='Ubuntu' else echo"Not support OS, Please reinstall OS and retry!" exit 1 fi
# 禁用SELinux if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config setenforce 0 fi
# 配置V2ray初始环境 ln -sf /usr/local/v2ray.fun/v2ray /usr/local/bin chmod +x /usr/bin/v2ray chmod +x /usr/local/bin/v2ray rm -rf /etc/v2ray/config.json cp /usr/local/v2ray.fun/json_template/server.json /etc/v2ray/config.json let PORT=$RANDOM+10000 UUID=$(cat /proc/sys/kernel/random/uuid) sed -i "s/cc4f8d5b-967b-4557-a4b6-bde92965bc27/${UUID}/g" /etc/v2ray/config.json sed -i "s/12345/${PORT}/g""/etc/v2ray/config.json" python /usr/local/v2ray.fun/genclient.py python /usr/local/v2ray.fun/openport.py service v2ray restart
# auto open port after start # append a new line cat /etc/rc.local | grep openport.py if [[ $? -ne 0 ]]; then cat>>/etc/rc.local<<EOF python /usr/local/v2ray.fun/openport.py EOF chmod a+x /etc/rc.local fi
MongoDB shell version v3.6.7 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.7 Server has startup warnings: 2018-08-23T08:57:46.048+0800 I STORAGE [initandlisten] 2018-08-23T08:57:46.048+0800 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2018-08-23T08:57:46.048+0800 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 65535 files. Number of processes should be at least 32767.5 : 0.5 times number of files. 2018-08-23T08:57:47.190+0800 I CONTROL [initandlisten]
Exception in thread "main" java.lang.NoSuchMethodError: org.json.JSONArray.iterator()Ljava/util/Iterator; at com.aliyuncs.regions.LocalEndpointResolver.<init>(LocalEndpointResolver.java:39) at com.aliyuncs.profile.DefaultProfile.<init>(DefaultProfile.java:72) at com.aliyuncs.profile.DefaultProfile.getProfile(DefaultProfile.java:209) at com.rx.f3d.common.util.SmsSendUtil.main(SmsSendUtil.java:28)
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:LlGBRJTgQmY2rDmEi/PH6Ql0UF1zX/nbQXHwORhTK1Q. Please contact your system administrator. Add correct host key in ~/.ssh/known_hosts to get rid of this message. Offending ECDSA key in ~/.ssh/known_hosts:14 ECDSA host key for 119.32.78.141 has changed and you have requested strict checking. Host key verification failed.