Skip to content

Instantly share code, notes, and snippets.

Michaël Marinetti Asenar

View GitHub Profile
@Asenar
Asenar / MailerFactory.php.diff
Last active Jul 18, 2017
Using DKIM to send mail with Thelia2 ( core/lib/Thelia/Mailer/MailerFactory.php )
View MailerFactory.php.diff
diff --git i/core/lib/Thelia/Mailer/MailerFactory.php w/core/lib/Thelia/Mailer/MailerFactory.php
index a59ad40..7808a79 100644
--- i/core/lib/Thelia/Mailer/MailerFactory.php
+++ w/core/lib/Thelia/Mailer/MailerFactory.php
@@ -30,6 +30,12 @@ use Thelia\Model\MessageQuery;
*/
class MailerFactory
{
+ // {{{ added by @asenar - DKIM patch
+ // HOWTO
@Asenar
Asenar / file.php.diff
Created Jul 5, 2016
wordpress security hack for allowing theme/plugin/images uploads but not core upgrade (with different file owner permissions check)
View file.php.diff
commit 670110b (HEAD, virageadroite)
Author: Michaël Marinetti <github@marinetti.fr>
Date: 12 minutes ago
Add: security wp-content
diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php
index 078a369..d11c9f3 100644
--- a/wp-admin/includes/file.php
+++ b/wp-admin/includes/file.php
@Asenar
Asenar / .vimrc
Created Aug 25, 2015
quickstart vimrc file
View .vimrc
" put in ~/.vimrc
" {{{ general config
set nocompatible " vim Improved
set t_Co=256 " 256 colors
set ruler " show line and column in status bar
set showcmd " show the current command you're typing
" }}}
" {{{ look and feel
@Asenar
Asenar / gist:5e9cea32d588507c9aad
Last active Aug 29, 2015
draft to handle error and ignore mysql deprecated error
View gist:5e9cea32d588507c9aad
<?php
define('DEBUG', true); // true = enable debug mode
define('DEBUG_ALLOW_ERRORS', false); // false = break on every notice/warning/error(throw exception)
set_error_handler('error_handler');
// set_exception_handler(array('Kohana_Exception', 'handler'));
function error_handler($code, $error, $file = NULL, $line = NULL){
if (error_reporting() & $code)
View cron.hourly.backup
#!/bin/bash
current_hour=$(date +"%H")
current_day=$(date +"%d")
current_month=$(date +"%m")
dbuser=backup
dbpass=******
dbname=mydb
from=backup@domain.com
@Asenar
Asenar / nouveau_site
Last active Dec 19, 2015
quick script to create new vhost I made a couple years ago when I started to use bash. This is a really basic script with lot of case who can break it. Feel free to comment
View nouveau_site
#!/bin/bash
# file : nouveau_site
# description : script to quickly create new vhost. script has to be in /usr/local/sbin/nouveau_site
# usage :
# nouveau_site mondomaine.com
EMAILS="user1@domaine.com"
main_ndd="monsite"
source /usr/local/include/custom_lib
@Asenar
Asenar / creer-depot
Last active Dec 18, 2015
exemple simple de ce qu'est git rebase :)
View creer-depot
git init test
cd test
echo "test" > test1
echo "test" > test2
echo "Dépot exemple" > README
git add . && git ci -m "commit initial"
echo "2eme ligne" >> test1
git add . && git ci -m "ajout une ligne dans test1"
git checkout -b branche1
echo "3eme ligne dans branche1" >> test1
View gist:5246483
mkdir ~/tmp_working_dir
cd ~/tmp_working_dir
git init full_smalte
cd full_smalte
all_subs="installer framework module.sample tests theme.backoffice theme.frontoffice"
# part 1 : import all
# Six branch doomed to die
View devnet.noob.sh
#!/bin/bash
# get all, separated by space or kind of
tout=$(grep "<virtualhost\|servername" /usr/local/apache/conf/httpd.conf -i \
| sed "s#<VirtualHost\(.*\):[0-9]*>#\1#" \
| sed "s#.*ServerName \(.*\)#\1#" \
)
count = 0;
# newline one / 2
@Asenar
Asenar / install-server.org
Last active Dec 13, 2015
[draft] install server from scratch - gandi. Everything has to be done as root
View install-server.org

PART 0 - INTRODUCTION

That’s not really a tutorial. I just took notes of what I did (for doing better next time). I may omit some things, fell free to correct me / complete me in comments or whatever :)

before

  • create your server on the gandi interface, choose expert mode, debian

definitions

  • myserv : The name of my server
  • asenar : can be my username on the server or my username in my local machine

convention

  • let’s say I will surrounds all bloc of code will looks like this:
You can’t perform that action at this time.