어쩐지(?) mariadb 설치시 암호를 안물어 본다고 했더니

저런 이상한(?) 스크립트를 추가해놓은 듯.

 

$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n]
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

[링크 : https://bugwhale.tistory.com/39]

'프로그램 사용 > mysql & mariaDB' 카테고리의 다른 글

mariaDB 설치 실패  (0) 2025.03.04
mariadb msec 단위 시간 얻기  (0) 2022.08.31
mariadb c# connector  (0) 2021.10.22
HeidiSQL  (2) 2021.08.18
sql zerofill  (0) 2019.11.25
Posted by 구차니
프로그램 사용/minicom2022. 8. 25. 11:36

-H를 주면 hex mode로 출력되는데 작동중에 모드 전환하는건 없나?

 

$ minicom --help
Usage: minicom [OPTION]... [configuration]
A terminal program for Linux and other unix-like systems.

  -b, --baudrate         : set baudrate (ignore the value from config)
  -D, --device           : set device name (ignore the value from config)
  -s, --setup            : enter setup mode
  -o, --noinit           : do not initialize modem & lockfiles at startup
  -m, --metakey          : use meta or alt key for commands
  -M, --metakey8         : use 8bit meta key for commands
  -l, --ansi             : literal; assume screen uses non IBM-PC character set
  -L, --iso              : don't assume screen uses ISO8859
  -w, --wrap             : Linewrap on
  -H, --displayhex       : display output in hex
  -z, --statline         : try to use terminal's status line
  -7, --7bit             : force 7bit mode
  -8, --8bit             : force 8bit mode
  -c, --color=on/off     : ANSI style color usage on or off
  -a, --attrib=on/off    : use reverse or highlight attributes on or off
  -t, --term=TERM        : override TERM environment variable
  -S, --script=SCRIPT    : run SCRIPT at startup
  -d, --dial=ENTRY       : dial ENTRY from the dialing directory
  -p, --ptty=TTYP        : connect to pseudo terminal
  -C, --capturefile=FILE : start capturing to FILE
  -F, --statlinefmt      : format of status line
  -R, --remotecharset    : character set of communication partner
  -v, --version          : output version information and exit
  -h, --help             : show help
  configuration          : configuration file to use

These options can also be specified in the MINICOM environment variable.
This variable is currently unset.
The configuration directory for the access file and the configurations
is compiled to /etc/minicom.

Report bugs to <minicom-devel@lists.alioth.debian.org>.

 

-H, --displayhex
Turn on output in hex mode.

[링크 : https://www.systutorials.com/docs/linux/man/1-minicom/]

'프로그램 사용 > minicom' 카테고리의 다른 글

minicom에서 stty로 터미널 폭 조절하기  (0) 2023.10.24
minicom lf에 cr 붙이기  (0) 2023.01.05
minicom 로그 저장하기  (0) 2021.09.16
minicom timestamp  (0) 2021.09.16
minicom 폭 늘리기  (0) 2021.01.28
Posted by 구차니
프로그램 사용/wayland2022. 8. 22. 18:04

오랫만에 생각난김에 검색했는데 8월 2일 커밋된 따끈한 녀석 발견!

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/commits/main?search=atomic]

 

음.. 잘 해결되면 좋겠네..

backend-drm: improve atomic commit failure handling


When an atomic commit fails then the output will be stuck in
REPAINT_AWAITING_COMPLETION state. It is waiting for a vblank event that was
never scheduled.
If the error is EBUSY then it can be expected to be a transient error. So
propagate the error and schedule a new repaint in the core compositor.

This is necessary because there are some circumstances when the commit can fail
unexpectedly:
- With 'state_invalid == true' one commit will disable all planes. If another
  commit for a different output is triggered immediately afterwards, then this
  commit can temporarily fail with EBUSY because it tries to use the same
  planes.
- At least with i915, if one commit enables an output then a second commit for a
  different output immediately afterwards can temporarily fail with EBUSY. This
  is probably caused by some hardware interdependency.
Signed-off-by: Michael Olbrich's avatarMichael Olbrich <m.olbrich@pengutronix.de>

 

libweston/backend-drm/drm.c의 drm_repaint_flush()와

libweston/compositor.c의 output_repaint_timer_hander() 쪽에 수정이 가해진다.

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/commit/3b3fdc52c31f828ff0fb71d2c6ce7bdcc64f20a1]

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/blob/3b3fdc52c31f828ff0fb71d2c6ce7bdcc64f20a1/libweston/backend-drm/drm.c]

