Skip to content

Instantly share code, notes, and snippets.

View TOTOleHero's full-sized avatar

Thomas Lecarpentier TOTOleHero

View GitHub Profile
URL="http://stackoverflow.com/"
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@TOTOleHero
TOTOleHero / README.md
Created June 13, 2017 17:04
wkhtmltopdf centos 7 headless with xvfb

wkhtmltopdf centos 7 headless with xvfb

Install and run standalone Xvfb

yum install xorg-x11-server-Xvfb
yum install xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
rpm -ivh wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
apt-get install wkhtmltopdf
apt-get install xvfb
echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf -q $*' > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf
@TOTOleHero
TOTOleHero / InstallSuperisorInRedhat.md
Last active May 5, 2017 15:29 — forked from arielmagbanua/InstallSupervisorInRedhat.md
Supervisor Installation Guide for CentOS/RHEL/Fedora

#Installing Supervisor As the super user, firstly install the Python setup tools to gain EasyInstall3, then use that to install Supervisor:

$ yum install python-setuptools
$ easy_install supervisor

#You should now have the latest version installed:

$ supervisord --version
@TOTOleHero
TOTOleHero / supervisord.service
Last active May 23, 2017 13:11 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown