Skip to content

Instantly share code, notes, and snippets.

View ederrafo's full-sized avatar

Eder Rafo Jose Pariwana Espinhal ederrafo

View GitHub Profile
@ederrafo
ederrafo / git-working-history
Created September 28, 2016 22:30 — forked from gabro/git-working-history
Github-like working directory history
#!/bin/bash
FILES=`git ls-tree --name-only HEAD .`
MAXLEN=0
IFS=$(echo -en "\n\b")
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
@ederrafo
ederrafo / vagrant-vagrantfile.md
Last active August 14, 2022 02:04
vagrant vagrantfile devops virtual machine

Vagrantfile

rsync -> permite total control de la carpeta compartida pero no hay sincronizacion entre el host SO y el SO guest

config.vm.synced_folder "../../Data", 
			"/var/www/html", 
			:mount_options => ['dmode=775', 'fmode=777'], 
			type: "rsync"
config.vm.provider "virtualbox" do |vb|
	 vb.name   = "php7" -> this is the VM NAME
end
@ederrafo
ederrafo / osx.md
Last active March 3, 2019 17:15
macbook pro, OS X Yosemite, apple, mac
  • Equivalent of Linux's wget: $ curl "http://127.0.0.1:8000" -o "outfile" curl in OS X Mavericks expects quotation marks for URL and for output filename, especially if the URL has parameters.

  • Suprimir: Fn + Borrar

  • How can I see my home folder in the finder? Shift+Command+H takes you to your home folder Command+UpArrow takes you one folder up

Check mods installed ok using "pear list" and "php -m"
=== php5 ===
# PDO drivers (mandatory for Propel and Doctrine)
$ apt-get install php5-sqlite
$ php --ini
=== php7 ===
$ apt-get install libapache2-mod-php7.0
@ederrafo
ederrafo / symfony-1.txt
Last active June 20, 2017 20:50
php symfony
=== Symfony 1.3.0 ===
* Comprueba que Symfony se ha instalado correctamente usando la línea de comandos para mostrar la versión:
$ php lib/vendor/symfony/data/bin/symfony -V
* Ver una lista de las opciones y las tareas disponibles:
$ php symfony
* Creacion del proyecto
$ php lib/vendor/symfony/data/bin/symfony generate:project jobeet
@ederrafo
ederrafo / php-consume-webservice-with-nusoap.php
Last active November 10, 2016 21:58
php webservice SOAP nusoap library
<?php
define("URI_FLIGHTS", "http://10.0.0.1:80/flightsService/flights?wsdl");
$nusoap_client = new nusoap_client(URI_FLIGHTS, true);
$nusoap_client->soap_defencoding = 'utf-8';
$nusoap_client->useHTTPPersistentConnection();
if( $nusoap_client->getError() ) {
$nusoap_client->getError();
} else {
$request = '
@ederrafo
ederrafo / apache2-logs.txt
Last active December 5, 2016 22:49
apache2 logs
==== Formato de Registro Combinado (Combined Log Format) ====
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
CustomLog log/access_log combined
Ejemplo:
190.239.139.73 v - - [14/Nov/2016:09:20:50 -0500] "GET /js/plugins/fileupload/bootstrap-fileupload.min.js HTTP/1.1"200 1911 "http://admin.costamaragencias.com/es/user/panel""Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
190.239.139.73 ==> (%h): ip cliente
- ==> (%l): Un "guión" siginifica que la información que debería ir en ese lugar no está disponible.
En este caso, esa información es la identidad RFC 1413 del cliente determinada por identd en la
máquina del cliente. Esta información es muy poco fiable y no debería ser usada nunca excepto
@ederrafo
ederrafo / php-zf1.txt
Created November 16, 2016 23:30
php ZF
ZF1
- All resources for all modules were initialized on each request, and bootstrapping modules was an onerous task.
- Due to the difficulties, modules were never truly "plug-and-play", and thus no ecosystem ever evolved for sharing modules.
@ederrafo
ederrafo / linux-RHEL.txt
Last active November 18, 2016 19:07
this gist should help you transfer your knowledge to working with yum on Fedora/RHEL/CentOS/etc. fedora, centOS, redhat
==== REPOSITORIES ====
In Fedora - su nano /etc/yum.repos.d
To check your hostname run:
$ hostname
$ hostname -f
The first command should show your short hostname,
and the second should show your fully qualified domain name (FQDN).
@ederrafo
ederrafo / mysql.md
Last active October 26, 2022 13:35
mysql mariadb

Login

  $ mysql -u root -p

To connect, you just have to use whatever client you require, such as the basic mysql client.

  $ mysql -h localhost -u user database

Check version