Live data from Hacker News

Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

github.com

1–9 of 9 posts

Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#1
Hi all,

I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts.

I added it to Github so you can view it there: https://github.com/adionditsak/shellconf.py :-)

Sincerely, Anders

Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems
github.com

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#2
Hi all,

I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts.

I added it to Github so you can view it there: https://github.com/adionditsak/shellconf.py :-)

Sincerely, Anders

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#3

Hi all, I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts. I added it to Github so you can view it there: https://github.com/adiondits…

Along this line, you might find "cogs" (a toolkit for developing command-line utilities in Python) useful to build upon, it's an internal tool we use at Prometheus that's MIT licensed: https://bitbucket.org/prometheus/cogs

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#4

Hi all, I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts. I added it to Github so you can view it there: https://github.com/adiondits…

Good stuff. Take a look at Fabric for another (and very commonly-used) example of Python wrapping SSH: http://docs.fabfile.org. Also you might look to Paramiko for a native SSH implementation: https://github.com/paramiko/paramiko.

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#5

Hi all, I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts. I added it to Github so you can view it there: https://github.com/adiondits…

The explanation:

   "Run local shell scripts chronologically on defined remote servers asynchronously."
reads like Yoda-speak to me. :)

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#6
post #5

Hi all, I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts. I added it to Github so you can view it there: https://github.com/adiondits…

The explanation: "Run local shell scripts chronologically on defined remote servers asynchronously." reads like Yoda-speak to me. :)

Hehe the shell scripts are executed one by one chronologically, but the request to the servers are asynchronously. Does not work so good yet tho... need to fix it :-)

EDIT: With that said... could be awesome we contributions.

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#7
post #4

Hi all, I have created my second Python script, and would appreciate comments, contributions or just someone to discuss it with, as i am sure it can be optimized in many ways, as it is a part of my learning. The script is for configuring UNIX/Linux machines with shell scripts with Python - So pretty much a Python way of Fucking shell scripts. I added it to Github so you can view it there: https://github.com/adiondits…

Good stuff. Take a look at Fabric for another (and very commonly-used) example of Python wrapping SSH: http://docs.fabfile.org . Also you might look to Paramiko for a native SSH implementation: https://github.com/paramiko/paramiko .

Hi Nburger,

Thanks.

Yeah, Fabric is awesome. Really like it. Have not looked that much at Paramiko tho.

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#8
While Python is likely more widely installed than Ruby, I still don't understand, why use Python to run a bunch of shell scripts? Why not use the shell to run the scripts?

    for f in scripts/*;do
      #logrotate here
      scripts/"$f" &> "logs/$f.log"
    done
or something like that?

EDIT: not trying to be rude, I just don't understand.

Re: Shellconf.py – Simple remote configuration with shell for UNIX/Linux systems

#9
post #8

While Python is likely more widely installed than Ruby, I still don't understand, why use Python to run a bunch of shell scripts? Why not use the shell to run the scripts? for f in scripts/*;do #logrotate here scripts/"$f" &> "logs/$f.log" done or something like that? EDIT: not trying to be rude, I just don't understand.

Makes sense. Was thinking the same... Just doing this for learning actually. I think it makes sense tho to do it in Python, Ruby or something else, if you want to steamline it in some way with structure/architecture. I would like to see the bash version tho :-)