stage 상태의 소스에 대해서 unstage 하지 않고 diff 하는 방법

 

[링크 : https://frhyme.github.io/git/git_diff_staged/]

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

git reset 서버 commit  (0) 2021.09.14
git blame  (0) 2021.06.21
git pull rebase 설정  (0) 2021.06.02
git log --stat  (0) 2021.05.10
git stash  (0) 2021.05.09
Posted by 구차니

댓글을 달아 주세요

 

 

select current_timestamp(3)

[링크 : https://stackoverflow.com/questions/9624284/current-timestamp-in-milliseconds]

 

NOW([precision])
CURRENT_TIMESTAMP
CURRENT_TIMESTAMP([precision])
LOCALTIME, LOCALTIME([precision])
LOCALTIMESTAMP
LOCALTIMESTAMP([precision])

[링크 : https://mariadb.com/kb/en/now/]

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

mariadb 초기설정  (0) 2022.08.30
mariadb c# connector  (0) 2021.10.22
HeidiSQL  (2) 2021.08.18
sql zerofill  (0) 2019.11.25
mysql-dump compatible 함정 -_-  (0) 2019.09.04
Posted by 구차니

댓글을 달아 주세요

프로그램 사용/rtl-sdr2022. 8. 30. 18:16

 

SDRangel can decode multiple broadcast FM channels simultaneously

[링크 : https://www.reddit.com/r/RTLSDR/comments/ql1jpe/problem_rtl_sdr_recording_multiple_fm_channel/]

 

SDRangel is an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.

[링크 : https://github.com/f4exb/sdrangel]

[링크 : https://github.com/f4exb/sdrangelcli]

 

[링크 : https://github.com/szpajder/RTLSDR-Airband]

[링크 : https://github.com/pvachon/tsl-sdr]

  [링크 : https://www.rtl-sdr.com/a-multichannel-fm-demodulator/]

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

ubuntu 18.04에 사운드 카드가 갑자기 사라졌다?  (0) 2022.07.20
RTL-SDR 11시 땡!  (0) 2022.01.07
gqrx 오디오 스트리밍  (0) 2022.01.07
rpi gqrx  (0) 2022.01.07
rtl sdr am  (0) 2022.01.07
Posted by 구차니

댓글을 달아 주세요

어쩐지(?) 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 msec 단위 시간 얻기  (0) 2022.08.31
mariadb c# connector  (0) 2021.10.22
HeidiSQL  (2) 2021.08.18
sql zerofill  (0) 2019.11.25
mysql-dump compatible 함정 -_-  (0) 2019.09.04
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 로그 저장하기  (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 screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
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 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
capture drm screen  (0) 2022.08.08
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 websocket example  (0) 2022.08.12
libvncserver 마우스 이벤트  (0) 2022.02.25
libvncserver 사용예  (0) 2022.02.15
rfb(remote framebuffer) protocol  (0) 2022.01.26
gconf-editor / ubuntu 14.04 LTS vino + VNC 접속불가  (0) 2015.03.22
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 */
}
Posted by 구차니

댓글을 달아 주세요