Fish in the river

Techology
C#

c# access dify api

Dify is a AI tool.It can build some application ealily. when you create a application in dify, you can access it use dify api. the next is access dify api C# source code. using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Text.Json; using System.Threading.Tasks; namespace TranslateTool.Repository; public class TranslateApi { private string _url = "< The url that App build in >"; public async Task<string?> Translate(string orignText) { using (var client=new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "< App Api key>"); var requestBody = new { inputs = new { }, query = orignText, response_mode = "blocking", conversation_id = "", user = "abc-123" }; var json = JsonSerializer.Serialize(requestBody); var content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await client.PostAsync(_url, content); response.EnsureSuccessStatusCode(); var responseJson = await response.Content.ReadAsStringAsync(); using (var doc=JsonDocument.Parse(responseJson)) { if (doc.RootElement.TryGetProperty("answer", out var answer)) { return answer.GetString(); } else { return null; } } } } }  

2026年2月2日 0comments 18hotness 0likes joey Read all
运维技术

Install openTap

After Opentap update,Opentap editor community version is offline. Instead of it is Opentap editor.when install the opentap editor,must register to keysight website and active community version. and when you use the software ,run any test plan,the software will automatic to connect keysight website to verify or collection your information.It is unfriendly when you have not internet connection when you used in the factory line. After a period of exploration,i find the older community version. so i record it follow. 1. install dotnet9.0 runtime 2. install OpenTap9.31.1 3. set the PC dns to 127.0.0.1 (Import,other wise, you will wait long long time ) 4. unzip PackageCache.zip and copy the unzip files to "C:\Users\<Your PC longin name>\AppData\Local\OpenTap\PackageCache".if the "OpenTap\PackageCache" directory is not exist.you can enter the directory that opentap software installed directory,and run "tap package list" command. the directory will create automatic. 5. run the command "tap package install "Editor CE" 6. enjoy it. the file in step 4 , please download it from https://wwbeh.lanzouu.com/iQSry3hl02va  

2026年2月2日 0comments 17hotness 0likes joey Read all
生活感悟

秋天的黄昏

城里是没有黄昏的。街道的灯,早早亮起来,生生把黄昏给吞了。 乡下的黄昏,却是辽阔的,博大的。它在旷野上坐着;它在人家的房屋顶上坐着;它在鸟的翅膀上坐着;它在人的肩上坐着;它在树上、花上、草上坐着,直到夜来叩门。而一年四季中,又数秋天的黄昏,最为安详与丰满。 选一处河堤,坐下吧。河堤上,是大片欲黄未黄的草。它们是有眼睛的,它们的眼睛,是麦秸色的,散发出可亲的光。它们淹在一片夕照的金粉里,相依相偎,相互安抚。这是草的暮年,慈祥得如老人一样。你把手伸过去,它们摩挲着你的掌心,一下,一下,轻轻地。像多年前,亲爱的老祖母。你疲惫奔波的心,突然止息。 从河堤往下看,能看到大片的田野。这个时候,庄稼收割了,繁华落尽,田野陷入令人不可思议的沉寂中。你很想知道田野在想什么,得到与失去,热闹与寥落,这巨大的落差,该如何均衡?田野不说话,它安静在它的安静里。岁月枯荣,此消彼长,焉有得?焉有失?不远处,种子们正整装待发,新的一轮蓬勃,将在土地上重新衍生。 还有晚开的棉花呢。星星点点的白,点缀在褐色的棉枝上,这是秋天最后的花朵。捡拾棉花的手,不用那么急了。女人抬头看看天,低头看看花,这会儿,她终于可以做到从容不迫,稻谷都进了仓,农活不那么紧了。她细细捡拾棉花,一朵一朵的白,落入她手里。黄昏下,她的剪影,就像一幅画。 你的眼睛,久久落在那些白上面,你想起童年,想起棉袄、棉鞋和棉被。大朵大朵的白,摊在屋门前的篾席上晒。你在里面打滚儿,你是驾着白云朵的鸟。玩着玩着,会睡着了,睡出一身汗来,棉花太暖和了啊。 最开心的事是,冬夜的灯下,母亲把积下的棉花搬出来,在灯下捻去里面的籽儿。你也跟在后面捻,知道有新棉鞋新棉袄可穿,心先温暖起来。那时,你的世界就那么大,那时,一个世界的幸福,都可以被棉花填得满满的。 人生因简单因单纯,更容易得到快乐。你有些惆怅,因为,现在的你,离简单离单纯,越来越远了。 竟然还见到老黄牛。不多见了啊。人和牛,都老了。他们在河堤上,慢慢走。身上披着黄昏的影子。人的嘴里哼着呦喝呦喝歌声单调,却闪闪发光。牛低着头,不知是在倾听,还是在沉思。你想,到底牛是人的伙伴,还是人是牛的伙伴?相依为命,应该是尘世间最不可或缺的一种情感吧。 鸟叫声在村庄那边,密密稠稠,是归巢前互道晚安呢。村庄在田野尽头,一排排,被黄昏镀上一层绚丽的橙色,像披了锦。炊烟升起来了,你家的,我家的,在空中热烈相拥,久久缠绵。还是村庄好,总是你中有我,我中有你。不设防。 突然听得有母亲的声音在叫:小雨,快回家吃晚饭啦。你忍不住笑,原来不管哪个年代,都有贪玩的孩子。 周遭的色彩,渐渐变浓变深。身下的土地,渐渐凉了,你也该走了。再贪恋地望一眼这秋天的夕阳,它一圈一圈小下去,小下去,像一只红透的西红柿,可以摘下来,炒了吃。

2025年12月28日 0comments 53hotness 0likes joey Read all
Linux

install xfce4 and xrdp in the debian vps

Some times we need desktop environment instead of ssh. So i record how to install xfcd and xrdp here. this document demo in the Debian 12. 1. update system apt update apt upgrade 2.install xfce desktop environment apt install xfce4 xfce4-goodies 3.install xrdp service apt install xrdp 4.check xrdp if installed successful systemctl status xrdp 5.add xrdp user into ssl-cert group adduser xrdp ssl-cert 6.restart xrdp systemctl restart xrdp 7.config firewall allow 3389 ufw allow 3389 8. connect vps use windows remote desktop connection mstc 9.please wait a moment when the mouse display , because sometime it is slowly. 10. install firefox apt update apt upgrade apt install snapd snap install core snap install firefox 11. restart vps 12.open firefox from the system menu.  

2025年11月25日 0comments 74hotness 0likes joey Read all
Linux

login unbunt VPS by key-based

one day ,when i login to my ubuntu vps. i found my vps server login two session one time by follow command. ss -tnp | grep sshd then ,i realize that my server has been hacked. so , i decide to do somthing to protect my server. the first thing is to configuremy server to use   key-based ssh login instead of  login with a username  and password method. first, i generate the ssh key using the follow command. ssh-keygen -t ed25519 -C "joey@itech.sh" if you use the default settings to answer the previous question. two files will be generated in the following directory. ~/.ssh/id_ed25519 ←  (private key) ~/.ssh/id_ed25519.pub ←  (public key) and then ,what i  need to do is upload he publick key to my server.so i use the following command to accomplish this. ssh-copy-id root@memos.ifish.blog in the above command , root@memos.ifish.blog is the vps server domain and username.after the command complete ,the public key will be uploaded in the vps's root directory once you finish the ablove steps. i can login my vps server now. but if i want to use putty to login to  my server. i need to convert the private key to a format that putty can read . this process  is simple.so i won't want explain here.

2025年10月20日 0comments 239hotness 0likes joey Read all
Linux

capture the network package used by tcpdump

In linux you can capture the network package used by tcpdump sudo install tcpdmp,if you use debian .you can install it with  apt install tcpdump 2. capture the newtork package used next command ,the network_interface_name can find by ip command. sudo tcpdump -i netwrok_interface_name -w capture_name.pcap 3. download the capture_name.pcap and opened it with wireshark.  

2025年10月9日 0comments 113hotness 0likes joey Read all
Windows

change windows 2016 stand evaluation to stand

After National Day, two server that install windows server 2016 will shut down every two hours. first,i doubt that the tempurate is too high so the server shut down itself to protect it.so i open the air conditioner. but it is shut down like i don't open the air conditioner. so i check the system log through system event viewer. in the system event viewer.i find the realy reason. the server shutdown because windows 2016 server is evalution version and it is out of date. so it shut down every a period of time. so i need to change it to stand version. the follow step is how to resolve it. open the command line , need administrator privileges. Run the next command DISM /online /Get-CurrentEdition DISM /online /Set-Edition:ServerStandard /ProductKey:WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY /AcceptEula when the command run complete . after restart it .the version will change to stand. then you can active the windows 2016 server too otherwise the evaluation version can not active.

2025年10月9日 0comments 133hotness 0likes joey Read all
生活感悟

十月份了

转眼间,十月份就到了。 将原来股票清仓了。 买了基金了。 希望一切顺利!

2025年10月9日 0comments 116hotness 0likes joey Read all
Windows

Install vmtools on windows7 in vmware workstation

when i installed windows 7 in wmware workstation which running in the windows 11. i find i can't install vmtools.because the install vmare tools menu is gray. after i try,the next is the fix step. remove the flopy driver in the vmware workstation hardware config. after step 1, you will find the install vmtools menu is enabled. but when i installing  the vmtools in the windows7. it will occour some error so install vmware tools fail. then , you must install a update for this bug. follow is the update link  https://catalog.update.microsoft.com/search.aspx?q=kb4474419 after install the update .reboot the virtual windows 7. then install vmware tools. it is all right.  

2025年9月9日 0comments 202hotness 0likes joey Read all
生活感悟

my son leave home to school

Today my son leave home to school. from today , he will sleep in the school from monday to friday. this is he first sleep in the school. i hope all is ok. thank for every wishs.  

2025年9月4日 0comments 148hotness 0likes joey Read all
12345…8

近期文章

  • c# access dify api
  • Install openTap
  • 秋天的黄昏
  • install xfce4 and xrdp in the debian vps
  • login unbunt VPS by key-based

近期评论

No comments to show.

COPYRIGHT © 2024 水中小鱼. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang