Skip to content
Magenaut

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

operating-system

Get operating system info

October 21, 2022 by Magenaut

I recently started wondering about sites like http://thismachine.info/ that get the user’s operating system info. I have not been able to find out how to do that with PHP, and wanted to try to figure it out.

Categories PHP, Q&A Tags operating-system, php, user-agent Leave a comment

How to get the OS on which PHP is running?

October 18, 2022 by Magenaut

For building a unix/dos specific script I need to know on which kind of operating system I am.

Categories PHP, Q&A Tags operating-system, php Leave a comment

Convert the output of os.cpus() in Node.js to percentage

October 5, 2022 by Magenaut

Is there a way to convert the os.cpus() info to percentage? Just like the output of iostat (on the CPU section).

Categories Node.js, Q&A Tags cpu, node.js, operating-system Leave a comment

Get my OS from the node.js shell

October 4, 2022 by Magenaut

console.log(‘This platform is ‘ + process.platform);

Categories Node.js, Q&A Tags javascript, node.js, operating-system Leave a comment

How can I safely create a nested directory?

August 21, 2022 by Magenaut

What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried:

Categories Python, Q&A Tags directory, exception, operating-system, path, python Leave a comment

Running windows shell commands with python

August 19, 2022 by Magenaut

How can we interact with OS shell using Python ?
I want to run windows cmd commands via python. How can it be achieved ?

Categories Python, Q&A Tags operating-system, python, shell, windows Leave a comment

What is the return value of os.system() in Python?

August 18, 2022 by Magenaut

I came across this:

Categories Python, Q&A Tags operating-system, python Leave a comment

How come a file doesn’t get written until I stop the program?

August 16, 2022 by Magenaut

I’m running a test, and found that the file doesn’t actually get written until I control-C to abort the program. Can anyone explain why that would happen?

Categories Python, Q&A Tags file, operating-system, python Leave a comment

Create file but if name exists add number

August 15, 2022 by Magenaut

Does Python have any built-in functionality to add a number to a filename if it already exists?

Categories Python, Q&A Tags file-io, operating-system, python Leave a comment

What’s the difference between io.open() and os.open() on Python?

August 12, 2022 by Magenaut

I realised that the open() function I’ve been using was an alias to io.open() and that importing * from os would overshadow that.

Categories Python, Q&A Tags io, module, operating-system, python Leave a comment

Recent Comments

  • silverplugins217 on How to add placeholder for contact form7 for dropdown?
  • Shreyas Ikhar on How to add a custom CSS class to core blocks in Gutenberg editor?
  • Magenaut on How to call function on timer ASP.NET MVC
  • Ebaad Uddin on How to call function on timer ASP.NET MVC
  • michealSmith07 on Is there a way to dynamically refresh the less command?

Tags

.net adobe-illustrator adobe-photoshop ajax arrays asp.net asp.net-core asp.net-mvc bash c# css database django eloquent express html java javascript jquery json laravel laravel-4 laravel-5 laravel-8 linux list mongodb mongoose mysql node.js npm pandas php python python-3.x react-hooks react-native react-router reactjs redux regex sql string typescript wordpress
© 2023 Magenaut • Built with GeneratePress