Skip to content

Instantly share code, notes, and snippets.

View Murazaki's full-sized avatar
:shipit:
Shipping

Mehdi Zakaria Benadel Murazaki

:shipit:
Shipping
View GitHub Profile
@Murazaki
Murazaki / sendmail.php
Last active October 14, 2016 14:31
Simple Send Mail PHP from POST variables
<?php
$to = isset($_POST["to"])? $_POST["to"] : ''; // 'personne@example.com';
$subject = isset($_POST["subject"])? $_POST["subject"] : ''; // 'le sujet';
$message = isset($_POST["message"])? $_POST["message"] : ''; // 'Bonjour !';
$headers = 'From: '.( isset($_POST["from"])? $_POST["from"] : '') .'\r\n' . // 'From: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
echo mail($to, $subject, $message, $headers);
@Murazaki
Murazaki / CmderCmdPromptZshAgnosterLike.md
Last active August 1, 2019 09:40
Cmder cmd prompt customization zsh agnoster-like based on https://amreldib.com/blog/CustomizeWindowsCmderPrompt/

How to Install

  • Download Powerline Fonts, or get SourceCode Pro, Hack or else from Nerd Fonts (recommended)
  • Change Cmder fonts in Cmder settings (General > Fonts). Make sure the font charset is set to ANSI.

NB: Remember to backup every config files you will modify

  • Change Cmder/vendor/init.bat file with the one provided
  • Replace Cmder/config/git.lua file with the one provided and add prompt.lua in the same folder
  • Make sure Cmder loads cmd with init.bat, for instance, like this :
@Murazaki
Murazaki / update-jenkins-version-docker.sh
Last active February 20, 2022 16:25
Script to update jenkins.war to latest when using Jenkins docker
#! /bin/sh
backup_folder="./backup"
jenkins_war="./jenkins.war"
backup_name="jenkins.war.$(date +"%Y_%m_%d_%H_%M_%S")"
mkdir -p $backup_folder
if [ "$(ls -A $backup_folder)" ]; then
latest_backup=$(ls -t1 $backup_folder | head -n 1)