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 / 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 / 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 / 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 / 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 / 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

Keybase proof

I hereby claim:

  • I am mario21ic on github.
  • I am mario21ic (https://keybase.io/mario21ic) on keybase.
  • I have a public key whose fingerprint is 4C41 EF0F 7FC2 73AE 7AD6 DE28 9DCF 4860 704D 32C0

To claim this, I am signing this object:

@mario21ic
mario21ic / .vimrc
Created February 23, 2017 15:14
Configuration personal of vim based in https://github.com/fisadev/fisa-vim-config
" ============================================================================
" Vim-plug initialization
" Avoid modify this section, unless you are very sure of what you are doing
let vim_plug_just_installed = 0
let vim_plug_path = expand('~/.vim/autoload/plug.vim')
if !filereadable(vim_plug_path)
echo "Installing Vim-plug..."
echo ""
silent !mkdir -p ~/.vim/autoload
@mario21ic
mario21ic / addhosts.sh
Created February 28, 2017 13:56
Script to add hosts into /etc/hosts from source file
#!/bin/bash
IP=$1
LINE_RESULT=$IP" "
while read line; do
LINE_RESULT=$LINE_RESULT" "$line
done < $2
sudo echo $LINE_RESULT >> /etc/hosts
@mario21ic
mario21ic / nginx.conf
Created March 29, 2017 22:33 — forked from cpswan/nginx.conf
Using nginx to proxy to an AWS ELB
daemon off;
worker_processes 1;
events { worker_connections 1024; }
http{
sendfile on;
@mario21ic
mario21ic / Jenkinsfile
Created April 5, 2017 15:39 — forked from cyrille-leclerc/Jenkinsfile
Jenkinsfile - game-of-life - aws beanstalk
#!groovy
docker.image('cloudbees/java-build-tools:0.0.6').inside {
checkout scm
def mavenSettingsFile = "${pwd()}/.m2/settings.xml"
stage 'Build'
wrap([$class: 'ConfigFileBuildWrapper',