홈페이지 인덱스는 함부로 바꾸는게 아닙니다. 방문자수 복구가 안되는구나.. ㅠㅠ

같은 기간을 비교 한건데, 본 홈페이지 방문자수가 -86% 입니다.

이때 무슨 일이 있었냐 하면, 지금은 홈페이지의 글들이 아래처럼 숫자로 연결되어 있습니다.

https://flywithu.com/archives/7830

이 전에는 archives/홈페이지 이런식으로 글의 주소가 제목이었습니다.

제목으로 google등의 search engine 과 연결되어 있었고, 많은 방문이 이를 통해 이루어 졌는데, 인덱스를 숫자로 바꾸면서 와장창 링크가 다 깨지면서 방문자도 급감 했습니다.

기존 링크가 자동연결되게 해 놓고 바꾸었어야 했는데, 아무생각 없이 진행을 했었네요. 그 이후로 아직 수개월이 지나도록 복구가 안되고 있습니다.

글의 인덱스 링크를 바꾸기 전에 꼭 한번 기존 링크를 어떻게 할것인가 고려가 필요 합니다.

Azure AI computer Vision in Golang: ChatGPT Intergration Guide

English follows Korean

얼마전에 사진 정리 도구를 Piwigo에서 PhotoPrism으로 변경했습니다. Piwigo는 매우 좋은 어플리케이션이지만, PhotoPrism의 현대적인 느낌과 AI를 이용한 사진 분류기능이 매력적입니다. PhotoPrism은 Golang으로 개발되어 있으며, REST API를 통해 다양한 프로그래밍 언어로 활용할 수 있습니다. (Browse Your Life in Pictures – PhotoPrism). 그러나 여러 예시가 Golang이라 그것을 활용해 보았습니다. Golang은 처음이로 ChatGPT를 이용해서 Library와 Sample을 만들었습니다.

AzureAI를 사용해 태그를 추가하고, Piwigo의 사진을 PhotoPrism에 업로드 하는 것이 골이 었고, AzureAI를 사용한 이유는 일정범위(개인용으로 충분한)에서 무료 사용기 가능하다는 점입니다.

  1. Azure AI 서비스 생성
  2. 샘플코드
    • 샘플코드 실행결과
    • 024/05/01 20:19:08 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:08 Download File
      2024/05/01 20:19:09 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:09 Image Tagging
      *적절한 테그 제안

      Tag: outdoor (Confidence: 0.99)
      Tag: building (Confidence: 0.99)
      Tag: sky (Confidence: 0.98)

      2024/05/01 20:19:13 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:13 Image Description
      Description Tag: building
      Description Tag: outdoor
      Caption: an ancient city with many ruins with Colosseum in the background (Confidence: 0.34)
      2024/05/01 20:19:14 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:14 Object Detection
      Object: kitchen appliance (Confidence: 0.50)
      Object: computer keyboard (Confidence: 0.51)
      Object: Laptop (Confidence: 0.85)
      Parent Object: computer (Confidence: 0.85)
      2024/05/01 20:19:15 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:15 Landmark Analysis
      Category: {building_ 0.83203125 0xc0001f79b0}
      *사물인식

      Landmark: Eiffel Tower

      ======================== Brand

      2024/05/01 20:19:16 Analyze - Brands
      *Brand인식

      Brand : [{HP 0.603 {569 586 77 71}}]
      Brand Tag: {person 0.987419068813324}
      Brand Tag: {clothing 0.9757296442985535}
      Brand Tag: {sky 0.9699560403823853}
  • 샘플 이미지 – 이미지의 HP 로고를 인식 합니다.
  • 라이브러리는 여기에(flywithu/azure-golang (github.com)) 있습니다. Code 역시 해당 사이트를 참고해도 되고, 아래를 참고 해도 됩니다.
  • Library 환경 설정
  • go mod init azure-golang
    go mod tidy
    export VISION_KEY="YOURKEY"
    go run
  • 실행 코드
package main

import (
	"github.com/flywithu/azure-golang"
	"fmt"
	"log"
	"os"
	"net/http"
	"io"

)

func main() {
	VISION_ENDPOINT := "https://flywithufreevision.cognitiveservices.azure.com"
	VISION_KEY := os.Getenv("VISION_KEY")

	filePath:="temp.jpg"
	// URLs for image analysis
	landmarkImageURL := "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-sample-data-files/master/ComputerVision/Images/landmark.jpg"
	kitchenImageURL := "https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/images/windows-kitchen.jpg"
	eiffelTowerImageURL := "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Eiffel_Tower_20051010.jpg/1023px-Eiffel_Tower_20051010.jpg"
	redShirtLogoImageURL := "https://publish-p47754-e237306.adobeaemcloud.com/adobe/dynamicmedia/deliver/dm-aid--08fdf594-c963-43c8-b686-d4ba06727971/noticia_madridistas_hp.app.png?preferwebp=true&width=1440"

	client := vision.ComputerVisionClient(VISION_ENDPOINT, VISION_KEY)

	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")
	log.Println("Download File")
	resp, err := http.Get(landmarkImageURL)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	out, err := os.Create(filePath)
	if err != nil {
		panic(err)
	}
	defer out.Close()

	_, err = io.Copy(out, resp.Body)
	if err != nil {
		panic(err)
	}



	// Tagging an image
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")

	log.Println("Image Tagging")
	tags, err := client.GetImageTags(filePath)
	if err != nil {
		log.Fatalf("Failed to get image tags: %v", err)
	}
	for i, tag := range tags.Tags {
		if i >= 3 { break }
		fmt.Printf("Tag: %s (Confidence: %.2f)\n", tag.Name, tag.Confidence)
	}

	// Describing an image
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")

	log.Println("Image Description")
	description, err := client.GetImageDesc(filePath)
	if err != nil {
		log.Fatalf("Failed to get image description: %v", err)
	}
	for i, tag := range description.Description.Tags {
		if i >= 3 { break }
		fmt.Printf("Description Tag: %s\n", tag)
	}
	for i, caption := range description.Description.Captions {
		if i >= 3 { break }
		fmt.Printf("Caption: %s (Confidence: %.2f)\n", caption.Text, caption.Confidence)
	}

	// Object Detection
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")
	log.Println("Object Detection")
	objects, err := client.GetImageObject(kitchenImageURL)
	if err != nil {
		log.Fatalf("Failed to detect objects: %v", err)
	}
	for i, obj := range objects.Objects {
		if i >= 3 { break }
		fmt.Printf("Object: %s (Confidence: %.2f)\n", obj.ObjectInfo.ObjectName, obj.ObjectInfo.Confidence)
		if obj.Parent != nil {
			fmt.Printf("Parent Object: %s (Confidence: %.2f)\n", obj.Parent.ObjectName, obj.Parent.Confidence)
		}
	}

	// Analyzing image for landmarks
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")

	log.Println("Landmark Analysis")
	landmarks, err := client.GetImageAnalyze(eiffelTowerImageURL)
	if err != nil {
		fmt.Printf("Failed to analyze landmarks: %v", err)
	}
	for i, cat := range landmarks.Categories {
		if i >= 3 { break }
		fmt.Printf("Category: %v\n", cat)
		if cat.Detail != nil && len(cat.Detail.Landmarks) > 0 {
			fmt.Printf("Landmark: %v\n", cat.Detail.Landmarks[0].Name)
		}
	}

	// Analyzing brands
	log.Println("Analyze - Brands")
	brands, err := client.GetImageAnalyze(redShirtLogoImageURL)
	if err != nil {
		fmt.Printf("Failed to analyze brands: %v", err)
	}
	fmt.Printf("Brand : %v \n",brands.Brands)
	for i, tag := range brands.Tags {
		if i >= 3 { break }
		fmt.Printf("Brand Tag: %v \n", tag)
	}
}

I recently switched my photo organization tool from Piwigo to PhotoPrism. While Piwigo is a very good application, I found PhotoPrism’s modern UI and AI-powered photo capabilities appealing. PhotoPrism is developed in Golang and can be utilized with various languages through its REST API. However, since many examples are in Golang, I decided to use that. As it was my first time using Golang, I wrote libraries and samples with ChatGPT guidance.

