Skip to content

Instantly share code, notes, and snippets.

View mario21ic's full-sized avatar
👋
Open to work

Mario IC mario21ic

👋
Open to work
View GitHub Profile
@mario21ic
mario21ic / tmux.conf
Last active April 5, 2017 20:38
Configuration personal of tmux based in http://rendon.x10.mx/?p=305
# Soporte para 256 colores.
set -g default-terminal "screen-256color"
# Soporte para Ctrl arrows
set-window-option -g xterm-keys on
# Cambiar PREFIX a Ctrl + a
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
@mario21ic
mario21ic / upgrade_php_mailer_vps.sh
Created January 7, 2017 21:34
Bash script to upgrade the class-phpmailer.php of Wordpress into a VPS
#!/bin/bash
wget https://raw.githubusercontent.com/PHPMailer/PHPMailer/master/class.phpmailer.php
find /home/*/public_html -name "class-phpmailer.php" > class-phpmailer.php.list
cat class-phpmailer.php.list | while read line; do
echo "cp -f class.phpmailer.php $line"
cp -f class.phpmailer.php "$line"
done
@mario21ic
mario21ic / git_remove_branches.sh
Last active November 16, 2016 15:17
Remove all unnecessary branches with prefix local and remote
#!/bin/bash
# Prefijo de las ramas a eliminar
PREFIX="APT"
# Sincroniza
git fetch origin --prune
# Limpia localmente
git branch|grep $PREFIX|xargs git branch -D
@mario21ic
mario21ic / t8.sh
Created April 6, 2016 00:19
tmux_8panel
#!/bin/bash
SESSION=$(basename `pwd`)
if [ -n "$1" ];
then
SESSION=$1
fi
tmux has-session -t $SESSION
if [ $? != 0 ]
@mario21ic
mario21ic / lamp.sh
Last active January 7, 2016 14:44
Script to start | stop | restart environment lamp
#!/bin/bash
ACTION='start'
if [ -n "$1" ];
then
ACTION=$1
fi
sudo /etc/init.d/apache2 $ACTION
sudo /etc/init.d/mysql $ACTION
@mario21ic
mario21ic / git_merge.sh
Created December 18, 2015 17:04
Script to merge branchs git
#!/bin/bash
if [ -z $1 ];
then
br_orig="master"
else
br_orig=$1
fi
if [ -z $2 ];
@mario21ic
mario21ic / gzip_s3_sync.sh
Last active April 6, 2017 16:51
Script to automatically compress and sync your bucket s3 hosted static website
#!/bin/bash
DIR=`pwd`
SRC_DIR=$1
BUCKET=$2
TMP_DIR="/tmp/gzsync"
mkdir -p $TMP_DIR
# check that we have a trailing slash
[[ $BUCKET != */ ]] && BUCKET="$BUCKET"/
@mario21ic
mario21ic / docker_cs
Created October 23, 2015 21:33
Command docker to delete containers with status exited
docker rm $(docker ps -aqf status=exited)
@mario21ic
mario21ic / git_conflicts.sh
Last active September 30, 2015 00:06
Script to verify conflicts after git merge
#!/usr/bin/env bash
git status | awk '/both modified/ {print $3}'|xargs grep -n "HEAD"
@mario21ic
mario21ic / dev.sh
Last active September 27, 2015 04:19
Script tmux to develop with 4 panels
#!/bin/bash
if [ -z $1 ];
then
session=$(basename `pwd`)
else
session=$1
fi
tmux has-session -t $session