Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
133 views

Mount point API for Linux systems

I have a use case where I need to check, whether / is mounted read-only. Here's the module where I implemented this check: ...
Richard Neumann's user avatar
2 votes
2 answers
99 views

A Python script to install a number of useful programs and packages on a fresh Linux-based device

I work with Linux-based devices, and, both at work and in my personal life, it's necessary to wipe these devices every so often - sometimes as frequently as multiple times per week. In this context, ...
Tom Hosker's user avatar
2 votes
1 answer
1k views

Python script to automate the creation of Linux LXC containers

Like the title suggests, I wrote a script in Python that uses the python3-lxc library to automate the creation of Linux LXC containers. I realised that containers ...
Aleksey's user avatar
  • 173
3 votes
1 answer
92 views

remote file follow using python

I've created an on-demand class that can be initiated to collected any new data written to file from start_recording call until ...
Zohar81's user avatar
  • 153
1 vote
2 answers
376 views

Persist keyboard backlight color on Linux laptop

System76 sells laptops that come preloaded with their Ubuntu spinoff Pop_OS. The laptop keyboards have backlights that can change color and brightness, but so far I haven't found any way to keep the ...
ShapeOfMatter's user avatar
1 vote
1 answer
78 views

Python3 conditionally moving files and string formatting

I have written the below code while helping one of the colleague over the SO and this code working as desired, but I feel there may be some improvement specially on the string formatting syntax's ...
Karn Kumar's user avatar
9 votes
3 answers
2k views

File Automation Using Python On Linux

A project to automate file organization in Linux using Python. I've always wanted to do this project way before I know how to code. Now that I did, I want to improve it even more. Used Language: ...
Hama's user avatar
  • 93
6 votes
1 answer
145 views

A Backup Script for my Linux Server/NAS

This is my script. I want it to run on a weekly basis on my linux server on a Raspberry Pi 4, to back up all files that may have changed. On the GPIO are just LEDs. It requires a program called ...
Nico Lindenlauf's user avatar
2 votes
1 answer
55 views

Log the diff of a Apache httpd config file and reload the service with Python and systemd

Using systemd's .path unit to run a Python script whenever a httpd config file is changed. The Python script creates a backup of ...
user avatar
9 votes
2 answers
3k views

Linux Commands in Python

I've decided to write some Linux commands in Python. Below is a list, along with some constraints (if you're unfamiliar with Linux, the top of the program along has a description about each command ...
Ben A's user avatar
  • 10.7k
1 vote
3 answers
90 views

Python startswith and then look a word in a conditional block

I have below working code which works fine, but just looking way around if there is an another elegant way of doing this, because here i'm using else condition to print the last line or dataBlock to ...
Karn Kumar's user avatar
8 votes
4 answers
3k views

Reporting new USB storage devices on Linux and macOS with Python

Synopsis: I wanted something for macOS (and Linux; maybe eventually Windows) that would simply wait for the user to connect a storage device and automatically select, or otherwise output the ...
voices's user avatar
  • 767
9 votes
1 answer
486 views

Systemd service configuration helper script

I've written a script that semi-automates the process of configuring/creating a new systemd service. The script is working perfectly well, however, I've had some trouble with the styling and ...
Fanatique's user avatar
  • 207
4 votes
2 answers
276 views

Find duplicate files in Linux

This code finds duplicate files in Linux. I assume that MD5 hash will return unique hash number. What can I improve in this code? ...
benz's user avatar
  • 405
3 votes
1 answer
335 views

Running xinput to change touchpad settings

I am looking for some feedback on the code below, mainly for efficiency or mechanism correctness (like eval vs. subprocess). I am also curious if ...
Ecaz's user avatar
  • 33

15 30 50 per page