Тёмный

How to Write a Linux Daemon from Start to Finish! 

hoff._world
Подписаться 8 тыс.
Просмотров 86 тыс.
50% 1

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 365   
@dv_xl
@dv_xl 7 месяцев назад
Yo fontsize too small dawg
@hoff._world
@hoff._world 7 месяцев назад
Just use a magnifier application bro 🔍🔍
@2kadrenojunkie
@2kadrenojunkie 7 месяцев назад
use something other than a tiny ass phone screen to watch a c programming tutorial dawg
@NaN_000
@NaN_000 7 месяцев назад
Use magnifier dawg
@vaisakhkm783
@vaisakhkm783 7 месяцев назад
@@hoff._world i am using a magnifier.. but it cuts off your beautiful face....
@hoff._world
@hoff._world 7 месяцев назад
@@vaisakhkm783 😳😳😳
@mbakem
@mbakem 7 месяцев назад
You are patient and easy to follow. Please please…whatever you do…keep this style. You rock!!
@hoff._world
@hoff._world 7 месяцев назад
Appreciate it my friend will do
@ProBarokis
@ProBarokis 7 месяцев назад
why is tommy innit writing linux daemons
@hoff._world
@hoff._world 7 месяцев назад
Secret second channel my brother
@TheoParis
@TheoParis 7 месяцев назад
This was my exact reaction lmaoo
@M1szS
@M1szS 7 месяцев назад
My first thought
@stumbling
@stumbling 7 месяцев назад
tommy.init
@BillGallowglass
@BillGallowglass 7 месяцев назад
Tommy SystemD
@ahmedabuharthieh579
@ahmedabuharthieh579 7 месяцев назад
Great video. Perfect amount of being informative/educational without dragging your feet, and you come up with a practical piece of software by the end of it. Very well done, hope to see more from you!
@hoff._world
@hoff._world 7 месяцев назад
So glad to hear you liked it mate. Cheers!
@kathirvelgounder9673
@kathirvelgounder9673 7 месяцев назад
Better than most professors out there, very easy to follow and listen too!
@hoff._world
@hoff._world 7 месяцев назад
in 20 years I'll be one watch
@happygofishing
@happygofishing 7 месяцев назад
Probably the best C video Ive ever watched.
@c0d_0x16
@c0d_0x16 7 месяцев назад
This is so helpful, I've been learning system programming recently. I've wanting to write a battery demon, thanks to you, I now know where to start.
@hoff._world
@hoff._world 7 месяцев назад
How good, let me know how it goes!
@mozartmaia6333
@mozartmaia6333 4 месяца назад
I spent a few hours trying to solve the dependency problem that other people had in the comments. Apparently there are some dependencies that he uses in the video that other distros don't have by default. What I did was install these dependencies with "sudo apt-get install libgdk-pixbuf2.0-dev" and "sudo apt-get install libglib2.0-dev" and installed the libnotify dependency too, but I dont remember the command anymore. Then I ran the build command as follows: "gcc -Wall -pedantic -std=gnu99 -o build/rolexhound rolexhound.c $(pkg-config - -cflags gdk-pixbuf-2.0 libnotify) -lnotify". Also, I changed the $PKG_CONFIG_PATH environment variable, but I don't know if that helped in any way. It only worked like this on Ubuntu, I hope it works for you too!
@Albertux
@Albertux 7 месяцев назад
Glad to see young folks using a real operating system
@pentagrams2350
@pentagrams2350 7 месяцев назад
very well made video from such a small channel. i can see you growing drastically in the future
@hoff._world
@hoff._world 7 месяцев назад
It means a lot, appreciate it mate. I like your Uncle Iroh pfp
@CuriousCyclist
@CuriousCyclist 7 месяцев назад
Just discovered your channel. Really good stuff. (aside from the small font size)
@hoff._world
@hoff._world 7 месяцев назад
I'm guessing small font size might become a running joke here
@GabeSullice
@GabeSullice 7 месяцев назад
The kids are gonna be alright
@hoff._world
@hoff._world 7 месяцев назад
my generation aint ruined yet :D
@imagineabout4153
@imagineabout4153 7 месяцев назад
Will watch this tonight in bed, high as a kite! Keep it up :D
@hoff._world
@hoff._world 7 месяцев назад
A good way to watch it :D thanks!
@datadi
@datadi 7 месяцев назад
This was a cool video on daemons. I've been looking for good resources all morning and this was the best introduction to getting started with it all. Thanks for the video! :D
@Hellbending
@Hellbending 7 месяцев назад
This cunts a legend bro, keep up the work cuzzy. Showing your knowledge without going through at 100x speed and still having a sense of humour and normality about ya (Sorry for bad language, am from Australia is normal here hahahaha😂😂😂😂)
@hoff._world
@hoff._world 7 месяцев назад
Mate literally same dont worry about it ya dog. Cheers for your comment
@michaelscofield4524
@michaelscofield4524 7 месяцев назад
Great video man! About a month ago I wrote a daemon in Zig also using inotify, although just to be fancy and learn I decided to use io_uring instead of actively polling events.
@hoff._world
@hoff._world 7 месяцев назад
that's awesome bro Zig looks like a sweet lang just haven't had the time to learn it. How does io_uring work without polling? Does it emit signals, events or something your program can write handlers for?
@michaelscofield4524
@michaelscofield4524 7 месяцев назад
@@hoff._world You tell the kernel to do IO operations (read, write, readv, writev, etc...) and letting it do them when it has time and tell you when they're ready, making them asynchronous. In the end you only have to check if the "completion queue" has any items in it, if not, your application continues as normal. It's a little overkill for a little program like this but it was interesting getting to work with it.
@hoff._world
@hoff._world 7 месяцев назад
@@michaelscofield4524 sick thanks for sharing. In essence then you're doing a non-blocking check somewhere in your main loop and if that turns negative your daemon does other work until it's ready. Which is useful for bigger daemons for sure, especially if networking is involved where it could potentially talk to others as well (we might be doing that sometime :)
@ninesninesnines
@ninesninesnines 7 месяцев назад
bro is keeping up with the 10 new years resolutions
@hoff._world
@hoff._world 7 месяцев назад
Bro u know we arent gonna quit after the first three weeks :DDD
@hazmat86
@hazmat86 7 месяцев назад
Awesome video man. Learned a ton. You got another sub here. Love to see systems related C videos. Can't wait for more!
@hoff._world
@hoff._world 7 месяцев назад
Systems programming is one of the coolest things to me. Glad you think the same!
@p0xygen
@p0xygen 7 месяцев назад
Randomly had this on my RU-vid homepage and it's perfect! Love this video. Definitely going to try and write some cute little dogs that'll watch my clipboard for some magic later!
@hoff._world
@hoff._world 7 месяцев назад
Awesome glad to hear you've got some ideas :)
@johntully1414
@johntully1414 7 месяцев назад
once the file is written, the inotify_event watch descriptor is changed, so furthur access or "alterations" of the file won't be notified. also would be neat that if the file were moved, it would show the path it was moved to. btw nice video, the channel will blow up at this rate
@hoff._world
@hoff._world 7 месяцев назад
when I test it multiple modifications work fine, not sure what's going wrong for you. Thanks for your comment!
@ricardogodoy7337
@ricardogodoy7337 7 месяцев назад
it happens to me too, not sure why
@johntully1414
@johntully1414 7 месяцев назад
​@@hoff._world your code from pastebin has the same issue. mayb some platform dependency? im on arch6.7.3+dwm with dunst notify daemon. watch descriptor is being set to IN_MOVE_SELF rather than IN_MODIFY upon modification of the file. i guess when modifying the file it interprets it as "moving" the file, on my system.
@hoff._world
@hoff._world 7 месяцев назад
@@johntully1414I have actually noticed that if you use vim to edit it generates move events for some reason. Every other editor I've tested doesn't have the issue so no clue why
@johntully1414
@johntully1414 7 месяцев назад
@@hoff._world yupp, that was it. looks like the vim/neovim saving mechanism uses "swap" or "temporary" files, so when you're modifying the file in the text editor it writes to the temp file (like a buffer) rather than the original file. Then when you :w the file, it renames that temp file to the original filename.. hence generating move events.
@charlesmoscofian4137
@charlesmoscofian4137 7 месяцев назад
Dude, you just earned yourself another subscriber, nicely done! Keep it up.
@gronki1
@gronki1 7 месяцев назад
Nice channel, subscribed! But small remark, please next time make your font at least twice the size 🙂 cheers from Poland!
@hoff._world
@hoff._world 7 месяцев назад
Will do, thanks for your comment!
@eoussama
@eoussama 7 месяцев назад
Your style is very informative. Kudos!
@hoff._world
@hoff._world 7 месяцев назад
Glad to hear it!
@yurisousan
@yurisousan 6 месяцев назад
Starting my journey in tutorial series, after started watch the last tutorial and not understand anything 😂. It is me, not you. You explain very well and is funny, my problem is keep my mind in english and keep my focus on code 🤣 Let’s go!
@hoff._world
@hoff._world 6 месяцев назад
best of luck with it my guy I know they're quite the elephants to take on :D
@JustKatoh
@JustKatoh 7 месяцев назад
No one going to talk about how he is using Kate to write all this? People crying over why VsCode/Vim/Emacs are the best, meanwhile mans been chillin with Kate watching the world bun, Is he a psycho?
@hoff._world
@hoff._world 7 месяцев назад
Yep clinically diagnosed with Kate enjoyer disorder
@H3fAlUmP
@H3fAlUmP 7 месяцев назад
Nice vid, one thing tho. When writing in C be very careful with `str*` functions. `strlen` is not safe bcs with a string not null-terminated it accesses memory beyond the buffer. You could use strnlen, or better yet, strnlen_s. Nice vid regardless :) cheers
@hoff._world
@hoff._world 7 месяцев назад
You are right my friend. Considering we are grabbing the string from argv I am trusting the shell to get it right, but on any other user input that is the way to go :D
@Zeutomehr
@Zeutomehr 7 месяцев назад
glibc doesn't implement annex K functions as far as I'm aware
@kruruneiwyn2107
@kruruneiwyn2107 7 месяцев назад
@@Zeutomehr correct for like 99% of them I remember there is small number of exceptions but don't recall which
@preetishamballi6988
@preetishamballi6988 6 месяцев назад
You are running it as a regular shell process, can you please make a video on how to run it as actual daemon which can be controlled by systemctl command
@noah0822-sk4pk
@noah0822-sk4pk 7 месяцев назад
clear explanation. easy to follow. good intro video in general. thanks for posting this!!!
@model.citizen.ps3
@model.citizen.ps3 7 месяцев назад
hey thanx for the great video (subbed)! Been trying to get back into C ever since I was forced to adopt Java (OOP) to get thru my classes at uni (comp sci major) and this video was a great help. Looking forward to enjoying more of your content and seeing where you take this very cool channel 🙂 I do gotta say though... PLEASE make the font in your text editor bigger in future videos! It will make your content WAY easier to engage with going forward (especially for those of us who generally watch YT on a tv screen as opposed to a laptop screen). Anyways that's my only complaint tho - keep up the good work!
@hoff._world
@hoff._world 7 месяцев назад
don't stress bro font size will be bigger on the next one! Interesting point about the TV screen, hadn't thought about that before. Thanks for the comment!
@cnyegun
@cnyegun 7 месяцев назад
Just got recommended this channel today
@hoff._world
@hoff._world 7 месяцев назад
Thanks for tuning in my friend!
@martian0x80
@martian0x80 7 месяцев назад
Uses kate? Absolute chad, you earned my like. I love kate as a replacement for nvim/helix.
@hoff._world
@hoff._world 7 месяцев назад
kate is just too comfy
@anantuongcong
@anantuongcong 7 месяцев назад
the only problem is if you want a better tutorial vid u can change your font size to bigger bro. Appreciate your work bro. Keep up the good work
@hoff._world
@hoff._world 7 месяцев назад
u got it boss, thanks
@ThatGuyWithMuffins
@ThatGuyWithMuffins 4 месяца назад
Writing a daemon for a girl is unfathomable rizz
@hoff._world
@hoff._world 4 месяца назад
what can I say girls love guys who can speak multiple languages (Japanese, Spanish, C, python, C++, Javascript...)
@ivankevamo
@ivankevamo 7 месяцев назад
Thanks a lot! So glad I found out your channel. Keep it up, greetings from Brazil.
@hoff._world
@hoff._world 7 месяцев назад
thanks for hosting that CS major in rio
@rohitjacob803
@rohitjacob803 7 месяцев назад
This was a really good video. It would have been nice if you had included the part where the daemon detaches from the parent shell and runs in it's own session, and all the logs being written to a separate file. It would also be fun to see how to integrate the daemon with systemd and allow it to be started or stopped from there
@hoff._world
@hoff._world 7 месяцев назад
There have been a few requests for something like that. I may do a follow up in future :D
@underthemeow9478
@underthemeow9478 7 месяцев назад
super cool video! i wish you could show us your customized KDE
@hoff._world
@hoff._world 7 месяцев назад
Cheers for the video idea. Years and years ago I showed it off on r/unixporn but it may be time for an update :)
@benhetland576
@benhetland576 7 месяцев назад
31:00 Back in the days this was even how we could read directory entries on a *nix system, because as we know "everything is a file" and even a directory could be "open"-ed like one! A terrible non-portable way of doing it, and totally bound to the internal format of one specific file system. IIRC it probably was on a Venix machine I did this.
@hoff._world
@hoff._world 7 месяцев назад
It is one of the most powerful and yet most dangerous things about a UNIX system I would say hahaha
@benhetland576
@benhetland576 7 месяцев назад
Around 34:00 you might want to assure you read at least _(sizeof *watchEvent)_ bytes too, or else you risk accessing invalid buffer content that wasn't actually filled by _read._ It can be done by changing "bufferPointer < buffer+..." to something like "bufferPointer+(sizeof *watchEvent) < buffer+..." in the _for_ condition. Remember the _read_ system call may return less that you ask for, and even 0 bytes!
@hoff._world
@hoff._world 7 месяцев назад
True thanks for the note. I suppose the lesson to learn is that good programming requires trust issues :P
@Ozla102
@Ozla102 7 месяцев назад
Hello, after testing with "bufferPointer+(sizeof *watchEvent) < buffer+..." in the for condition, the inotify event is not detected at all. I think adding the actual size of the struct inotify_event could lead to skipping the loop.
@benhetland576
@benhetland576 7 месяцев назад
@@Ozla102 Yes, but that probably means you have read a few bytes from the file descriptor ("event queue"), but not yet the full size of a watchEvent. Did you check the actual value of that _readLength?_ Then we're also left with another challenge; how to handle whatever data is left in the buffer after the _for_ loop. (The _bufferPointer_ may even point beyond the end of the data read!) You cannot just discard it, because then all the subsequent reads will be out of sync with the event records, and it can be hard to get back in sync again. Probably just move it to the beginning of the buffer and let the _read_ append from there. This requires some adjustments to both the max count to read and the returned _readLength_ though. Some mgmt related to the variable length of the records too, so a bit of things to get right there, unfortunately!
@bigl9527
@bigl9527 7 месяцев назад
Your cam is in the way of the terminal. I suggest to pipe your webcam output to MPV so that it show in your screen and you can move it around like a normal window.
@hoff._world
@hoff._world 7 месяцев назад
Yep I noticed that after recording... Rookie error by me not being aware of where it is sometimes. Thanks for the suggestion I'll have a look.
@bigl9527
@bigl9527 7 месяцев назад
@@hoff._world glad to help
@pedrogabrielnogueira1068
@pedrogabrielnogueira1068 7 месяцев назад
I like this. Pretty cool :v Edit: I'm a scholar in a research group and watchdog sounded familiar. Maybe youtube recommended this to me because of it. IDK. But anyway, thanks. Now ik what a watchdog is :v
@OhCynicalHD
@OhCynicalHD 7 месяцев назад
Any good books or tutorials on this? I have a python and JavaScript background and will eventually be taking computer science classes. Wanted to learn C. I know the basics of assembly x86. I was having a hard time really understanding what’s going on with the API
@hoff._world
@hoff._world 7 месяцев назад
ill do some kinda vid on it
@scumpascumpa
@scumpascumpa 7 месяцев назад
10:45 - One quick thing, I'm not sure if you've mainly done a lot of programming in C++ or something but, in C it's redundant to cast the return value of malloc (or its derivatives). C is very loose about its types and all pointers are really just the same type (void*) when interacting with one another.
@hoff._world
@hoff._world 7 месяцев назад
I just prefer to do it so I explicitly always know what I'm dealing with, more of a 'best practice' then for any functional reason.
@dr-Jonas-Birch
@dr-Jonas-Birch 3 месяца назад
This is my Internet, get your own.
@masoom-theproudvegan7212
@masoom-theproudvegan7212 27 дней назад
hahaha , got you
@dr-Jonas-Birch
@dr-Jonas-Birch 24 дня назад
@@masoom-theproudvegan7212 :)
@mrinalyadav4261
@mrinalyadav4261 24 дня назад
hello dr.
@dr-Jonas-Birch
@dr-Jonas-Birch 24 дня назад
@@mrinalyadav4261 Hi there
@kianureeves2519
@kianureeves2519 7 месяцев назад
not watching yet, but commenting to boost the algorithm. I'll give this a try in a bit!
@hoff._world
@hoff._world 7 месяцев назад
whatever you did worked mate thanks a million :)
@remek712
@remek712 7 месяцев назад
How to handle pressure in Scrum Sprints as a developer
7 месяцев назад
This guy writes code in Kate. Subscribed.
@hoff._world
@hoff._world 7 месяцев назад
When anyone talks shit about it I just say "Let me guess, you need more?"
@soup4632
@soup4632 7 месяцев назад
damn. only watched first five minutes and already got agitated and intrigued. will watch this for sure. like your delivery. any chance you have discord channel or smth? you seem like a great guy to talk with
@hoff._world
@hoff._world 7 месяцев назад
Hey thanks! Might make a discord server if the channel grows and there's interest
@DUDE_mutagen
@DUDE_mutagen 7 месяцев назад
KEEP POSTING THESE, VIDEOS LIKE THESE THAT ACTUALLY EXPLAINs ARE KINO
@hoff._world
@hoff._world 7 месяцев назад
Thanks dude appreciate it, will keep it real
@Andrii-zc4dp
@Andrii-zc4dp 7 месяцев назад
Amazing, I already know all this, and I use arch btw, but, still a nice thing to watch in background! Respect for not using VSCode, but I wish you used Vim
@ivymuncher
@ivymuncher 7 месяцев назад
are we seriously still doing this editor war shit 😭
@hoff._world
@hoff._world 7 месяцев назад
Yeah I use vim on the CLI but with this syscall API vim wanted to generate file move events which was really weird, that still works correctly for the intent of seeing if someone edited ur file ig but nano generated the events one would expect so I used that for the demo.
@8Trails50
@8Trails50 7 месяцев назад
this video is insanely goated
@MrRufus302
@MrRufus302 11 часов назад
@hoff._world: at 38.53 minutes into the video, you do something based on the command _make_ not producing the output you were looking for; what did you do/type to correct the issue? I cannot proceed any further, because there is no online information that deals with essentially, what the unknown issue is. UPDATE: I have completed the tutorial and it works well, except for the`dialog-information` box. I completed the program on an Android mobile phone IDE; the issue is Java. I do not know how to implement the Java `AlertDialog` box for Android devices; all examples I have seen are very complicated to understand (as I don’t know Java) and difficult to implement. Any chance of some assistance with this issue?
@deadsi
@deadsi 7 месяцев назад
Dear Linux Daemon, [your message] Sincerely yours, [your name] Saved you 50 minutes
@hoff._world
@hoff._world 7 месяцев назад
Funnily enough im gonna do a video talking about how daemons can talk to each other over the network..... they will be doing exactly this :PP
@deonmarais3375
@deonmarais3375 7 месяцев назад
Thanks, useful video. To get it to build correctly I needed to change the order of the gcc command line in Makefile. ``` CFLAGS= -Wall -pedantic -std=gnu99 all: rolexhound rolexhound: gcc $(CFLAGS) rolexhound.c -o rolexhoundd `pkg-config --cflags --libs libnotify` ```
@woliveiraxs
@woliveiraxs 7 месяцев назад
Pretty good man :) Thanks for the nice and well exaplained tutorial :)
@hoff._world
@hoff._world 7 месяцев назад
dont sweat it!
@RobSwindell
@RobSwindell 7 месяцев назад
12:04 use strrchr(argv[1], '/'); to find the pointer to the last slash instead of a strtok() loop.
@benhetland576
@benhetland576 7 месяцев назад
As long as you remember to ignore any trailing slashes first.
@lassebq1
@lassebq1 7 месяцев назад
Hey, you can also use glib's gio component for file monitoring. glib is included with almost any linux system since it's a gtk dependency (and as you know gtk apps are very common)
@hoff._world
@hoff._world 7 месяцев назад
True, and with this daemon if you have libnotify you also have GTK. Good note!
@andjankowski
@andjankowski 7 месяцев назад
You are doing great job, keep it up!
@Alrighty-Then
@Alrighty-Then 5 месяцев назад
11:33 holy jump scare
@Wakizu
@Wakizu 7 месяцев назад
utube algo in work, recommended your awesome vdo
@ishangrover1453
@ishangrover1453 7 месяцев назад
Why did you not make a service file and load the binary of program in the service file and then start with systemctl
@hoff._world
@hoff._world 7 месяцев назад
because the video was 50 minutes long 😬
@pines6110
@pines6110 7 месяцев назад
Wouldn't mind it being 1:20 if it tells me everything @@hoff._world
@ChrispyChris3
@ChrispyChris3 7 месяцев назад
I'm a bit curious about the daemon you said you wrote for your girl. What did it even do? Does she run a Linux machine then?
@hoff._world
@hoff._world 7 месяцев назад
My girl at the time, ex-girl now :P It was a simple Python web-scraping daemon that sent her a notification when a very niche store (no email notifs) had some piece of clothing she wanted back in stock. She ran Manjaro for around 4 yrs but recently swapped it back to Win when it had some issues.
@redhawk3385
@redhawk3385 5 месяцев назад
based kate editor
@hoff._world
@hoff._world 5 месяцев назад
kate chads rise up from the ashes of the vim vs emacs war
@TooShyForTea
@TooShyForTea 4 месяца назад
Kate is a great notepad alternative. I use nvim for coding but kate is nice for one offs and pair programming.
@hoff._world
@hoff._world 4 месяца назад
@ihavenoenem1es it's light and responsive while having the features I want (split view, inbuilt term, LSP client, etc) vs. vscode which feels slow. Also integrates nicely with my DE which is plasma since kate is a KDE editor
@briandepazdiaz
@briandepazdiaz 7 месяцев назад
i love this content! thank u for blessing us
@hoff._world
@hoff._world 7 месяцев назад
bless u
@alwin5995
@alwin5995 7 месяцев назад
Insane man. I am a big fan of native development in Rust. Would be awesome if you have videos on it too.
@hoff._world
@hoff._world 7 месяцев назад
unfortunately rust is not among my repertoire, more of a C and Golang enjoyer. I have heard very good things about it though, may learn in future!
@Nitant-qz3ie
@Nitant-qz3ie 4 месяца назад
just needed a help , libnotify and glib gives no file found even after i included from source directory of my system of nixos
@illfyouup
@illfyouup 7 месяцев назад
Programming in C scratches an itch no other programming language does
@hoff._world
@hoff._world 7 месяцев назад
to me it is like you are having a one-to-one chat with the CPU
@bimmy4664
@bimmy4664 7 месяцев назад
@@hoff._world assembly language allows you to pretty much directly manipulate the CPU and all its registers. C obfuscates a lot of that to make it more human-readable.
@hoff._world
@hoff._world 7 месяцев назад
@@bimmy4664 yes, if you think about it the entire field of computer science is about smart abstraction
@mailoisback
@mailoisback 7 месяцев назад
Great channel, deserves more subs.
@hoff._world
@hoff._world 7 месяцев назад
Er well it certainly did that the last day and a bit. Thanks!
@mrinalyadav4261
@mrinalyadav4261 24 дня назад
This video was grt, i also want to learn all these stuff, any advise from where can i learn these low level stuff? i cant find any system engineering playist on youtube
@mikereynolds1368
@mikereynolds1368 7 месяцев назад
Defo enjoyed this. Good on ya!
@hoff._world
@hoff._world 7 месяцев назад
Thanks mate appreciate it!
@Blueeeeeee
@Blueeeeeee 7 месяцев назад
Thumbs up just for the thumbnail x)
@jamesdavis914
@jamesdavis914 7 месяцев назад
TY for live coding C!
@hoff._world
@hoff._world 7 месяцев назад
if u liked this video ur gonna have a fun weekend keep an eye out
@skeleton_craftGaming
@skeleton_craftGaming 7 месяцев назад
A lot of the cstdlib is implemented via syscall in unix like systems...
@gizmotruveauth20
@gizmotruveauth20 7 месяцев назад
enlarge the font please in your further videos for better visibility. thx
@hoff._world
@hoff._world 7 месяцев назад
Thanks for your feedback. Will do!
@sanctuary_of_soul
@sanctuary_of_soul 7 месяцев назад
Can somebody help with implementing this watchdog on MacOs? I tried to find libraries, there seems to be a fswatch, but i actually do not know how to properly perform linking. I would really appreciate if somebody had me pushed in some direction here. Thank you very much! Tutorial is great!
@user-xb2kq8qx9j
@user-xb2kq8qx9j 7 месяцев назад
Can this be cross platform with compiler as an enabler ? Asking from title .
@hoff._world
@hoff._world 7 месяцев назад
nope, we use linux-only system calls in this one
@aryantirkey1744
@aryantirkey1744 7 месяцев назад
Great got me interested planing on making my own
@hoff._world
@hoff._world 7 месяцев назад
Glad to hear it write back with what you come up with!
@uzumakiuchiha7678
@uzumakiuchiha7678 Месяц назад
THIS. IS. COOL. TEACH. ME. PLEASE. I AM A CAVEMAN
@PeterKilian
@PeterKilian 7 месяцев назад
Dude we’re like the same age but you’ve gotten further than me in c.. and I started programming 6 months ago :( Im slow lol Also BROO WANNA SURF YOU DOGGY 👊 🤣 Love from 🇿🇦 SA
@hoff._world
@hoff._world 7 месяцев назад
Don't sweat it dude I've been programming for a lot longer than 6 months, that's actually a pretty short amount of time when it comes to getting good at this stuff. Yeah man tell me which beach u wanna hit up and I'll be there sunrise
@PeterKilian
@PeterKilian 7 месяцев назад
@@hoff._world one day bro 🤣
@ferasalfarsi897
@ferasalfarsi897 7 месяцев назад
Can you please zoom in when you are typing the code, so we can read it.
@dauda-dev5554
@dauda-dev5554 7 месяцев назад
how to set up the daemon to os startup would be nice to see to all this. thanks for video.
@CJ1337HF
@CJ1337HF 7 месяцев назад
Fairly easy via systemd. Just a small config file
@hoff._world
@hoff._world 7 месяцев назад
@CJ1337HF this is true, however if the daemon is started before your desktop env this can cause issues initialising with libnotify. May have to do some playing around, or it might just work, idk hahaha
@CJ1337HF
@CJ1337HF 7 месяцев назад
@@hoff._world you can solve thus easily by setting the target correctly
@paxdriver
@paxdriver 7 месяцев назад
People at my school didn't even know html, never mind Linux system daemons lol too cool for school 👍
@hoff._world
@hoff._world 7 месяцев назад
You'll be the 'hacker kid' in school
@paxdriver
@paxdriver 7 месяцев назад
@@hoff._world lol i'd be Billy Madison ;p
@vojoslav
@vojoslav 7 месяцев назад
great video! i was thinking, wouldn't an enum be easier for the error codes?
@hoff._world
@hoff._world 7 месяцев назад
Yeah you totally could. One of the things I love about programming is there are so many different ways to do the same thing :D
@imrank340
@imrank340 7 месяцев назад
I must notify you allocated memory but failed to release the memory using free(), at the end.
@hoff._world
@hoff._world 7 месяцев назад
mentioned in another comment that because this daemon runs forever the OS will release it when it is killed; there is only one allocation so it will never grow. You could implement a signaling method to the main loop to free the memory before the daemon exits but that would be way too complex for this vid, and pointless because it is about to exit where the kernel will just do it.
@LBCreateSpace
@LBCreateSpace 5 месяцев назад
Thanks for making this! :D
@okuno54
@okuno54 7 месяцев назад
Bro really be coming up to Tony Hoare - rocking variable declarations at the top of his functions like it's the ANSI C days (as if the flexible array members aren't from C99) - telling him that his billion dollar mistake is fine actually and that the legend himself has a skill issue XD fr tho, nullability is useful, that's why you got `Option`, so you get it only where you need it, oh and it's useful for more than just pointers
@hoff._world
@hoff._world 7 месяцев назад
yeah my friend I'm young and arrogant ofc I know better than Tony :P
@filintodelgado
@filintodelgado 7 месяцев назад
You could have used `char *basename(char *path)` to get the basename from the path
@hoff._world
@hoff._world 7 месяцев назад
That is true, and equivalents exist in almost all langs. However string tokenisation is a very common thing in programming in general so I thought it would be good to go over it using this as an example :)
@filintodelgado
@filintodelgado 7 месяцев назад
@@hoff._world you did the right choice as I have never heard of it and now I know. Might be useful someday
@sunk3rn
@sunk3rn 7 месяцев назад
great tutorial, subbed
@AlexMartin-vi4eq
@AlexMartin-vi4eq 7 месяцев назад
How have you customized Kate to suggest library functions?
@hoff._world
@hoff._world 7 месяцев назад
Kate supports configuring LSP Clients. You can do it in the settings menu.
@TheWizard45134
@TheWizard45134 7 месяцев назад
No way! I actually understood the thing. This is epic! Dont be yoo silly btw
@hoff._world
@hoff._world 7 месяцев назад
Thanks. I'll try not to be too silly but I'm just such a funny little character aren't I
@thomas-sinkala
@thomas-sinkala 5 месяцев назад
Earned a subscriber.
@ge0x1
@ge0x1 7 месяцев назад
Bro please do an advance C course, i love the way you're explaining things. Do you have any courses on udemy?
@hoff._world
@hoff._world 7 месяцев назад
nah im not a grifter, shit will be up for free dont stress bruv
@thats-no-moon
@thats-no-moon 7 месяцев назад
@@hoff._world right on. font still too small :-D
@hoff._world
@hoff._world 7 месяцев назад
@thats-no-moon that's the catch, it's free but u pay with ur eyesight
@biigsmokee
@biigsmokee 7 месяцев назад
​@@hoff._worldwhat a legend i know this has some security implications, is there now a way around this to hide your program from inode calls? or is this bulletproof
@sahithvibudhi7471
@sahithvibudhi7471 7 месяцев назад
Great video! Subscribed
@hoff._world
@hoff._world 7 месяцев назад
Legend mate thanks!
@bartek...
@bartek... 7 месяцев назад
Letter's to small to watch it from the bed, lucky for me today I'll sleep on the desk 🍻 Cool code and walk true!!! Is really solid. What's the prep/improvise ratio? I love to learn C... I should start with it when I've know nothing, now it's harder. What's worry me, why all of it have a perfect sense for me? I don't understand that!!! I just seen artifacts of it in so many places of my os.
@hoff._world
@hoff._world 7 месяцев назад
Hey thanks for the comment! As mentioned I did write up the program beforehand, took maybe 20-30 minutes? It is quite a basic program; whatever I improvised in the video would come out roughly the same as what I wrote beforehand. I don't film with scripts, at best I have a text file with some dot points which just feels more natural to me. Tbh I think I'm still a bit robotic in places so trying to work on it. C as a language is nice to learn because you can really start to think like a computer. Higher level languages abstract a lot of things away from you, so when you program in C it's like you're having a conversation with the CPU :)
@bartek...
@bartek... 7 месяцев назад
@@hoff._world you do have a good presentation skills, this is something I'm trying to stress myself a bit more. Half scripted? You are good natural. Keep it this way. C... I know... I'm just lazy fuck, sticked with those languages that are doing for us every stupid mistake... and BTW most of new CLI apps do not provide man 🫨 they are 12 fucks apps and forgetting about first one. fuck!!!! RTFM
@mikereynolds1368
@mikereynolds1368 7 месяцев назад
​@@hoff._world tbh it did not have a robotic feel to me. It all felt pretty natural.
@hoff._world
@hoff._world 7 месяцев назад
@mikereynolds1368 cheers Mike that's good to hear
@FainTMako
@FainTMako 7 месяцев назад
Would have been badass if by end of video he looked omega stressed and had a wizards beard.
@hoff._world
@hoff._world 7 месяцев назад
I do, but internally, internally
@goonman1255
@goonman1255 7 месяцев назад
Great video mate
@hoff._world
@hoff._world 7 месяцев назад
Cheers goon man
@illegalsmirf
@illegalsmirf 7 месяцев назад
You're a clever young man!
@maritimers4sure
@maritimers4sure 6 месяцев назад
Excellent. Thanks.
@bulverismo
@bulverismo 7 месяцев назад
thanks, really cool
@noferblatz
@noferblatz 7 месяцев назад
Here's a tip: increase your screen font size. It's impossible to see your code.
@hoff._world
@hoff._world 7 месяцев назад
That's how I stop people from finding out I'm a complete fraud
@Hedg111
@Hedg111 2 месяца назад
Nice, but it is not lunux daemon serice accrding to documentation
Далее
THREADS - Program in Parallel!
28:17
Просмотров 2,1 тыс.
Nix explained from the ground up
23:39
Просмотров 16 тыс.
Какой звук фальшивый?
00:32
Просмотров 184 тыс.
Why Linux is better for (most) developers!
14:59
Просмотров 475 тыс.
How to Actually Start a Software Project!
27:45
Просмотров 7 тыс.
Become a shell wizard in ~12 mins
12:25
Просмотров 248 тыс.
The Unreasonable Effectiveness of Linux Workstations
12:47
So, I Tried Arch Linux.. (and Hyprland btw)
36:10
Просмотров 101 тыс.
WHY IS THE HEAP SO SLOW?
17:53
Просмотров 223 тыс.
Making Simple Graphical Linux Distro from Scratch
17:19
grep: A Practical Guide
13:55
Просмотров 73 тыс.