How to Write a Linux Daemon from Start to Finish!

Sdílet
Vložit
  • čas přidán 9. 09. 2024

Komentáře • 364

  • @dv_xl
    @dv_xl Před 7 měsíci +150

    Yo fontsize too small dawg

    • @hoff._world
      @hoff._world  Před 7 měsíci +64

      Just use a magnifier application bro 🔍🔍

    • @2kadrenojunkie
      @2kadrenojunkie Před 7 měsíci +31

      use something other than a tiny ass phone screen to watch a c programming tutorial dawg

    • @NaN_000
      @NaN_000 Před 7 měsíci +1

      Use magnifier dawg

    • @vaisakhkm783
      @vaisakhkm783 Před 7 měsíci +13

      @@hoff._world i am using a magnifier..
      but it cuts off your beautiful face....

    • @hoff._world
      @hoff._world  Před 7 měsíci +5

      @@vaisakhkm783 😳😳😳

  • @ProBarokis
    @ProBarokis Před 7 měsíci +304

    why is tommy innit writing linux daemons

  • @mbakem
    @mbakem Před 7 měsíci +19

    You are patient and easy to follow. Please please…whatever you do…keep this style. You rock!!

    • @hoff._world
      @hoff._world  Před 7 měsíci +5

      Appreciate it my friend will do

  • @ahmedabuharthieh579
    @ahmedabuharthieh579 Před 7 měsíci +20

    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  Před 7 měsíci +1

      So glad to hear you liked it mate. Cheers!

  • @happygofishing
    @happygofishing Před 7 měsíci +7

    Probably the best C video Ive ever watched.

  • @kathirvelgounder9673
    @kathirvelgounder9673 Před 7 měsíci +2

    Better than most professors out there, very easy to follow and listen too!

  • @Albertux
    @Albertux Před 7 měsíci +2

    Glad to see young folks using a real operating system

  • @mozartmaia6333
    @mozartmaia6333 Před 4 měsíci +3

    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!

  • @imagineabout4153
    @imagineabout4153 Před 7 měsíci +34

    Will watch this tonight in bed, high as a kite! Keep it up :D

    • @hoff._world
      @hoff._world  Před 7 měsíci +7

      A good way to watch it :D thanks!

  • @GabeSullice
    @GabeSullice Před 6 měsíci +9

    The kids are gonna be alright

    • @hoff._world
      @hoff._world  Před 6 měsíci +2

      my generation aint ruined yet :D

  • @c0d_0x16
    @c0d_0x16 Před 7 měsíci +1

    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  Před 7 měsíci +3

      How good, let me know how it goes!

  • @CuriousCyclist
    @CuriousCyclist Před 7 měsíci +2

    Just discovered your channel. Really good stuff. (aside from the small font size)

    • @hoff._world
      @hoff._world  Před 7 měsíci

      I'm guessing small font size might become a running joke here

  • @pentagrams2350
    @pentagrams2350 Před 7 měsíci +4

    very well made video from such a small channel. i can see you growing drastically in the future

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      It means a lot, appreciate it mate. I like your Uncle Iroh pfp

  • @Hellbending
    @Hellbending Před 7 měsíci +1

    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  Před 7 měsíci

      Mate literally same dont worry about it ya dog. Cheers for your comment

  • @datadi
    @datadi Před 6 měsíci

    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

  • @cnyegun
    @cnyegun Před 7 měsíci +2

    Just got recommended this channel today

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      Thanks for tuning in my friend!

  • @michaelscofield4524
    @michaelscofield4524 Před 7 měsíci +1

    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  Před 7 měsíci

      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 Před 7 měsíci

      @@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  Před 7 měsíci +1

      @@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 :)

  • @hazmat86
    @hazmat86 Před 7 měsíci +1

    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  Před 7 měsíci +1

      Systems programming is one of the coolest things to me. Glad you think the same!

  • @charlesmoscofian4137
    @charlesmoscofian4137 Před 7 měsíci

    Dude, you just earned yourself another subscriber, nicely done! Keep it up.

  • @8Trails50
    @8Trails50 Před 7 měsíci +1

    this video is insanely goated

  • @eoussama
    @eoussama Před 7 měsíci +1

    Your style is very informative. Kudos!

  • @ninesninesnines
    @ninesninesnines Před 7 měsíci +13

    bro is keeping up with the 10 new years resolutions

    • @hoff._world
      @hoff._world  Před 7 měsíci

      Bro u know we arent gonna quit after the first three weeks :DDD

  • @gronki1
    @gronki1 Před 7 měsíci +3

    Nice channel, subscribed! But small remark, please next time make your font at least twice the size 🙂 cheers from Poland!

    • @hoff._world
      @hoff._world  Před 7 měsíci

      Will do, thanks for your comment!

  • @noah0822-sk4pk
    @noah0822-sk4pk Před 7 měsíci

    clear explanation. easy to follow. good intro video in general. thanks for posting this!!!

  • @p0xygen
    @p0xygen Před 7 měsíci

    Randomly had this on my CZcams 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  Před 7 měsíci +1

      Awesome glad to hear you've got some ideas :)

  • @ThatGuyWithMuffins
    @ThatGuyWithMuffins Před 3 měsíci +12

    Writing a daemon for a girl is unfathomable rizz

    • @hoff._world
      @hoff._world  Před 3 měsíci +2

      what can I say girls love guys who can speak multiple languages (Japanese, Spanish, C, python, C++, Javascript...)

  • @johntully1414
    @johntully1414 Před 7 měsíci +1

    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  Před 7 měsíci

      when I test it multiple modifications work fine, not sure what's going wrong for you. Thanks for your comment!

    • @ricardogodoy7337
      @ricardogodoy7337 Před 7 měsíci

      it happens to me too, not sure why

    • @johntully1414
      @johntully1414 Před 7 měsíci

      ​@@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  Před 7 měsíci

      @@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 Před 6 měsíci +1

      @@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.

  • @ivankevamo
    @ivankevamo Před 7 měsíci

    Thanks a lot! So glad I found out your channel.
    Keep it up, greetings from Brazil.

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      thanks for hosting that CS major in rio

  • @preetishamballi6988
    @preetishamballi6988 Před 6 měsíci +4

    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

  • @benhetland576
    @benhetland576 Před 7 měsíci +1

    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  Před 7 měsíci +4

      True thanks for the note. I suppose the lesson to learn is that good programming requires trust issues :P

    • @Ozla102
      @Ozla102 Před 7 měsíci

      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 Před 7 měsíci

      @@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!

  • @H3fAlUmP
    @H3fAlUmP Před 7 měsíci +1

    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  Před 7 měsíci

      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 Před 7 měsíci

      glibc doesn't implement annex K functions as far as I'm aware

    • @kruruneiwyn2107
      @kruruneiwyn2107 Před 7 měsíci

      @@Zeutomehr correct for like 99% of them I remember there is small number of exceptions but don't recall which

  • @deadsi
    @deadsi Před 7 měsíci +7

    Dear Linux Daemon,
    [your message]
    Sincerely yours,
    [your name]
    Saved you 50 minutes

    • @hoff._world
      @hoff._world  Před 7 měsíci +2

      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

  • @underthemeow9478
    @underthemeow9478 Před 7 měsíci +2

    super cool video! i wish you could show us your customized KDE

    • @hoff._world
      @hoff._world  Před 7 měsíci +2

      Cheers for the video idea. Years and years ago I showed it off on r/unixporn but it may be time for an update :)

  • @martian0x80
    @martian0x80 Před 7 měsíci

    Uses kate? Absolute chad, you earned my like. I love kate as a replacement for nvim/helix.

  • @benhetland576
    @benhetland576 Před 7 měsíci +2

    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  Před 7 měsíci

      It is one of the most powerful and yet most dangerous things about a UNIX system I would say hahaha

  • @andjankowski
    @andjankowski Před 7 měsíci

    You are doing great job, keep it up!

  • @model.citizen.ps3
    @model.citizen.ps3 Před 7 měsíci

    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  Před 7 měsíci

      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!

  • @yurisousan
    @yurisousan Před 6 měsíci

    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  Před 5 měsíci +1

      best of luck with it my guy I know they're quite the elephants to take on :D

  • @rohitjacob803
    @rohitjacob803 Před 7 měsíci

    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  Před 7 měsíci

      There have been a few requests for something like that. I may do a follow up in future :D

  • @Alrighty-Then
    @Alrighty-Then Před 5 měsíci +3

    11:33
    holy jump scare

  • @DUDE_mutagen
    @DUDE_mutagen Před 7 měsíci

    KEEP POSTING THESE, VIDEOS LIKE THESE THAT ACTUALLY EXPLAINs ARE KINO

    • @hoff._world
      @hoff._world  Před 7 měsíci

      Thanks dude appreciate it, will keep it real

  • @pedrogabrielnogueira1068
    @pedrogabrielnogueira1068 Před 7 měsíci

    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

  • @kianureeves2519
    @kianureeves2519 Před 7 měsíci

    not watching yet, but commenting to boost the algorithm. I'll give this a try in a bit!

    • @hoff._world
      @hoff._world  Před 7 měsíci

      whatever you did worked mate thanks a million :)

  • @anantuongcong
    @anantuongcong Před 7 měsíci

    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

  • @remek712
    @remek712 Před 7 měsíci +1

    How to handle pressure in Scrum Sprints as a developer

  • @JustKatoh
    @JustKatoh Před 7 měsíci +3

    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  Před 7 měsíci +1

      Yep clinically diagnosed with Kate enjoyer disorder

  • @bigl9527
    @bigl9527 Před 7 měsíci +1

    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  Před 7 měsíci

      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 Před 7 měsíci

      @@hoff._world glad to help

  • @deonmarais3375
    @deonmarais3375 Před 7 měsíci +2

    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`
    ```

  • @jamesdavis914
    @jamesdavis914 Před 7 měsíci +1

    TY for live coding C!

    • @hoff._world
      @hoff._world  Před 7 měsíci

      if u liked this video ur gonna have a fun weekend keep an eye out

  • @redhawk3385
    @redhawk3385 Před 5 měsíci +4

    based kate editor

    • @hoff._world
      @hoff._world  Před 5 měsíci +3

      kate chads rise up from the ashes of the vim vs emacs war

    • @TooShyForTea
      @TooShyForTea Před 4 měsíci

      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  Před 4 měsíci +1

      @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 Před 7 měsíci

    i love this content! thank u for blessing us

  • @woliveiraxs
    @woliveiraxs Před 6 měsíci +1

    Pretty good man :) Thanks for the nice and well exaplained tutorial :)

  • @Wakizu
    @Wakizu Před 7 měsíci

    utube algo in work, recommended your awesome vdo

  •  Před 7 měsíci +4

    This guy writes code in Kate. Subscribed.

    • @hoff._world
      @hoff._world  Před 7 měsíci +2

      When anyone talks shit about it I just say "Let me guess, you need more?"

  • @Andrii-zc4dp
    @Andrii-zc4dp Před 7 měsíci +1

    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 Před 7 měsíci +2

      are we seriously still doing this editor war shit 😭

    • @hoff._world
      @hoff._world  Před 7 měsíci

      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.

  • @scumpascumpa
    @scumpascumpa Před 7 měsíci +1

    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  Před 7 měsíci +5

      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.

  • @OhCynicalHD
    @OhCynicalHD Před 7 měsíci +4

    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

  • @mikereynolds1368
    @mikereynolds1368 Před 7 měsíci

    Defo enjoyed this. Good on ya!

  • @mailoisback
    @mailoisback Před 7 měsíci

    Great channel, deserves more subs.

    • @hoff._world
      @hoff._world  Před 7 měsíci

      Er well it certainly did that the last day and a bit. Thanks!

  • @Blueeeeeee
    @Blueeeeeee Před 7 měsíci

    Thumbs up just for the thumbnail x)

  • @thomas-sinkala
    @thomas-sinkala Před 4 měsíci +1

    Earned a subscriber.

  • @LBCreateSpace
    @LBCreateSpace Před 5 měsíci

    Thanks for making this! :D

  • @RobSwindell
    @RobSwindell Před 7 měsíci

    12:04 use strrchr(argv[1], '/'); to find the pointer to the last slash instead of a strtok() loop.

    • @benhetland576
      @benhetland576 Před 7 měsíci

      As long as you remember to ignore any trailing slashes first.

  • @soup4632
    @soup4632 Před 7 měsíci

    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  Před 7 měsíci

      Hey thanks! Might make a discord server if the channel grows and there's interest

  • @sunk3rn
    @sunk3rn Před 7 měsíci

    great tutorial, subbed

  • @dr-Jonas-Birch
    @dr-Jonas-Birch Před 2 měsíci +4

    This is my Internet, get your own.

  • @bulverismo
    @bulverismo Před 7 měsíci +1

    thanks, really cool

  • @lassebq1
    @lassebq1 Před 7 měsíci

    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  Před 7 měsíci

      True, and with this daemon if you have libnotify you also have GTK. Good note!

  • @alwin5995
    @alwin5995 Před 7 měsíci

    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  Před 7 měsíci

      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!

  • @aryantirkey1744
    @aryantirkey1744 Před 7 měsíci

    Great got me interested planing on making my own

    • @hoff._world
      @hoff._world  Před 7 měsíci

      Glad to hear it write back with what you come up with!

  • @illfyouup
    @illfyouup Před 7 měsíci +3

    Programming in C scratches an itch no other programming language does

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      to me it is like you are having a one-to-one chat with the CPU

    • @bimmy4664
      @bimmy4664 Před 7 měsíci +1

      @@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  Před 7 měsíci +1

      @@bimmy4664 yes, if you think about it the entire field of computer science is about smart abstraction

  • @illegalsmirf
    @illegalsmirf Před 7 měsíci

    You're a clever young man!

  • @gizmotruveauth20
    @gizmotruveauth20 Před 7 měsíci +1

    enlarge the font please in your further videos for better visibility. thx

    • @hoff._world
      @hoff._world  Před 7 měsíci

      Thanks for your feedback. Will do!

  • @TheWizard45134
    @TheWizard45134 Před 7 měsíci

    No way! I actually understood the thing. This is epic! Dont be yoo silly btw

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      Thanks. I'll try not to be too silly but I'm just such a funny little character aren't I

  • @maritimers4sure
    @maritimers4sure Před 5 měsíci

    Excellent. Thanks.

  • @mrinalyadav4261
    @mrinalyadav4261 Před 18 dny

    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

  • @sahithvibudhi7471
    @sahithvibudhi7471 Před 7 měsíci

    Great video! Subscribed

  • @goonman1255
    @goonman1255 Před 7 měsíci

    Great video mate

  • @FainTMako
    @FainTMako Před 7 měsíci

    Would have been badass if by end of video he looked omega stressed and had a wizards beard.

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      I do, but internally, internally

  • @skeleton_craftGaming
    @skeleton_craftGaming Před 7 měsíci

    A lot of the cstdlib is implemented via syscall in unix like systems...

  • @okuno54
    @okuno54 Před 7 měsíci

    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  Před 7 měsíci +1

      yeah my friend I'm young and arrogant ofc I know better than Tony :P

  • @Nitant-qz3ie
    @Nitant-qz3ie Před 4 měsíci

    just needed a help , libnotify and glib gives no file found even after i included from source directory of my system of nixos

  • @ishangrover1453
    @ishangrover1453 Před 7 měsíci +1

    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  Před 7 měsíci

      because the video was 50 minutes long 😬

    • @pines6110
      @pines6110 Před 7 měsíci

      Wouldn't mind it being 1:20 if it tells me everything @@hoff._world

  • @dauda-dev5554
    @dauda-dev5554 Před 7 měsíci +1

    how to set up the daemon to os startup would be nice to see to all this. thanks for video.

    • @CJ1337HF
      @CJ1337HF Před 7 měsíci

      Fairly easy via systemd. Just a small config file

    • @hoff._world
      @hoff._world  Před 7 měsíci

      @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 Před 7 měsíci +1

      @@hoff._world you can solve thus easily by setting the target correctly

  • @ChrispyChris3
    @ChrispyChris3 Před 7 měsíci +1

    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  Před 7 měsíci +2

      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.

  • @90daysofspanish-lf9me
    @90daysofspanish-lf9me Před 7 měsíci

    Legend

  • @filintodelgado
    @filintodelgado Před 7 měsíci +1

    You could have used `char *basename(char *path)` to get the basename from the path

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      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 Před 7 měsíci

      @@hoff._world you did the right choice as I have never heard of it and now I know. Might be useful someday

  • @sanctuary_of_soul
    @sanctuary_of_soul Před 7 měsíci

    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!

  • @paxdriver
    @paxdriver Před 7 měsíci

    People at my school didn't even know html, never mind Linux system daemons lol too cool for school 👍

    • @hoff._world
      @hoff._world  Před 7 měsíci +1

      You'll be the 'hacker kid' in school

    • @paxdriver
      @paxdriver Před 6 měsíci

      @@hoff._world lol i'd be Billy Madison ;p

  • @ferasalfarsi897
    @ferasalfarsi897 Před 7 měsíci

    Can you please zoom in when you are typing the code, so we can read it.

  • @ge0x1
    @ge0x1 Před 7 měsíci +1

    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  Před 7 měsíci +7

      nah im not a grifter, shit will be up for free dont stress bruv

    • @thats-no-moon
      @thats-no-moon Před 7 měsíci

      @@hoff._world right on. font still too small :-D

    • @hoff._world
      @hoff._world  Před 7 měsíci +2

      @thats-no-moon that's the catch, it's free but u pay with ur eyesight

    • @biigsmokee
      @biigsmokee Před 7 měsíci

      ​@@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

  • @cuba6959
    @cuba6959 Před 7 měsíci

    awesome thumbnail

  • @user-xb2kq8qx9j
    @user-xb2kq8qx9j Před 6 měsíci +1

    Can this be cross platform with compiler as an enabler ? Asking from title .

    • @hoff._world
      @hoff._world  Před 6 měsíci +1

      nope, we use linux-only system calls in this one

  • @vojoslav
    @vojoslav Před 7 měsíci

    great video! i was thinking, wouldn't an enum be easier for the error codes?

    • @hoff._world
      @hoff._world  Před 7 měsíci

      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

  • @thats-no-moon
    @thats-no-moon Před 7 měsíci

    Yeah, vid is pretty good, NGL

    • @hoff._world
      @hoff._world  Před 7 měsíci

      that boat in ur pfp looks pretty good ngl

  • @moog730
    @moog730 Před 7 měsíci +1

    W vid

  • @PeterKilian
    @PeterKilian Před 7 měsíci

    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  Před 7 měsíci

      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 Před 7 měsíci

      @@hoff._world one day bro 🤣

  • @bartek...
    @bartek... Před 7 měsíci

    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  Před 7 měsíci +1

      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... Před 7 měsíci

      @@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 Před 7 měsíci +2

      ​@@hoff._world tbh it did not have a robotic feel to me. It all felt pretty natural.

    • @hoff._world
      @hoff._world  Před 7 měsíci

      @mikereynolds1368 cheers Mike that's good to hear

  • @imrank340
    @imrank340 Před 7 měsíci +2

    I must notify you allocated memory but failed to release the memory using free(), at the end.

    • @hoff._world
      @hoff._world  Před 7 měsíci +4

      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.

  • @godDIEmanLIVE
    @godDIEmanLIVE Před 6 měsíci

    Really cool.