Skip to content

Instantly share code, notes, and snippets.

View zakthan's full-sized avatar

Thanassis Zakopoulos zakthan

  • Pan-net
  • Athens
View GitHub Profile
[server]
SERVER
[server:vars]
server_name=SERVER
email=noc@gopractice.io
docker_nginx_ssl=true
@jotaelesalinas
jotaelesalinas / runcommand.py
Created May 12, 2016 23:20
Runs an external command in Python and returns exit code, stdout and stderr contents.
# runcommand.py
# Handy function that executes an external command in the shell
# and returns 3 values: exit code of the command, its standard output
# and its error output.
# If you run the script directly, an example is provided:
# first it will run a successful command and then one with errors
# (you may want to modify them if not running a Unix system).
import subprocess
@chaifeng
chaifeng / tomcatctl
Last active May 3, 2018 12:29
Tomcat control script, init.d autostart
#!/bin/sh
# Tomcat Control Script
#
# Usage:
# ln -s /path/to/tomcatctl $HOME/apache-tomcat-6.0.37/
# sudo ln -s $HOME/apache-tom-6.0.37/tomcatctl /etc/init.d/tomcatctl
# sudo /etc/init.d/tomcatctl status
#
# In crontab
# */1 * * * * $HOME/apache-tomcat-6.0.37/tomcatctl monitor http://localhost:8080/ > /dev/null || $HOME/apache-tomcat-6.0.37/tomcatctl condrestart > /dev/null