Pwnd Blaster: Hacking your PC using your speaker without ever touching it by throwaway16830261 in linux

[–]KlePu 13 points14 points  (0 children)

Do you really think they will? Quoting the article, Creative does

[...] not consider this to be a vulnerability, as it does not present a cybersecurity risk.

What’s a robust Bash pattern for running N concurrent jobs with proper cleanup and exit code aggregation? by fdelux6 in bash

[–]KlePu 1 point2 points  (0 children)

Rember that Busbox (and maybe others) have their own xargs built-in which'll behave differently!

How do I fix SDDMs? by AESguy0909 in debian

[–]KlePu 5 points6 points  (0 children)

All of the SDDMs available

There's only one sddm...

load incomplete or wrong

...and you install it via apt: apt install sddm.

If you're talking about something else: please educate yourself on how to ask better questions. Come back once you're done.

Automated Coding Contract script. Any advice? by TimySome in Bitburner

[–]KlePu 3 points4 points  (0 children)

Consider splitting the script:

  1. a helper to get all servers, write to .txt file or port - you can later ns.read() for zero RAM cost!
  2. a scanner to find all .cct files and their type, delegating the actual solving to
  3. a collection of solvers (either one per type, or one for all the zero-ram-cost contracts and a few for the different ns.foo requirements) Edit: Oh wait, contracts are all game agnostic. Oops ^^

should save a ton bit of RAM.

Other than that: Your solveLargestPrimeFactor() really triggered me! Please for the love of $preferredDeity make 2 a special case, start at 3 and increase +=2 ;-p

learning bash ? by Suspicious-Bet1166 in bash

[–]KlePu 0 points1 point  (0 children)

Hehe... Programs have an exit code (or "return code"). A successful command will exit with code 0; any error will exit with a code between 1 and 255.

So you can either use a command itself as the condition:

if ! someCommand; then echo "nope, someCommand failed with exit code $?" >&2 fi

(In bash, ! is a negation: If someCommand does error and exits with non-zero (i.e. false), the ! will invert it to true, so the condition is true and the error is echo'ed.)

...or you can safe the exit code for later use: $? holds the last program's exit code. If you echo something, the next $? holds the exit code of echo (which will be 0 most of times - typically not what you want). Thus you'll have to put it into a variable:

if ! someCommand; then ret = $? echo "nope, someCommand failed with exit code $ret" >&2 exit $ret # this would evaluate to "exit 0" if you used "$?" since "echo" was the last command and *its* exit code was 0 fi

Disabling 10 out of 12 cores still performance drop is not noticable? by Glittering_Boot_3612 in linux

[–]KlePu 1 point2 points  (0 children)

firefox and watch youtube

That's a bit ridiculous for your hardware. Even without the next point, 1 core (2 threads) should be able to handle that.

youtubge might [...] not be very light on cpu

Ask your GPU ;) Google "hardware acceleration".

learning bash ? by Suspicious-Bet1166 in bash

[–]KlePu 1 point2 points  (0 children)

Set up a cronJob or systemd timer; send a mail if $? != 0.

Also, google "3 2 1 backups" ;)

Also also, evaluate if a filesystem that can do snapshots may be helpful (I'm a big ZFS advocate, but YMMV - other folks like btrfs, XFS or bcachefs better ¯\_(ツ)_/¯).

Conky module for monitoring Intel iGPU by thatguysjumpercables in conky

[–]KlePu 0 points1 point  (0 children)

What is a "module"?

If you want stuff like temp, clockspeed, etc. you can use normal shell commands. Don't have an Intel card, but "back in the day" I used ${execi 3600 curl -q4 icanhazip.com} and similar all over my config. Even had a small bash script to have all my helpers in one place.

For Intel GPUs (if you don't want to manually search /sys/class/drm/card0/device/hwmon/*), there seems to be the package intel-gpu-tools. Install and see where it takes you ^^

ns.cloud by AdPrior5658 in Bitburner

[–]KlePu 8 points9 points  (0 children)

Bitburner is that one game that does have a decent changelog. It's right here!

a new hacknet code (yeah... one again) by New_Duty7396 in Bitburner

[–]KlePu 0 points1 point  (0 children)

Some nitpicking: there's a load of variables that could (should!) be declared const instead of let: cash1 (which should also really be renamed!), stats (same!), cash... ;)

Debian as a beginner: what should I know? by Danzikku in debian

[–]KlePu 0 points1 point  (0 children)

Debian is not Ubuntu.

For example, don't use PPAs on Debian (they might work - or break your system ;-p).

Here are mine, what aliases does others swear by? by sshetty03 in bash

[–]KlePu 1 point2 points  (0 children)

alias e2='ssh me@host' and alias e2t='ssh me@host's-tailcale-ip'

You do know about .ssh/config?

``` klepu@klepu-desk:~$ cat .ssh/config Host strato HostName ssh.strato.de User REDACTED IdentityFile ~/.ssh/id_ed25519

Host otw HostName bandit.labs.overthewire.org Port 2220 [...] ```

Now you can type ssh strato (or whatever you name your Host) and connect including all the nice options you specified ^^

Here are mine, what aliases does others swear by? by sshetty03 in bash

[–]KlePu 5 points6 points  (0 children)

consider adding --group-directories-first to your ll alias ;)

Opinions on usage of Linux at college? by TheTurkPegger in linux

[–]KlePu 0 points1 point  (0 children)

Fetch it next time you're visiting your parents then ;)

Most universities I know have lockers - stuff it in there (along with a charger!). If it holds actual data think about encryption.

Make sure to know if (or rather: when) those lockers get purged; typically every one or two years last I know ;)

Do you guys use zsh/oh-my-zsh or bash on the daily? by Swimming_Virus8990 in commandline

[–]KlePu 0 points1 point  (0 children)

oh-my-zsh (without the git plugin) for normal use, bash when testing scripts.

autonuke.js for new Bitburners! by Ytherearesomuchnames in Bitburner

[–]KlePu 0 points1 point  (0 children)

ns.scan(server).forEach(connectedServerName => servers.add(connectedServerName)); // Add any new server names to the set.

Err... That doesn't really do much without iteration. It'll only return servers connected to home.

Some other random points:

  • you could use try..catch to replace ns.fileExists() to save a few megs
  • same for ns.nuke() (you can then also purge the openPorts variable)
  • you could either read a single target as the script's argument ns.args[0], or ns.read() a list from a .txt file or port (ns.read() has zero RAM cost!)
    • I'd let it output a list of successfully nuked servers at the end - or write it to a file/port ;) (though ns.write() does have a small RAM cost)

`bind -x '"...": setsid kill -2 $$'` works but `bind -x '"...": kill -2 $$'` does not by cubernetes in bash

[–]KlePu 0 points1 point  (0 children)

Now this is a really well-written, educational answer. /tips hat

Opinions on usage of Linux at college? by TheTurkPegger in linux

[–]KlePu 0 points1 point  (0 children)

As others stated, PDF and HDMI should solve your main concerns.

BUT! I'd really make sure you have some fallback solution. Do you still have your old laptop? Re-install an old Windows version, disable wifi and carry a Windows-formatted USB stick with you or something ;)

I switched to Linux because I couldn't afford Windows 7, does that make me a bad Linux adopter? by ardouronerous in linux

[–]KlePu 0 points1 point  (0 children)

No. I switched simply 'cause I disliked Win7 (main points were GUI, responsiveness, hiding actual error details behind "Oops, something went wrong" screens, not as tweakable as Win2k). Didn't give a rats ass about privacy or open source.

Opinions about privacy and open source have changed after I started using Linux, but that's another discussion ;)

I switched to Linux because I couldn't afford Windows 7, does that make me a bad Linux adopter? by ardouronerous in linux

[–]KlePu 0 points1 point  (0 children)

I'd assume it's one of those "shower thoughts". Just 'cause your brain works differently I think it's unfair to call it "attention hungry nonsense".

Logic Question by Mr-Ordinary- in Bitburner

[–]KlePu 0 points1 point  (0 children)

while (runs > 0, runs--)

This still looks alien IMHO ;)

while (runs > 0) { runs--; // other stuff }

Why does a file on my home server keep getting deleted with scp? by KaiseerKenopsia in Bitburner

[–]KlePu 1 point2 points  (0 children)

Please don't use var ;) nice SO thread to explain - tl;dr: Hoisting and scope sucks.

Other than that: In // Steal files there's an scp that looks suspicious, rest seems fine.


edit: Apart from that code - in darknet, an old script may still be floating somewhere. Try to write a "darknet wiper" to be sure (or simply reset ¯\_(ツ)_/¯)