Skip to content

Instantly share code, notes, and snippets.

- name: "Configure php-fpm istance pools"
template:
src: config/php-fpm/pool.conf.j2
dest: "/config/{{item[0]}}/fpm-pools.d/{{item[1]}}"
with_nested:
- "{{fpm_istances}}"
- "fpmistance::{{item[0]}}::pools"
This is in the yaml
---
#!/bin/bash
db=zabbix
for f in history history_log history_str history_text history_uint
do
mysqldump --no-create-info --lock-tables $db $f > `date +"%Y-%m-%d"`_$f.sql
done
for f in acknowledges alerts auditlog events service_alarms trends trends_unit

Keybase proof

I hereby claim:

  • I am lucagervasi on github.
  • I am lucagervasi (https://keybase.io/lucagervasi) on keybase.
  • I have a public key ASCvFBGoPG3wc1QEX9HFptkS6swElRbQubATxLJKpfj0vQo

To claim this, I am signing this object:

@lucagervasi
lucagervasi / trim.awk
Created July 10, 2017 13:04 — forked from andrewrcollins/trim.awk
ltrim(), rtrim(), and trim() in awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {
@lucagervasi
lucagervasi / install.md
Created September 21, 2017 18:26 — forked from floehopper/install.md
Install rtl-sdr on Raspian on Raspberry Pi
jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot

pi@raspberrypi ~ $ sudo apt-get update
@lucagervasi
lucagervasi / hs110.sh
Created February 8, 2018 12:23 — forked from Khoulaiz/hs110.sh
hs110.sh -- bash script to toggle wall plug from TP-LINK and check status
#!/bin/bash
##
# Switch the TP-LINK HS100 wlan smart plug on and off, query for status
# Tested with firmware 1.0.8
#
# Credits to Thomas Baust for the query/status/emeter commands
#
# Author George Georgovassilis, https://github.com/ggeorgovassilis/linuxscripts
#
@lucagervasi
lucagervasi / .htaccess
Created February 13, 2018 15:14 — forked from nurtext/.htaccess
Tell apache we're on HTTPS if reverse proxy is serving the site using SSL
# Let apache know we're behind a SSL reverse proxy
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
# Redirect to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IFModule>
@lucagervasi
lucagervasi / build_opencv_ARM_cross
Created March 2, 2018 15:07 — forked from hrshovon/build_opencv_ARM_cross
Cross compile opencv3.3.0 for your raspberry pi and similar ARM devices with python support
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for
native compiling without any issues.
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing
that out.
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5.
Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer.
1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough
@lucagervasi
lucagervasi / ForceHTTPSVarnish4.vcl
Created April 13, 2018 05:50 — forked from section-io-gists/ForceHTTPSVarnish4.vcl
Varnish 4.x to force HTTPS
sub vcl_recv {
if (req.http.X-Forwarded-Proto !~ "https") {
return (synth(850, "Moved Permanently"));
}
}
sub vcl_synth {
if(resp.status == 850) {
set resp.http.Location = "https://" + req.http.host + req.url;
set resp.status = 301;
[Unit]
Description=Nodejs Web Application MyAPP
After=syslog.target network.target
[Service]
TimeoutStartSec=300
WorkingDirectory=/opt/nodejs/MyAPP/app
User=nodejs