Adding tags with Azure AI and uploading photos to PhotoPrims was the goal, and the reason for using Azure AI is that it offers free usage, which is sufficient for personal use.

  1. Creating Azure AI Service
  2. Sample code
    • Execution Result
    • 024/05/01 20:19:08 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:08 Download File
      2024/05/01 20:19:09 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:09 Image Tagging
      *
      Suggested Tags
      Tag: outdoor (Confidence: 0.99)
      Tag: building (Confidence: 0.99)
      Tag: sky (Confidence: 0.98)

      2024/05/01 20:19:13 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:13 Image Description
      Description Tag: building
      Description Tag: outdoor
      Caption: an ancient city with many ruins with Colosseum in the background (Confidence: 0.34)
      2024/05/01 20:19:14 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:14 Object Detection
      Object: kitchen appliance (Confidence: 0.50)
      Object: computer keyboard (Confidence: 0.51)
      Object: Laptop (Confidence: 0.85)
      Parent Object: computer (Confidence: 0.85)
      2024/05/01 20:19:15 ++++++++++++++++++++++++++++++++++++++++++++++++
      2024/05/01 20:19:15 Landmark Analysis
      Category: {building_ 0.83203125 0xc0001f79b0}
      *
      Recognized the landmark
      Landmark: Eiffel Tower

      ======================== Brand

      2024/05/01 20:19:16 Analyze - Brands
      *
      Recognized the Brand
      Brand : [{HP 0.603 {569 586 77 71}}]
      Brand Tag: {person 0.987419068813324}
      Brand Tag: {clothing 0.9757296442985535}
      Brand Tag: {sky 0.9699560403823853}
  • Sample Image – Recognized the HP logo in the image.
  • The library and code can be found here(flywithu/azure-golang (github.com) , or refer to the following.
  • Setting the Library environment
  • go mod init azure-golang
    go mod tidy
    export VISION_KEY="YOURKEY"
    go run
  • Golang code
package main

import (
	"github.com/flywithu/azure-golang"
	"fmt"
	"log"
	"os"
	"net/http"
	"io"

)

func main() {
	VISION_ENDPOINT := "https://flywithufreevision.cognitiveservices.azure.com"
	VISION_KEY := os.Getenv("VISION_KEY")

	filePath:="temp.jpg"
	// URLs for image analysis
	landmarkImageURL := "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-sample-data-files/master/ComputerVision/Images/landmark.jpg"
	kitchenImageURL := "https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/images/windows-kitchen.jpg"
	eiffelTowerImageURL := "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Eiffel_Tower_20051010.jpg/1023px-Eiffel_Tower_20051010.jpg"
	redShirtLogoImageURL := "https://publish-p47754-e237306.adobeaemcloud.com/adobe/dynamicmedia/deliver/dm-aid--08fdf594-c963-43c8-b686-d4ba06727971/noticia_madridistas_hp.app.png?preferwebp=true&width=1440"

	client := vision.ComputerVisionClient(VISION_ENDPOINT, VISION_KEY)

	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")
	log.Println("Download File")
	resp, err := http.Get(landmarkImageURL)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	out, err := os.Create(filePath)
	if err != nil {
		panic(err)
	}
	defer out.Close()

	_, err = io.Copy(out, resp.Body)
	if err != nil {
		panic(err)
	}



	// Tagging an image
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")

	log.Println("Image Tagging")
	tags, err := client.GetImageTags(filePath)
	if err != nil {
		log.Fatalf("Failed to get image tags: %v", err)
	}
	for i, tag := range tags.Tags {
		if i >= 3 { break }
		fmt.Printf("Tag: %s (Confidence: %.2f)\n", tag.Name, tag.Confidence)
	}

	// Describing an image
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")

	log.Println("Image Description")
	description, err := client.GetImageDesc(filePath)
	if err != nil {
		log.Fatalf("Failed to get image description: %v", err)
	}
	for i, tag := range description.Description.Tags {
		if i >= 3 { break }
		fmt.Printf("Description Tag: %s\n", tag)
	}
	for i, caption := range description.Description.Captions {
		if i >= 3 { break }
		fmt.Printf("Caption: %s (Confidence: %.2f)\n", caption.Text, caption.Confidence)
	}

	// Object Detection
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")
	log.Println("Object Detection")
	objects, err := client.GetImageObject(kitchenImageURL)
	if err != nil {
		log.Fatalf("Failed to detect objects: %v", err)
	}
	for i, obj := range objects.Objects {
		if i >= 3 { break }
		fmt.Printf("Object: %s (Confidence: %.2f)\n", obj.ObjectInfo.ObjectName, obj.ObjectInfo.Confidence)
		if obj.Parent != nil {
			fmt.Printf("Parent Object: %s (Confidence: %.2f)\n", obj.Parent.ObjectName, obj.Parent.Confidence)
		}
	}

	// Analyzing image for landmarks
	log.Println("++++++++++++++++++++++++++++++++++++++++++++++++")

	log.Println("Landmark Analysis")
	landmarks, err := client.GetImageAnalyze(eiffelTowerImageURL)
	if err != nil {
		fmt.Printf("Failed to analyze landmarks: %v", err)
	}
	for i, cat := range landmarks.Categories {
		if i >= 3 { break }
		fmt.Printf("Category: %v\n", cat)
		if cat.Detail != nil && len(cat.Detail.Landmarks) > 0 {
			fmt.Printf("Landmark: %v\n", cat.Detail.Landmarks[0].Name)
		}
	}

	// Analyzing brands
	log.Println("Analyze - Brands")
	brands, err := client.GetImageAnalyze(redShirtLogoImageURL)
	if err != nil {
		fmt.Printf("Failed to analyze brands: %v", err)
	}
	fmt.Printf("Brand : %v \n",brands.Brands)
	for i, tag := range brands.Tags {
		if i >= 3 { break }
		fmt.Printf("Brand Tag: %v \n", tag)
	}
}

PoC – DRM video Dump from Coupang Play

English follows Korean

  1. 동기
  2. DRM 이란 무엇인가?
    • DRM은 ‘Digital Reights Management’의 약자로, 디지털 콘텐츠가 무단으로 복제 되거나, 배포되는 것을 방지 하는 기술입니다. 콘텐츠가 암호화 되어 있으며, 적법한 사용자만이 해당 콘텐츠를 볼수 있는 키를 받게 됩니다.
    • https://source.android.com/docs/core/media/drm?hl=ko
    • https://developers.google.com/widevine/drm/overview
  3. Clearkey와 Widevine
    • Clearkey는 간단하고 비용 효율적인 DRM으로, 주로 보안 요구사항이 낮은 콘텐츠에 적용됩니다. 반면 Google에서 개발한 Widevine은 훨씬 높은 보안을 제공합니다. Widevine은 세가지 보안 수준(L1,L2,L3)를 가지며, 이는 HW와 SW사용 여부에 달라집니다. L1과 L2는 HW를 사용하여 보안을 강화하지만, L3는 소프트웨어만을 사용하고 보통 480p해상도 까지 지원 합니다.
  4. Coupang Play의DRM
    • 현재 OTT는 Netflix, Disney, Tving, CoupangPlay, youtube 를 구독 중입니다. 최근 Coupang Play가 가격인상을 하였기에, 향후에도 계속 사용할지 모르겠습니다. 그래서 권한이 있을때 확인 해보고자 했습니다.
  5. Coupang Play 앱 간단 확인- 쿠팡플레이 – Google Play 앱
    • 지난번 경험으로 앱의 리버싱은 지양 했습니다.
    • Apache License 라이브러리가 사용 되었습니다. 다른 앱들처럼 아래와 같은 정보를 쉽게 찾아야 하는데, 이 앱에서는 못 찾았습니다.
    • http://newrelic.com 과 http://braze.com 으로 뭔가를 보냅니다. 내가 하는 것도 모니터링 되려나.. 그래서 비디오를 다운로드 후에, Network를 다 끊고 PoC확인후에 Network 연결전에 다 삭제 했습니다.
  1. PoC환경 : 기존글 참고 – : AOSP11 이라 충분히 최신 버젼이고 arm도 지원가능해서 coupang play가 사용 가능합니다. – Building an AAOS emulator with GPS generator, GApps and built-in x86/ARM support

Coupang Play가 Widevine 방식인것을 알고 Widevine 에 대해서 좀 찾아 보았습니다.. L3는 과거에 한번 풀렸던거 같고, 현재는 보완이 된 것 같으나, 여전히 인터넷에서는 L3는 풀어 주는 앱이 있는것 같습니다. Reversing the old Widevine Content Decryption Module · tomer8007/widevine-l3-decryptor Wiki (github.com)

그냥 Clearykey 방식이나 실험 해보려고 한거고, Widevine은 할수 있는 영역은 아니라 중단하려다가 Video 덤프나 가능한지 확인 해보는 것으로 방향을 바꾸었습니다.

위 그림은 Widevine 구조도 이고, 우하단의 OEMCryto HAL이 widevine이 복호화후에 이것을 Media Out으로 보내줍니다.

MediaCodec  |  Android Developers

위그림은 코덱의 동작입니다. 복호화 데이터는 코덱 디코더로 가서 화면에 뿌려줍니다. 그래서 암호화는 내가 못 풀어도, 저 Input을 저장하면 복호화 데이터를 얻을수 있을것 같았습니다.

Codec 부분을 살펴 보고 나니 아래 부분을 동작하게 Define을 해주니깐..

https://android.googlesource.com/platform/frameworks/av/+/refs/heads/main/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp#572

이런 파일들을 얻을수 있습니다. 그리고 그냥 이 파일을 다운받아서 동작을 시키면…

Windows의 KMplayer 에서 그냥 영상이 나옵니다.

DRM 및 관련 자료를 찾는 사전 준비대비, 코덱 코드에 이미 DUMP 준비가 다 되어 있고, Define만 살렸더니 실험해보려던거가 한번에 되어서 좀 허망함이 있었습니다.

그러나 이번에 DRM의 구조 이해와 미디어쪽을 알게 되었습니다. 이론적으로는 FakeCodec과 같은 사용자 정의 코덱을 만들면 DRM 보호 데이터를 덤프 할수 있음을 확인 했습니다.

DRM으로 보호된 것을 사적 복사를 넘어선 제 3자에게 공유하는 것은 금지되어 있습니다. 그리고 다른 ID로 덤프해서 비교해보면 확실하겠지만, 아마 워터마크가 있을 것이고 이를 통한 추적도 가능 할것 입니다. 이러한 워터마크의 제거를 하려면 인코딩과 디코딩을 반복해서 해야 하고, 그러면 화질 저하가 발생하기 때문에 이것도 방법은 아닙니다..

English

  1. Motivation
  2. What is the DRM?
    • DRM stands for ‘Digital Rights Management’ , a technology designed to prevent unauthrozied copying and distribution of digital content. And only authorized users recevied the key to access it.
    • https://source.android.com/docs/core/media/drm?hl=ko
    • https://developers.google.com/widevine/drm/overview
  3. Clearkey vs. Widevine
    • Clearkey is a simple and cost efficient DRM solution, used for content with low security requirments. On the other hand, Widevine, developed by Google, offers much higher security. Widevine has three levels of security(L1,L2,L3) that depend on whether HW or SW is used. L1 and L2 enhances security by HW, L3 uses only SW and typically supports up to 480p resolution.
  4. Coupang Play with DRM
    • With the recent price increase at Coupang Play, I’m unsure if I’ll continue my subscription. Therefore I hope to thoroughly invetigate the service while I sill have access.
  5. Coupang Play prelim check – 쿠팡플레이 – Google Play 앱
    • Due to previous experience, I avoid using reverse engineering.
    • Apache license is used. But unlike other apps, I can’t easily find information regarding it in this app.
    • Some infomation is provied to http://newrelic.com and http://braze.com. Because of this, I proceeded with the network disconnected.
  1. PoC Environment: Refer previous article. – Building an AAOS emulator with GPS generator, GApps and built-in x86/ARM support

I’ve studied about Widevine because Coupang Play used it. L3 was cracked in the past, and there appears to still be an app available on the internet that can crack L3. Reversing the old Widevine Content Decryption Module · tomer8007/widevine-l3-decryptor Wiki (github.com)

Initially, I intened to experiment only with the ClearKey method. as studying Widevine seemd too challenging. However, rather than giving up, I decied to shift my focus to chekcing if video dumping was possible.

This is the Widevine architecture and lower-right HAL, known s OEMCrypto HAL, decrypts the data and tranfers it to Media Out.

MediaCodec  |  Android Developers

This is the codec architecture. The decrypted data is decoded by the codec and then displayed on screen. I may not be able to decrypt Widevine, I colud intercept and save the input to obtain the decrypted data.

After examing the codec section , I modified the following part to make it operational .

https://android.googlesource.com/platform/frameworks/av/+/refs/heads/main/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp#572

I can obtain these files. Then download and run them.

It plays on Windows KMPlayer.

I spend a long time studying DRM and gathering related materials. But simply enabling the ‘define’ was enough.

I’m not sure but there might be a WaterMark for tracking the content. So don’t share the content with others.

PyTorch nvcc(CPP) vs. Python Running Time Comparision.

English follows Korean. 이번 포스트는 MNIST 데이터셋입니다. MNIST는 머신러닝과 컴퓨터 비전 분야에서 'Hello world'와 같은 존재 입니다. 이처럼 광범위하게 사용되는 만큼, 다양한 예제와 구현 방법이 널리 알려져 있습니다. 최근에 CPP로 된 MNIST를 돌려 보다가, 기존 python 보다 훨씬 빠른거 같은 느낌이 들어서 실제적인 시간을 측정해 보았습니다. 사실 python 은 GIL, 싱글쓰레드, 인터프리터, 동적 타이핑등의 이유로…

Read more

Building an AAOS emulator with GPS generator, GApps and built-in x86/ARM support

이제야 이것을 올립니다. . 사실, 이전부터 올리려고 했는데 여러 이유로 지연이 되었습니다. 현 상태에서 마무리를 하고 올리려고 합니다. AAOS(Android Automotive OS) Emulator 이고, GPS 위치가 수도권 순환도로 판교, 중동을 왕복 하도록 설정 되어 있습니다. 시작 했던 이유는, 이전에 tmap을 OEM GPS(apple pie - ApplePie Carplay Android Ai Box Apple pie Car Smart Box) 가 가능하게…

Read more

ipTIME 공유기로 두 지역·세 지역 사무실을 하나의 네트워크로 연결하기 (WireGuard, 2026 업데이트)

ipTIME 공유기만으로 여러 지역을 하나의 네트워크로 묶는 방법. WireGuard 서버·클라이언트, 클라이언트 사용 관리 라우팅, 허브 앤 스포크 3대 구성, L2TP 대비 5~6배 빠른 속도 실측.

Read more

wordpress에서 라이브러리와 블로그 링크

wordpress로 블로그를 올리고 미디어 파일을 올립니다. 그런데 미디어파일을 별도로 올리거나 하는 경우 아래와 같이 미디어 파일과 블로그의 글의 링크가 깨지는 경우가 있습니다. 아래의 스크립트를 돌리면 이러한 글들을 미디어파일과 블로그 글을 링크로 연결 해줍니다. # -*- encoding:utf8 -*- from curses.ascii import isdigit from select import select from turtle import Screen, isvisible import requests import random from…

Read more

wordpress에서 미사용 미디어 라이브러리 삭제

최근 몇일동안 사이트 사용에 문제가 있었습니다. 예를들어 댓글이 작성이 안되는 문제였습니다. 그 이유는 웹호스팅 디스크 Full 때문이었습니다. 그동안 중복해서 올린 media 라이브러리가 많았는데, 사용하지 않는 미디어파일을 삭제 하는 노트북 파일 입니다. 파일명으로만 검색하기 때문에, 동일한 파일명으로 사용중일때는 있는 것으로 판단합니다. 즉 좀 더 보수적으로 판단 됩니다. 정확하게는 경로명까지 봐서 판단해야 하는데, 이거는 다음에 올린 다음…

Read more

GPT to WordPress 파이썬 코드

https://flywithu.com/gpt-%ec%82%ac%ec%9a%a9-%ed%9b%84%ea%b8%b0/ 이글에서 언급된 파이썬 코드 입니다. 개발 환경은 Kaggle 서버 입니다. (www.kaggle.com) 여기의 장점은 스케줄링이 되서, 매일 한번씩 코드가 자동 실행 됩니다. 그것도 무료로!스케줄링 설정은 아래와 작성한 파이썬에 대해서 설정해줍니다. 그러면 UTC 0 (9:00AM KST)에 실행이 됩니다. 사실 코드가 별로 길지도 않아서.. 먼저 OpenAI의 API Key를 가져 옵니다. (https://platform.openai.com/account/api-keys) 그리고 wordpress의 Key도 가져 옵니다. https://github.com/metaqsol/card/blob/main/gpt-to-wordpress.ipynb…

Read more

GPT 사용 후기

아무말 대잔치로 GPT를 통해서 Post를 해보았습니다. 몇번의 시행착오를 겪었는데, 처음에는 네이버 기사를 가져와서 글을 쓰게 했는데.. 정말 정말 아무말 대잔치.GPT는 2021년까지 밖에 모르니, 최신 뉴스를 가져와서 글을 쓰게 하니. 그래서 그 다음으로 한거는 이미 알고 있고, 그리고 재미도 있을만한 옛날 이야기를 작성하게 했습니다. https://flywithu.com/category/chatgpt/아래와 같이 글을 작성해주는데, GPT도 알고 있던 시대이니, 본문도 맞지 않을까 싶습니다.…

Read more