Skip to content

Instantly share code, notes, and snippets.

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

Jose Diaz xoxefdp

🏠
Working from home
View GitHub Profile
@xoxefdp
xoxefdp / PHP composer tools.md
Created June 27, 2024 12:47 — forked from davebarnwell/PHP composer tools.md
Global installation of PHP tools with Composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
@xoxefdp
xoxefdp / nodejs_installer.ps1
Created April 25, 2023 10:40 — forked from nweldev/nodejs_installer.ps1
Powershell script installing nodejs (with git) and some npm packages
write-host "`n ## NODEJS INSTALLER ## `n"
### CONFIGURATION
# nodejs
$version = "4.4.7-x64"
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi"
# git
$git_version = "2.9.2"
@xoxefdp
xoxefdp / MC Cheat Sheet
Created October 23, 2021 15:35 — forked from samiraguiar/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
Main View
---------------------------------------------------------------
- File/directory operations
F3 View file
Shift + F3 View raw file (disregard extension)
F5 Copy selected files
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@xoxefdp
xoxefdp / full_php_browscap.php
Last active November 1, 2019 22:04
Fixes wrong formatted browsercap.ini file from https://browscap.org (PHP Versions)
<?php
// https://browscap.org/stream?q=Full_PHP_BrowsCapINI
$full_php_browscap = file('full_php_browscap.ini');
// Let\'s Encrypt flag
$count = 0;
foreach( $full_php_browscap as &$row ) {
if ( $row[ 0 ] == '[' ) {
@xoxefdp
xoxefdp / install_mysql.sh.sh
Created November 1, 2019 17:01
MySQL installation script for debian based systems
#!/bin/bash
# Check if ran with root permissions
if [ "$(id -u)" != 0 ]; then
printf "The script must be run as root! (you can use sudo) \n"
exit 1
fi
if [[ $# -eq 1 ]]; then
DBPASSWORD=$1
@xoxefdp
xoxefdp / install_mariadb.sh.sh
Created November 1, 2019 16:55
MariaDB install script for debian based systems
#!/bin/bash
# customize with your own.
options=("10.1 [Stable]" "10.2 [Stable]" "10.3 [Stable] (recommended)" "10.4 [Alpha]")
SELECTED=""
VERSIONS=("10.1" "10.2" "10.3" "10.4")
menu() {
echo "MariaDB available options:"
@xoxefdp
xoxefdp / checkFileDupes.js
Created June 18, 2019 20:25 — forked from kebman/checkFileDupes.js
Check for duplicate files with Node.js
// find duplicate files with Node.js, cuz, you know, it's useful
var Promise = require('bluebird');
var fs = Promise.promisifyAll(require('fs'));
var crypto = require('crypto');
var path = require('path');
var pathA = "."; // folder you're in, wherever that might be
var pathB = "/path/to/the/directory/you/want/to/compare/it/to"; // yes, yes, argv, etc, but I haven't bothered yet, ok!
# Get info about all Contexts in ldap
ldapsearch -x -H ldap://localhost -b "" -s base configContext namingContexts monitorContext
# display cn=config structures and data
ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn=config"
# or
slapcat -b cn=config > config.ldiff
# modify config