'프로그램 사용 > wayland' 카테고리의 다른 글

weston 커서 숨기기  (0) 2024.02.26
wayland hdmi - touch 연결  (0) 2023.09.08
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
Posted by 구차니
프로그램 사용/wayland2022. 8. 17. 16:49

weston_screenshooter_shoot()을 따라오는데 영 어딜 파야 나올지 감이 안온다.

아무튼.. libweston의 screenshooter.c가 실제적으로 수행되는 부분 같은데

//git\include\libweston\libweston.h
int
weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer,
   weston_screenshooter_done_func_t done, void *data);

//git\libweston\screenshooter.c
WL_EXPORT int
weston_screenshooter_shoot(struct weston_output *output,
   struct weston_buffer *buffer,
   weston_screenshooter_done_func_t done, void *data)
{
struct screenshooter_frame_listener *l;

if (!wl_shm_buffer_get(buffer->resource)) {
done(data, WESTON_SCREENSHOOTER_BAD_BUFFER);
return -1;
}

buffer->shm_buffer = wl_shm_buffer_get(buffer->resource);
buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer);
buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer);

if (buffer->width < output->current_mode->width ||
    buffer->height < output->current_mode->height) {
done(data, WESTON_SCREENSHOOTER_BAD_BUFFER);
return -1;
}

l = malloc(sizeof *l);
if (l == NULL) {
done(data, WESTON_SCREENSHOOTER_NO_MEMORY);
return -1;
}

l->buffer = buffer;
l->output = output;
l->done = done;
l->data = data;
l->listener.notify = screenshooter_frame_notify;
wl_signal_add(&output->frame_signal, &l->listener);
weston_output_disable_planes_incr(output);
weston_output_damage(output);

return 0;
}

 

아무튼 추적을 계속해보면 아래와 같이 event_loop에 wl_event_loop_add_idle() 실행해서 추가해주고 끝.

//git\libweston\compositor.c
static void
weston_schedule_surface_protection_update(struct weston_compositor *compositor)
{
struct content_protection *cp = compositor->content_protection;
struct wl_event_loop *loop;

if (!cp || cp->surface_protection_update)
return;
loop = wl_display_get_event_loop(compositor->wl_display);
cp->surface_protection_update = wl_event_loop_add_idle(loop,
       notify_surface_protection_change,
       compositor);
}

WL_EXPORT void
weston_output_disable_planes_incr(struct weston_output *output)
{
output->disable_planes++;
/*
 * If disable_planes changes from 0 to non-zero, it means some type of
 * recording of content has started, and therefore protection level of
 * the protected surfaces must be updated to avoid the recording of
 * the protected content.
 */
if (output->disable_planes == 1)
weston_schedule_surface_protection_update(output->compositor);
}

 

struct content_protection은 누가 만드나 하면서 따라가보니

weston_compositor_enable_content_protection() 함수에서 만들어 주고 해당 함수는

//git\libweston\content-protection.c
WL_EXPORT int
weston_compositor_enable_content_protection(struct weston_compositor *compositor)
{
struct content_protection *cp;

cp = zalloc(sizeof(*cp));
if (cp == NULL)
return -1;
cp->compositor = compositor;

compositor->content_protection = cp;
wl_list_init(&cp->protected_list);
if (wl_global_create(compositor->wl_display,
     &weston_content_protection_interface, 1, cp,
     bind_weston_content_protection) == NULL)
return -1;

cp->destroy_listener.notify = cp_destroy_listener;
wl_signal_add(&compositor->destroy_signal, &cp->destroy_listener);
cp->debug = weston_compositor_add_log_scope(compositor, "content-protection-debug",
    "debug-logs for content-protection",
    NULL, NULL, NULL);
return 0;
}

 

drm_backend_create() 시에 b->atomic_modeset 조건에 의해서 생성된다.

//git\libweston\backend-drm\drm.c
static struct drm_backend *
drm_backend_create(struct weston_compositor *compositor,
   struct weston_drm_backend_config *config)
{
if (b->atomic_modeset)
if (weston_compositor_enable_content_protection(compositor) < 0)
weston_log("Error: initializing content-protection "
   "support failed.\n");
}

 

 

이름이 비슷한건지 걸려나오는 다른 녀석.

//protocol\weston-screenshooter-client-protocol.h
#define WESTON_SCREENSHOOTER_SHOOT 0

static inline void
weston_screenshooter_shoot(struct weston_screenshooter *weston_screenshooter, struct wl_output *output, struct wl_buffer *buffer)
{
wl_proxy_marshal((struct wl_proxy *) weston_screenshooter,
 WESTON_SCREENSHOOTER_SHOOT, output, buffer);
}

 

 wl_proxy_marshall()은 또 멀까해서 따라가 보지만.. 답이 안나온다 -_ㅠ

//wayland-main\src\wayland-client.c
WL_EXPORT struct wl_proxy *
wl_proxy_marshal_array_constructor_versioned(struct wl_proxy *proxy,
     uint32_t opcode,
     union wl_argument *args,
     const struct wl_interface *interface,
     uint32_t version)
{
return wl_proxy_marshal_array_flags(proxy, opcode, interface, version, 0, args);
}

WL_EXPORT struct wl_proxy *
wl_proxy_marshal_array_constructor(struct wl_proxy *proxy,
   uint32_t opcode, union wl_argument *args,
   const struct wl_interface *interface)
{
return wl_proxy_marshal_array_constructor_versioned(proxy, opcode,
    args, interface,
    proxy->version);
}


WL_EXPORT void
wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
{
union wl_argument args[WL_CLOSURE_MAX_ARGS];
va_list ap;

va_start(ap, opcode);
wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature,
 args, WL_CLOSURE_MAX_ARGS, ap);
va_end(ap);

wl_proxy_marshal_array_constructor(proxy, opcode, args, NULL);
}

 

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
Posted by 구차니
프로그램 사용/wayland2022. 8. 16. 17:47

 

C Specification
void glReadPixels( GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid * data);
Parameters
x, y
Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.

width, height
Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.

[링크 : https://docs.gl/es3/glReadPixels]

 

static void
screenshooter_shoot(struct wl_client *client,
    struct wl_resource *resource,
    struct wl_resource *output_resource,
    struct wl_resource *buffer_resource)
{
struct wlsc_output *output = output_resource->data;
struct wl_buffer *buffer = buffer_resource->data;
if (!wl_buffer_is_shm(buffer))
return;
if (buffer->width < output->current->width ||
    buffer->height < output->current->height)
return;
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, output->current->width, output->current->height,
     GL_RGBA, GL_UNSIGNED_BYTE,
     wl_shm_buffer_get_data(buffer));
}

[링크 : https://chromium.googlesource.com/chromiumos/third_party/wayland-demos/+/refs/heads/stabilize/compositor/screenshooter.c]

 

You can't take screenshots with glReadPixels!

[링크 : https://stackoverflow.com/questions/37149068/glreadpixels-function-returning-error-1282-gl-invalid-operation]

[링크 : https://stackoverflow.com/questions/44634621/glreadpixels-with-screen-pixels]

 

대충 짰는데 안되는 듯..

$ cat gl_cap.c
#include <stdio.h>
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>

void main()
{
                GLubyte color[1024*768*4];
                glReadPixels(0,0, 1024, 768, GL_RGBA, GL_UNSIGNED_BYTE, &color);
//              printf("R:%d G:%d B:%d A:%d", color[0], color[1], color[2], color[3]);
for(int y =0 ; y<768;y++)
for(int x =0 ; x < 1024; x++)
                printf("%4d,%3d R:%d G:%d B:%d A:%d\n", x,y
                        ,color[y*1024+x+0]
                        ,color[y*1024+x+1]
                        ,color[y*1024+x+2]
                        ,color[y*1024+x+3]
                );
}

 

링크는 아래와 같이 해주면 되긴 한데...

 -lwayland-egl -lGLESv2

 

흐으으으음...

# head dump
   0,  0 R:0 G:0 B:0 A:0
   1,  0 R:0 G:0 B:0 A:0
   2,  0 R:0 G:0 B:0 A:0
   3,  0 R:0 G:0 B:0 A:0
   4,  0 R:0 G:0 B:0 A:0
   5,  0 R:0 G:0 B:0 A:0
   6,  0 R:0 G:0 B:0 A:0
   7,  0 R:0 G:0 B:0 A:0
   8,  0 R:0 G:0 B:0 A:0
   9,  0 R:0 G:0 B:0 A:0
# tail dump
1014,767 R:0 G:0 B:0 A:0
1015,767 R:0 G:0 B:0 A:0
1016,767 R:0 G:0 B:0 A:0
1017,767 R:0 G:0 B:0 A:0
1018,767 R:0 G:0 B:0 A:0
1019,767 R:0 G:0 B:0 A:0
1020,767 R:0 G:0 B:0 A:0
1021,767 R:0 G:0 B:0 A:0
1022,767 R:0 G:0 B:0 A:0
1023,767 R:0 G:0 B:0 A:0

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
Posted by 구차니
프로그램 사용/VNC2022. 8. 16. 15:02

에러별 디버그 메시지 출력 위치 추적중.

 

24/03/2021 11:06:09 rfbProcessClientNormalMessage: FixColourMapEntries unsupported
24/03/2021 11:06:09 Client 192.168.0.6 gone

[링크 : https://github.com/LibVNC/libvncserver/blob/master/libvncserver/rfbserver.c#L2270]

 

24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadAndDecode: read; Resource temporarily unavailable24/03/2021 10:55:30 hybiReadHeader: got frame without mask; ret=6
24/03/2021 10:55:30 hybiReadAndDecode: unhandled opcode 13, b0: 9d, b1: 41
24/03/2021 10:55:30 rfbProcessClientNormalMessage: read: Protocol error
24/03/2021 10:55:30 Client 192.168.0.6 gone

[링크 : https://github.com/LibVNC/libvncserver/blob/master/libvncserver/ws_decode.c#L374]

 

24/03/2021 11:09:19 Pixel format for client 192.168.0.6:
24/03/2021 11:09:19   87 bpp, depth 5, little endian
24/03/2021 11:09:19   true colour: max r 47360 g 20997 b 2, shift r 179 g 0 b 77
24/03/2021 11:09:19 rfbSetTranslateFunction: client bits per pixel not 8, 16 or 32
24/03/2021 11:09:19 Client 192.168.0.6 gone

[링크 : https://github.com/LibVNC/libvncserver/blob/master/libvncserver/translate.c#L261]

 

+

2022.08.17

rfbRunEventLoop() 에 인자를 TRUE를 주고(background 실행하도록)

main loop 에서 rfbProcessEvents() 을 통해서 처리하게 하다 보니(websocket 처리를 위해)

양쪽에서 fd를 읽어 가려하다보니 데이터가 정상적으로 가져가지지 않아 죽는 것으로 판명됨.

'프로그램 사용 > VNC' 카테고리의 다른 글

libvncserver 종료 절차  (0) 2022.11.01
libvncserver 로그인  (0) 2022.09.26
libvncserver websocket example  (0) 2022.08.12
libvncserver 마우스 이벤트  (0) 2022.02.25
libvncserver 사용예  (0) 2022.02.15
Posted by 구차니
프로그램 사용/VNC2022. 8. 12. 10:58

음.. libvncserver 라이브러리를 이용해서 간단하게 저 인자 하나 주고 만들면 되려나?

int main(int argc,char** argv)
{
  rfbScreenInfoPtr rfbScreen = rfbGetScreen(&argc,argv,maxx,maxy,8,3,bpp);
  if(!rfbScreen)
    return 1;
  rfbScreen->desktopName = "LibVNCServer Example";
  rfbScreen->frameBuffer = (char*)malloc(maxx*maxy*bpp);
  rfbScreen->alwaysShared = TRUE;
  rfbScreen->ptrAddEvent = doptr;
  rfbScreen->kbdAddEvent = dokey;
  rfbScreen->newClientHook = newclient;
  rfbScreen->httpDir = "../webclients";
  rfbScreen->httpEnableProxyConnect = TRUE;

  initBuffer((unsigned char*)rfbScreen->frameBuffer);
  rfbDrawString(rfbScreen,&radonFont,20,100,"Hello, World!",0xffffff);

  /* This call creates a mask and then a cursor: */
  /* rfbScreen->defaultCursor =
       rfbMakeXCursor(exampleCursorWidth,exampleCursorHeight,exampleCursor,0);
  */

  MakeRichCursor(rfbScreen);

  /* initialize the server */
  rfbInitServer(rfbScreen);

#ifndef BACKGROUND_LOOP_TEST
#ifdef USE_OWN_LOOP
  {
    int i;
    for(i=0;rfbIsActive(rfbScreen);i++) {
      fprintf(stderr,"%d\r",i);
      rfbProcessEvents(rfbScreen,100000);
    }
  }
#else
  /* this is the blocking event loop, i.e. it never returns */
  /* 40000 are the microseconds to wait on select(), i.e. 0.04 seconds */
  rfbRunEventLoop(rfbScreen,40000,FALSE);
#endif /* OWN LOOP */
#else
#if !defined(LIBVNCSERVER_HAVE_LIBPTHREAD) && !defined(LIBVNCSERVER_HAVE_WIN32THREADS)
#error "I need pthreads or win32 threads for that."
#endif
  /* catch Ctrl-C to set a flag for the main thread */
  signal(SIGINT, intHandler);
  /* this is the non-blocking event loop; a background thread is started */
  rfbRunEventLoop(rfbScreen,-1,TRUE);
  fprintf(stderr, "Running background loop...\n");
  /* now we could do some cool things like rendering in idle time */
  while (maintain_connection) {
      sleep(5); /* render(); */
  }
  fprintf(stderr, "\nShutting down...\n");
  rfbShutdownServer(rfbScreen, TRUE);
#endif /* BACKGROUND_LOOP */

  free(rfbScreen->frameBuffer);
  rfbScreenCleanup(rfbScreen);

  return(0);
}

[링크 :https://github.com/LibVNC/libvncserver/blob/master/examples/example.c]

[링크 : https://github.com/LibVNC/libvncserver]

 

+

먼가 되나 했더니 안되네..

일단은.. noVNC 에서는 ws://ip/websockify 라는 경로를 열려고 하는데

libvncserver.so 에서 해당 경로를 열어주는 부분이 없나...?

[링크 : https://github.com/novnc/websockify]

 

example은 libvncserver의 example/example.c 빌드해서 나온거

revind / revind.so / run / websockify 는 websockify 에서 나온거

libvncserver 와 noVNC와 websockify 의 조합으로 어찌 되긴 하는데..

~/libvncserver/webclients $ ls -al
total 64
drwxr-xr-x  4 pi pi  4096 Aug 12 11:44 .
drwxr-xr-x 16 pi pi  4096 Aug 12 11:03 ..
-rwxr-xr-x  1 pi pi 25372 Aug 12 11:02 example
-rw-r--r--  1 pi pi  1601 Aug 12 10:32 index.vnc
drwxr-xr-x 10 pi pi  4096 Aug 12 11:00 novnc
-rwxr-xr-x  1 pi pi   424 Aug 12 11:39 rebind
-rwxr-xr-x  1 pi pi  7508 Aug 12 11:39 rebind.so
-rwxr-xr-x  1 pi pi    78 Aug 12 11:39 run
drwxr-xr-x  3 pi pi  4096 Aug 12 11:28 websockify

 

인자는 아래와 같이 하고 실행!

$ ./run 5900 -- ./example

 

웹 브라우저에서 http://ip:5800 으로 접속하면 아래와 같이 뜨고

별다른 설정을 하지 않았다면 wss(websocket secure)를 안될테니 위에 "Click here to connect using noVNC"를 누른다.

 

약간의 시간을 기다리면(libvncserver의 웹 서버가 느린지 파일 전송이 좀 느리다)

아래와 같이 쨘~

 

 

+

한번 되더니 websockify 없이도 되네.. 머지?

 

 

+

runInBackground 의 값을 TRUE 로 해주면 웹 서버가 작동을 안한다 -_-

어떻게 해야 할까..

void rfbRunEventLoop ( rfbScreenInfoPtr  screenInfo,
long  usec,
rfbBool  runInBackground  
)

[링크 : http://libvncserver.sourceforge.net/doc/html/group__libvncserver__api.html#ga1f5f3116deec0ab6bb18208c2eb538e6]

 

+

2022.08.17

하하하 안되는게 당연한거 였... ㅠㅠ

static THREAD_ROUTINE_RETURN_TYPE
listenerRun(void *data)
{
    rfbScreenInfoPtr screen=(rfbScreenInfoPtr)data;
    int client_fd;
    struct sockaddr_storage peer;
    rfbClientPtr cl = NULL;
    socklen_t len;
    fd_set listen_fds;  /* temp file descriptor list for select() */

    /*
       Only checking socket state here and not using rfbIsActive()
       because: When rfbShutdownServer() is called by the client, it runs in
       the client-to-server thread's context, resulting in itself calling
       its own the pthread_join(), returning immediately, leaving the
       client-to-server thread to actually terminate _after_ the listener thread
       is terminated, leaving the client list still populated.
     */
    /* TODO: HTTP is not handled */
}

'프로그램 사용 > VNC' 카테고리의 다른 글

libvncserver 로그인  (0) 2022.09.26
libvncserver 접속 끊어짐 문제  (0) 2022.08.16
libvncserver 마우스 이벤트  (0) 2022.02.25
libvncserver 사용예  (0) 2022.02.15
rfb(remote framebuffer) protocol  (0) 2022.01.26
Posted by 구차니
프로그램 사용/uinput2022. 8. 11. 23:42

uinput 에서 절대값을 받기 위해서는 마우스가 아니라 터치로 인식을 시켜야 한다.

 

가장 도움을 받았던 문서가 오히려 함정 카드(?)였는데

1.7.4.2의 내용은 상대좌표를 이용하는 일반적인 마우스의 예라서

[링크 : https://www.kernel.org/doc/html/v4.12/input/uinput.html]

 

struct uinput_setup 구조체를 이용하고 있지만

struct uinput_setup {
struct input_id id;
char name[UINPUT_MAX_NAME_SIZE];
__u32 ff_effects_max;
};

[링크 : https://github.com/torvalds/linux/blob/master/include/uapi/linux/uinput.h]

 

터치패드의 경우(혹은 터치 스크린) 아래의 구조체 중 absmax, absmin 에  시작, 끝 좌표를 넣어 주어야 한다. 

ABS_CNT(64)가 왜 상당히 크게 잡혀있는지 모르겠지만

absmax[0] = WIDTH, absmax[1] = HEIGHT를 넣고 초기화 해주면 된다.

struct uinput_user_dev {
char name[UINPUT_MAX_NAME_SIZE];
struct input_id id;
__u32 ff_effects_max;
__s32 absmax[ABS_CNT];
__s32 absmin[ABS_CNT];
__s32 absfuzz[ABS_CNT];
__s32 absflat[ABS_CNT];
};

[링크 : https://elixir.bootlin.com/linux/v4.6/source/include/uapi/linux/uinput.h#L222]

 

VID와 PID 혹은 문자열이 영향을 주는진 모르겠다.

[링크 : https://github.com/bendahl/uinput/blob/master/touchpad.go#L172]

 

UI_DEV_SETUP을 ioctl을 이용하여 setup 하는게 아니라

/dev/uinput fd에 write() 함수로 써버리는 것이 EV_REL과의 차이라고 해야하나..?

void init_uinput_touchscreen()
{
    int ret = 0;
    struct uinput_user_dev usetup;
    int keys[] = {BTN_LEFT, BTN_RIGHT, BTN_TOUCH};

    int fd_touch = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
    printf("fd[%d]\n", fd_touch);

    //Custom key events init
    ioctl(fd_touch, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd_touch, UI_SET_KEYBIT, keys[i]);
    }

    //Mouse Pointer events init
    ret = ioctl(fd_touch, UI_SET_EVBIT, EV_ABS);
    printf("EV_ABS ret[%d]\n",ret);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_X);
    printf("ABS_X ret[%d]\n",ret);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_Y);
    printf("ABS_Y ret[%d]\n",ret);

    memset(&usetup, 0, sizeof(usetup));
    usetup.id.bustype = BUS_USB;
    usetup.id.vendor = 0x4711;
    usetup.id.product = 0x0817;
    strcpy(usetup.name, "TouchPad");
    usetup.absmax[0] = 1024;
    usetup.absmax[1] = 768;

    // ret = ioctl(fd_touch, UI_DEV_SETUP, &usetup);
    ret = write(fd_touch, &usetup, sizeof(struct uinput_user_dev));
    printf("UI_DEV_SETUP ret[%d]\n",ret);
    printf("sizeof %d\n",sizeof(struct uinput_user_dev));
    ret = ioctl(fd_touch, UI_DEV_CREATE);
    printf("UI_DEV_CREATE ret[%d]\n",ret);
}
Posted by 구차니
프로그램 사용/wayland2022. 8. 10. 16:41

 

sway와 wayfire 라는 녀석이 wlroot 기반의 compositor 인 듯.

 

일단~~은 sway 패키지를 설치하고

$ sudo apt install sway

[링크 : https://installati.one/ubuntu/21.04/sway/]


wayvnc 설치(ubuntu 22.04 LTS/x86)

$ sudo apt install wayvnc

 

로그아웃 후에 세션을 sway로 변경

[링크 : https://llandy3d.github.io/sway-on-ubuntu/]

[링크 : https://www.slant.co/topics/11023/versus/~sway_vs_wayfire_vs_weston]

 

"윈 + D" 누르고 terminal 친 후 방향키로 gnome-terminal 선택 + enter

혹은 "윈 + enter"

 

요건 심심해서 htop 실행. i7-3635QM 이긴 한데

sway와 wayvnc가 동일하게 1.3% 씩 먹는 상황. 이걸 낮다고 봐야하나 높다고 봐야하나..

[링크 : https://swaywm.org/]

[링크 : https://wiki.archlinux.org/title/Sway]

 

터미널에서 wayvnc 접속가능하도록 실행

$ wayvnc 0.0.0.0

 

 

+

sway 단축키

super - shift - space (타일/창 전환)
super - e (가로 / 세로 타일 배치 전환)
super - h (창 전환)
super - enter (터미널 열기)
super - d (프로그램 실행?)

 

+

로그아웃

방법을 못 찾아서, sway 프로세스 kill 하고 다시 로그인 함 -_-

'프로그램 사용 > wayland' 카테고리의 다른 글

weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
weston redraw 취소하기  (0) 2022.07.07
Posted by 구차니

22.07.10 에 릴리즈 되었는데 H.264 인코딩이 특징인 듯.

wayland도 힘을 못써서 조용히 사라질줄 알았는데, 조용히 부활하고 있었던 건가.. -_-

[링크 : https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/wayland-display-server/1333848-wayvnc-0-5-vnc-server-for-wlroots-based-wayland-compositors-released]

[링크 : https://github.com/any1/wayvnc/releases/tag/v0.5.0]

[링크 : https://github.com/any1/wayvnc]

 

 

그나저나 s390x는 먼가 해서 찾아봤더니 (s로 시작해서 스냅드래곤인가 싶었지만)

[링크 : https://packages.ubuntu.com/jammy/wayvnc]

 

1998년 단종된 IBM System/390 시리즈 인 것 같은데.. 이걸 아직도(?) 지원해주다니..

[링크 : https://en.wikipedia.org/wiki/IBM_System/390]

[링크 : https://en.wikipedia.org/wiki/Linux_on_IBM_Z#Hardware]

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
capture drm screen  (0) 2022.08.08
weston redraw 취소하기  (0) 2022.07.07
weston drm debug  (0) 2022.06.29
Posted by 구차니