Skip to content

Instantly share code, notes, and snippets.

View agarzon's full-sized avatar
🕶️
Hunting bugs....

AG agarzon

🕶️
Hunting bugs....
  • Zend Certified Engineer
  • Canada, Montreal
View GitHub Profile
@agarzon
agarzon / docker-compose.yml
Last active August 5, 2021 20:10
My docker-compose.yml for development
gitlab:
image: 'gitlab/gitlab-ce:latest'
container_name: gitlab
restart: always
hostname: 'gitlab.mcu.dc'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.mcu.dc:8090'
gitlab_rails['gitlab_shell_ssh_port'] = 2290
gitlab_rails['smtp_enable'] = true
@agarzon
agarzon / mysql_backup.sh
Last active April 21, 2021 12:46
Mysql Backup ALL databases
#!/bin/bash
TIMESTAMP=$(date +'%Y-%m-%d_%Hh%Mm')
BACKUP_FOLDER=/mnt/backup/mysql
MYSQL_USER=admin
MYSQL_PASS=`cat /etc/psa/.psa.shadow`
MAX_DAYS=15
DATABASES=`mysql --user=$MYSQL_USER -p$MYSQL_PASS -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"`
mkdir -p "$BACKUP_FOLDER"
@agarzon
agarzon / senderscore.sh
Created February 10, 2017 16:54
Check Sender Score from IP using command line. bash script
#!/usr/bin/env bash │ject-with tcp-reset
# usage: ./senderscore.sh 74.91.28.11
if [ -z "$1" ]
then
echo "IP is missing as arguemnt."
exit
fi
IP=$1
@agarzon
agarzon / index.php
Last active January 10, 2021 01:03
WHMCS server status script
<?php
/*
*************************************************************************
* *
* WHMCS - The Complete Client Management, Billing & Support Solution *
* Copyright (c) WHMCS Ltd. All Rights Reserved, *
* Release Date: 24th November 2011 *
* Version 5.0 *
* *
*************************************************************************
@agarzon
agarzon / letsencrypt-hostname.sh
Created June 3, 2016 19:01 — forked from xgin/letsencrypt-hostname.sh
Secure plesk clean installation with hostname certificate by Let's Encrypt
#!/bin/bash -e
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
### Secure plesk clean installation with hostname certificate by Let's Encrypt
export PYTHONWARNINGS="ignore:Non-standard path"
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"}
HOSTNAME=$(hostname)
# Use staging server for testing
# --server https://acme-staging.api.letsencrypt.org/directory
@agarzon
agarzon / emailXtractor.php
Created July 16, 2012 14:46
Extract all email address from any text content removing duplicated, and exporting as TEXT, SQL or CSV
<?php
/**
*
* Extract all email address from any text content removing duplicated
* Return string formated as: TEXT, SQL or CSV
* @author Alexander Garzon
*
*/
class emailXtractor {
@agarzon
agarzon / dnsBulk.sh
Created October 6, 2014 21:15
Plesk, DNS Bulk Apply Settings
#!/bin/sh
ADMIN_PASS=`cat /etc/psa/.psa.shadow`
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk '{print $2}'`
PRODUCT_ROOT_D=`grep PRODUCT_ROOT_D /etc/psa/psa.conf | awk '{print $2}'`
mysql="${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa"
query="select name from domains;"
domains=`echo $query | $mysql `
@agarzon
agarzon / html2txt.php
Created October 15, 2013 19:46
PHP Text Browser
<?php
header("Content-Type: text/plain");
function strip_html_tags( $text )
{
$text = preg_replace(
array(
// Remove invisible content
'@<head[^>]*?>.*?</head>@siu',
'@<style[^>]*?>.*?</style>@siu',
@agarzon
agarzon / winds.lua
Created May 2, 2019 12:26
lua script x-plane visual helper
require("graphics")
local window_x = 40 -- Display position from right edge of window
local window_y = 40 -- Display position from top edge of window
local show_wind = false
DataRef("WIND_DIR", "sim/cockpit2/gauges/indicators/wind_heading_deg_mag", "readonly")
DataRef("WIND_SPEED", "sim/cockpit2/gauges/indicators/wind_speed_kts", "readonly")
DataRef("HEADING", "sim/flightmodel/position/psi", "readonly")
@agarzon
agarzon / plesk.sql
Last active January 9, 2019 11:30
Generate report with all domains by client and plan (plesk)
SELECT domains.name as domain, Templates.name as plan, domains.status, clients.type, clients.login, clients.pname, clients.email, clients.external_id, Subscriptions.locked, Subscriptions.synchronized, Subscriptions.custom
FROM domains
LEFT JOIN clients ON domains.cl_id = clients.id
LEFT JOIN Subscriptions ON domains.id = Subscriptions.object_id AND Subscriptions.object_type = 'domain'
LEFT JOIN PlansSubscriptions ON Subscriptions.id = PlansSubscriptions.subscription_id
LEFT JOIN Templates ON PlansSubscriptions.plan_id = Templates.id
WHERE clients.type = 'client'
AND clients.parent_id = '1'
AND domains.parentDomainId = '0'
INTO OUTFILE '/tmp/domains-client.csv';