Post your coding projects

My thing is that it’s way too hard to set up and definitly overkill for a homelab. Things like kubeadm have helped the first point, but I still wanted to automated it. MDS only requires bash, docker, and dialog. I’d even been open to dropping dialog if it’s a problem.

Oh, yeah, I definitely know this. I work for a company who’s moving to it.

1 Like

Just because it’s not here yet :stuck_out_tongue:

https://looking-glass.hostfission.com

2 Likes

How about a m o n o s p a c e generator? Does that count?

If so… here’s a link for you guys: https://repl.it/@denis_alves/m-o-n-o-s-p-a-c-e-g-e-n-e-r-a-t-o-r-english-version

Couldn’t get the standalone console link, so there you have the code.

It’s in C btw

1 Like
  1. what is stdio_ext.h?
  2. make it cli friendly and it’d be pretty cool :wink:

cli friendly as in:

$ monospace  this is my text
t h i s   i s   m y   t e x t

this way you can pipe stuff easily.

you can add flags for other shit

1 Like

holy crap that’s nice, but still don’t know how to do that

you could do it if you’re interested, the app itself is open source and just a training game, haven’t even deployed it in my pc at home (made it in work, not IT related)

stdio_ext.h was for __fpurge(), this mothereffer was hard to implement, since even on my stupid college they teach C only for windows

1 Like

Here is my take on it

Fixes/changes:

  • Specify the length of the buffer for scanf so you don’t allow a buffer overflow.
  • read the input until \n or EOF instead of using the platform specific fpurge
  • no need to strcpy to init a string, just set the first byte to the null terminator
  • iterate using a string pointer instead of getting the string length and then looping. strlen iterates the string to find the null terminator, it doesn’t actually know or “get” how long the string is, it has to discover it.

3 Likes

damn that’s beautiful hahaha

you see the difference between an amateur and a pro

I’m amazed

1 Like

Oh, only read the changes after commenting…

Didn’t know about all that. You saved a ton of processing… that’s really amazing!

1 Like

Thanks, always happy to peer review code :wink:

You could also check if the ouptut of scanf == 1 to determine if there was any content before looping and prompt again.

2 Likes

So I wrote a small CLI Python system monitor utility.

Uploaded it to Github as it should be usable as the code is now. Would really appreciate any testing and feedback.

It requires Python 3, PIP and the psutil library (Install via PIP). HDDTemp is recommended to display drive temperatures and running as root to enable drive temperatures and GPU monitoring.

Only AMDGPU is currently supported.

3 Likes

Just started this a couple days ago but I will post the idea here anyway. Maybe later I can post more on the project.

For almost 2 years I have been trying to find away to remap the keys on my Razor Nostromo (made a post in the hardware forums). And a couple days ago I found a very good article on how to do it. My first thought was to make a simple script that could make things a bit easier. But I’m taking it to the next level. I making a full fledged GUI (using Python and GTK). The first step is to make it so one can easily remap any key on any keyboard by just selecting their keyboard/keypad and then clicking an add/change button that then listens for a key press on that particular device, and then you can set the new mapped value. The second step will be to make it so you can store multiple profiles per keyboard/keypad. Third, I want to add support for gaming mice and other user input devices (joysticks, steering wheels, foot pedal, ect). I think it may even be possible to support changing the LED’s (speculation at the moment). And I think all this can be done without a having to code a driver. Maybe if I should add the ability to set multiple keys to one key I may need a driver, but that is quite a ways down the road and I’ll cross that bridge when I get there.

So the next step in my Py-Mon project is making an installer for it so it can be easily installed and run from anywhere on the terminal. Did some Googling but there is so much info that I’m a bit overwhelmed.

Any suggestions on what path to take?

I’ve been playing with a phototransitor and Javascript. Goal is to transmit data by flashing an area of the screen with Javascript and detecting that with a microcontroller and the phototransistor, and encoding data that way.

So far I’ve managed to send data with a manually calibrated level for the transistor, and a simple pulse length encoding. I need to remove the need to manually calibrate though. I’m going to try using low pass filtered trigger point and looking for high to low transitions.

Data rate is only about 20 bps with a 60Hz screen, but it’s enough for a lot of stuff like configuration and clock setting.

easy_install/setuptools, package it for pip

1 Like

Will try it later today. Thanks

got the verbose option mostly working(some minor bug testing to do left)

but probably gonna add a bunch more to change it up, some performance improvements(since it will be very very slow)

currently its just comparing literally every file versus every file from the second snap,
and then every file on second snap versus every file on the first snap(since we dont know if they are the same length, are meant to be the same length, if 1 or 2 is supposed to be longer, or shorter, or if they moved a file etc)

thinking address some memory and record which ones had a match, then skip scanning the rest after a match was found, then if no match is found, override and rescan literally all files, on snap 1 and 2, and then print if any matches were then found,

which should in most cases significantly speed up the process, even in worst case would still be 1/2 the time or slightly faster(unless they compare 2 entirely different datasets i guess)

redid some stuff

mostly done with the bug testing i think

but couldnt figure out how to allocate the memory lol so cant skip files(yet atleast), but it continues on the list if it finds a match, and then rescans the entire other snap to verify if there is no match

bringing down the total number of comparisons from 2x^x, to 2x+1x per file that doesnt match instantly (i.e. a modified/corrupt file, an extra file etc)

edit:
also squashed a random bug that hadnt seen before(a result where it would shift to the next part of the index for the 1000 thing when it shouldnt for one more scan, that produced no error until the end of the input list when it would try to scan 1000 from a file without 1000)

also slight performance improvement/efficiency gain in the sections where it was shifting the number to scan to into the 1000 range, just doing pick=pick%1000; instead of shifting it by 1000 like while(pick>1000){pick=pick-1000;}

Working on AMD Vega for Linux

2 Likes

After a couple months it’s done. Using argc and argv, will try to make it accept blank spaces, right now when it finds a \0 it ends the program.

Might be launching it on github by the end of month hahaha

Edit: mispelled couple and to add:

Got it working on multiple words, will study about how to deploy a C application, since it was made using nano e gcc all manually.

1 Like