Skip to main content

10 posts tagged with "linux"

View All Tags

解决Apache Guacamole中SSH连接数量超过60个以后无法建立新连接的问题

· 4 min read
orange
programmer on jvm platform

问题描述

在使用 Apache Guacamole 建立大量并发 SSH 连接时,当连接数超过60个,新的 SSH 连接将无法建立。 guacd 服务的日志会输出以下关键错误。

guacd[1]: INFO: Creating new client for protocol "ssh"
guacd[1]: INFO: Connection ID is "$9ab9b061-a1ae-4a18-b56a-83202fa22b5c"
guacd[3882]: INFO: User "@fc5e98ea-74ab-49c9-9b06-c3206469cab0" joined connection "$9ab9b061-a1ae-4a18-b56a-83202fa22b5c" (1 users now present)
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_key_create': Resource temporarily unavailable. Aborting.
guacd[3882]: ERROR: SSH handshake failed.
guacd[3882]: INFO: User "@fc5e98ea-74ab-49c9-9b06-c3206469cab0" disconnected (0 users remain)
guacd[3882]: INFO: Last user of connection "$9ab9b061-a1ae-4a18-b56a-83202fa22b5c" disconnected
guacd[1]: INFO: Connection "$9ab9b061-a1ae-4a18-b56a-83202fa22b5c" removed.

将Apache Guacamole从1.5.5升级到1.6.0版本后SSH终端粘贴中文首个字符不显示问题排查与解决

· 5 min read
orange
programmer on jvm platform

在将Apache Guacamole1.5.5升级到1.6.0版本后,遇到了一个的问题: 在使用SSH终端时,粘贴中文文本的第一个字符无法正常显示。

从本地复制一段以中文字符开头的文本(例如:“我是人”)并粘贴到Guacamole终端中时,屏幕上显示的并非完整的我是人,而是是人,开头的字不翼而飞。

cfb396cc38020b333834ea53436e0ba7116734666aeeaa7766b031579fe28de0.png

经过一番排查和测试,最终找到了问题的根源并给出了解决方案。

实现在X桌面环境中在不引入窗口管理器的情况下实现窗口的全屏

· 10 min read
orange
programmer on jvm platform

最近需要完成一个Remote App的功能, 这个功能大致是这样的:

用户在浏览器中完成对桌面端程序的所有的操作, 例如Ansys Fluent, 整个过程用户不需要下载任何相关桌面程序, 所有软件都安装在远端的实例中, 平台根据用户选择的应用在系统的桌面资源池中分配一个虚拟桌面, 并在这个虚拟桌面中启动相关应用程序.

X Window System

· 4 min read
orange
programmer on jvm platform

X Window System(简称X), 因为其最新版本为11, 所以也被称为X11.

这是一个为图形桌面系统设计的规范框架, 涵盖了以下关键功能:

  • 屏幕图像的渲染和显示
  • 鼠标和键盘的交互处理

Linux环境下, X Window System的实现是X.Org.

Gnome桌面环境启用Wayland

· 5 min read
orange
programmer on jvm platform

默认情况下, Gnome桌面环境使用的协议是X11协议.
WaylandX11的替代品, 可以提供更好的性能和体验.(绘图在Client侧而不是像X11一样由XServer负责).
下面将介绍如何启用Wayland协议.

脚本中实现修改用户密码

· 3 min read
orange
programmer on jvm platform

平时在写脚本的时候, 有时候会需要使用passwd命令来修改用户的密码.
例如为NIS的测试服务器新增一些测试用户, 并且为这些用户设置密码.
由于passwd需要交互式的输入, 所以在脚本中使用passwd命令会报错.
一个潜在的解决方案是加入--stdin参数但是有的linux发行版中passwd命令中的--stdin不存在.
如果你还这样执行的话将会显示以下错误.

passwd: unrecognized option '--stdin'
Usage: passwd [options] [LOGIN]

Options:
-a, --all report password status on all accounts
-d, --delete delete the password for the named account
-e, --expire force expire the password for the named account
-h, --help display this help message and exit
-k, --keep-tokens change password only if expired
-i, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --lock lock the password of the named account
-n, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-q, --quiet quiet mode
-r, --repository REPOSITORY change password in REPOSITORY repository
-R, --root CHROOT_DIR directory to chroot into
-S, --status report password status on the named account
-u, --unlock unlock the password of the named account
-w, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
-x, --maxdays MAX_DAYS set maximum number of days before password
change to MAX_DAYS

由于passwd命令中没有--stdin选项, 所以我们需要使用其他的方式来解决这个问题.

在linux中通过启用swapfile来增加虚拟内存并提高性能

· One min read
orange
programmer on jvm platform

swapfilelinux中的一种虚拟内存, 与windows中的pagefile类似.
swapfile的作用是当RAM不足时, 将一部分RAM中的数据写入到swapfile中, 从而释放出RAM的空间.
例如, 平时使用浏览器时会开启页面, 这些页面通常会占用一定的RAM空间.
如果开启了太多的页面, 会导致RAM不足, 这时就需要将一部分页面的数据写入到swapfile中, 从而释放出RAM的空间