Skip to content

Instantly share code, notes, and snippets.

View jacquesbh's full-sized avatar
🏠
Working from home

Jacques Bodin-Hullin jacquesbh

🏠
Working from home
View GitHub Profile
@jacquesbh
jacquesbh / Use Yubikey (GPG key) for SSH.md
Last active January 3, 2024 14:59
Use my Yubikey with GPG keys to SSH with a guest computer (OSX or Windows)
@jacquesbh
jacquesbh / pre-commit
Created July 6, 2012 13:08
Git pre-commit hook by Boris Guéry, updated by me
#!/bin/bash
# Author: Boris Guéry <guery.b@gmail.com>
# https://github.com/borisguery/git-keywords-checker
# Add or remove keywords here
KEYWORDS_REGEX="FIXME|XXX|var_dump\(|die\(|Zend_Debug::|print_r\(|console\.(debug|info|log|warn)\("
# Add extensions to check here
EXTENSIONS_REGEX="(.php$|.phtml$|.js$)"
ERRORS_BUFFER=""
@jacquesbh
jacquesbh / firewall
Last active February 18, 2021 17:14
/etc/init.d/firewall Iptables firewall
#!/bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall
# Description: Configure all iptables rules.
@jacquesbh
jacquesbh / function.sh
Last active July 20, 2018 16:19
Self signed certificates generation
# To include in your ~/.bash_profile or other
# You can change the `monsieurbiz.com` and the `MONSIEUR BIZ` in the code.
#
# The generated certificates are compatible with Chrome 58 and use complete SAN section.
#
# See https://www.thesslstore.com/blog/security-changes-in-chrome-58/
# And specially https://groups.google.com/a/chromium.org/forum/#!msg/security-dev/IGT2fLJrAeo/csf_1Rh1AwAJ
function selfsignedssl () {
echo "Country? [FR]"
@jacquesbh
jacquesbh / decorate_method.php
Created July 4, 2012 09:29
Magento - Grid column decorator for 'actions' depending on row
<?php
/**
* Decorate the actions column
* @access public
* @return string
*/
public function decorateActionColumn($value, $row, $column, $isExport)
{
$links = array();
@jacquesbh
jacquesbh / install-0.0.1.php
Created April 7, 2017 12:48
IESA Install Setup
<?php
try {
$installer = $this;
$installer->startSetup();
// Create quote table
$tableName = $installer->getTable('iesa_quote/quote');
if (!$installer->tableExists($tableName)) {
$table = $conn->newTable($tableName);
@jacquesbh
jacquesbh / README.md
Last active October 25, 2016 04:12
Patch for fulltext search issue after upgrading to Magento 1.9.3.0

How to apply?

Download the patch and put it in your local environment in the root magento directory.

Run this command in your Main magento directory: patch -p0 < fulltext-search.patch.

Then remove the fulltext-search.patch file and commit the changes.

Thanks to .

@jacquesbh
jacquesbh / .blackfire.yml
Created August 22, 2016 09:43
Simple blackfire.yml to get metrics information (Magento 1)
tests:
"Info: Action cms/index/index":
assertions:
- "metrics.magento1.action.cms_index_index.count"
"Info: Action cms/page/view":
assertions:
- "metrics.magento1.action.cms_page_view.count"
"Info: Action catalog/category/view":
assertions:
- "metrics.magento1.action.catalog_category_view.count"
@jacquesbh
jacquesbh / netbeans_magento_snippets.xml
Last active July 26, 2016 16:45
Magento snippets
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE codetemplates PUBLIC "-//NetBeans//DTD Editor Code Templates settings 1.0//EN" "http://www.netbeans.org/dtds/EditorCodeTemplates-1_0.dtd">
<codetemplates>
<codetemplate abbreviation="gsc" xml:space="preserve">
<code><![CDATA[Mage::getStoreConfig('${cursor}')]]></code>
</codetemplate>
<codetemplate abbreviation="model" xml:space="preserve">
<code><![CDATA[Mage::getModel('${cursor}')]]></code>
</codetemplate>
<codetemplate abbreviation="single" xml:space="preserve">
@jacquesbh
jacquesbh / git_clean_branches.sh
Created June 8, 2016 09:39
Clean the branches in git repository according to the remote
#!/bin/bash
# Usage: ./git_clean_branches.sh REPOSITORY_PATH
# Go to the directory
cd "$1"
# Delete branches, but keep develop, master and the current branch
git remote prune origin
git branch --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | xargs -n 1 git branch -d