https://www.miroch.ru/2017/01/17/linux-process-memory-layout/ proc pid maps 여기를 참조 했다. #include <stdio.h> #include <sys/mman.h> int main(int argc, char *argv[]) { char *ptr; int ret; ptr = (char *) mmap((void *) 0x10000, 512 * 1024, PROT_WRITE|PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); printf(“page size is %0x\n”,getpagesize()); printf(“ptr is %p\n”,ptr); sleep(10); /* all done with ‘p’, so give back the 512 KB mapping…… anonymous memory mapping, p308 계속 읽기


경제의 신과 함께 rss 다운로더 v2.
전에 경제의 신과 함께 rss 다운로더를 만들었다. https://now0930.pe.kr/wordpress/?p=3744 경제의 신과 함께 rss 다운로더. 여기에 이어서..이렇게 하면 plex가 idtag를 입력하는데, 파일 이름으로 입력한다. 불행히도 업로드 정보가 정확하지 않아 파일 이름만 보고는 도저히 언제 방송했는지 찾을 수 없다. 이 부분을 정리하기로 했다. ID3를 입력하면 plex가 앨범?을 정보를 업데이트하여 입력한다. pubDate를 입력하면 좋으나, 앨범이 너무 많이 분리된다. 하나…… 경제의 신과 함께 rss 다운로더 v2. 계속 읽기
inotify 예제
linux system programming, 283p 리눅스에 파일, 디렉토리를 감시하는 watch가 있다. 특정 경로를 설정하여 감시하여 적절한 이벤트를 작성할 수 있다. #include <sys/inotify.h> #include <stdlib.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #define BUF_LEN 128 //int inotify_init1 (int flags); void main(){ int fd; //file descritor int wd; //watch descriptor const char path[50]=”/home/now0930/test/ttt”; fd = inotify_init1 (0); if (fd…… inotify 예제 계속 읽기
신과 함께 rss
팟빵이 경제의 신과 함께를 호스팅하여 잘 듣고 있었다. 언젠가부터 rss로 표시되는 파일 경로를 숨겨버려 crontab으로 자동으로 받을 수 없었다. 한동안 듣지 못하다, 꼼수를 찾았다. http://pod.ssenhosting.com/rss/geesik02 여기에 팟빵이 호스팅하는 모든 파일이 있다. 여기에서 해당하는 채널을 잘라 받으면 쉽다. 나중에 주소를 바꿀 수도 있지만, 귀찮아서 굳이 그렇게 하지 않을까 한다. #!/bin/sh # # TEDTalks Downloader # #…… 신과 함께 rss 계속 읽기
mutex 예제
linux system programming, 238p. 두 시간 삽질했다. thread arg 를 포인터로 주는데 여러 개를 쓰려면 struct로 정의해서 써야 한댄다. 맞는지 틀린지.. #include <pthread.h> #include <stdio.h> #include <unistd.h> //arg를 여러 파라미터로 사용하기 위해, //구조체로 정의 //https://stackoverflow.com/questions/52812004/parameter-passing-multiple-values-using-void-pointer //여기 참조 //공유 자원. int sharedInt=0; //mutex 설정. static pthread_mutex_t the_mutex = PTHREAD_MUTEX_INITIALIZER; struct myStruct { //struct는 initilizer를 지원하지 않음.…… mutex 예제 계속 읽기