Skip to content

Instantly share code, notes, and snippets.

View apermuy's full-sized avatar
💭
I may be slow to respond.

Alberto Permuy Leal apermuy

💭
I may be slow to respond.
View GitHub Profile
@eSkiSo
eSkiSo / install_oci8_ubuntu20_php7.4.md
Created March 12, 2021 16:05
Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4
@ismailyenigul
ismailyenigul / nginx-traefik-v2-docker-compose.yml
Last active May 4, 2024 22:59
nginx and traefik v2 deployment with docker-compose
1. create a network with docker network create NETWORKNAME
2. Create letsencrypt directory for acme.json ie /docker/letsencrypt directory or somewhere else mkdir -p /docker/letsencrypt
3. I configured http -> https redirect
# cat docker-compose.yml
version: '3.3'
services:
traefik2:
image: traefik
#!/usr/bin/env bash
apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \
libgoogle-perftools-dev google-perftools jq gcc zlib1g-dev
mkdir /tmp/ngxbuild
cd /tmp/ngxbuild
ng_cookies=$(curl -s http://hg.nginx.org/nginx/tags|grep cookie|cut -f 2 -d '"'|tr -d '\n')
latestNginx=$(curl --cookie ${ng_cookies} -s http://hg.nginx.org/nginx/tags|grep "^ *release-" | head -1 | cut -c 9-)
echo "found: ${latestNginx}"
latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases |
@bdlangton
bdlangton / Blocks.md
Last active October 12, 2023 08:40
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@jeffersonmartin
jeffersonmartin / composer-private-package-github-token.md
Last active April 11, 2024 11:22
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

@fevangelou
fevangelou / my.cnf
Last active May 8, 2024 04:56
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#

Oh My Fish Plugins

ansible: Ansible development package for Oh My Fish

apt: Short and friendly command wrapper for APT

battery: OS X and Linux compatible battery utilities

brew: Oh My Fish plugin to integrate Homebrew paths into shell.

@rohityadavcloud
rohityadavcloud / my.cnf
Created July 27, 2015 10:19
Example MySQL my.cnf optimized
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
syslog
@ryane
ryane / five_minutes.yml
Created February 24, 2015 15:15
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@schankam
schankam / drupal_redis_setup.md
Last active December 13, 2019 16:05
Drupal 7.x Redis Setup

Global overview

This guide gives you all the needed instructions to get a working Redis installation used as a Drupal Caching Backend. The following given commands assume that your server is running under a Debian/Ubuntu installation, using Apache2 as a webserver and that you have Drush installed.

Installing the Redis Server

In a terminal console, type the following command:
sudo apt-get install redis-server

Once installed, you can check if Redis is correctly installed and run by entering: