Skip to content

Instantly share code, notes, and snippets.

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

Dennis A. Torres Rodriguez d70rr3s

🏠
Working from home
View GitHub Profile
@d70rr3s
d70rr3s / install-notes.md
Last active May 8, 2018 20:55
Customize step-by-step an Ubuntu local machine (for web developers)

Intro

Some personal notes for customize my local Ubuntu machine for work (web development mainly), includes tools a some tweaks. Before anything else lets just create a .tmp dir for .deb and source files.

mkdir -p ~/.tmp
cd .tmp

OS settings

Removing guest session

#!/usr/bin/env bash
# Installer script
# -----------------------------------------------
# This script is responsible for creating proper
# directories and files and the installation of
# ansible package any other dependencies needed
# and executing provitioning playbook.
# -----------------------------------------------
echo \ \ \ \
@d70rr3s
d70rr3s / deflate.conf
Created August 17, 2018 09:52
GZip configuration
LoadModule deflate_module modules/mod_deflate.so
LoadModule filter_module modules/mod_filter.so
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
# Set compression level
DeflateCompressionLevel 9
# Compress these named file types
AddOutputFilterByType DEFLATE text/html
@d70rr3s
d70rr3s / poc.php
Created January 9, 2019 11:02
Merge two no-assoc arrays without array_merge
// Using array_merge inside loops is a greedy construction, also cannot
// sum arrays since their indexes are the same.
// @see https://stackoverflow.com/a/37065301
@array_push($arr1, ...$arr2);
@d70rr3s
d70rr3s / drush-reset-post-update.sh
Created August 5, 2020 17:39
Reset a Drupal post-update using Drush
drush php:eval '$update_hook_name = "POST_UPDATE_NAME"; $key_value = \Drupal::keyValue('post_update'); $existing_updates = $key_value->get('existing_updates'); $index = array_search($update_hook_name,$existing_updates); unset($existing_updates[$index]); $key_value->set('existing_updates', $existing_updates);'
@d70rr3s
d70rr3s / docker-compose.override.yml
Created February 2, 2021 15:16
Configure contenerized PHP (wodby/php) + Xdebug 3 + PHPStorm
version: "3"
services:
php:
environment:
PHP_XDEBUG: 1
PHP_XDEBUG_MODE: debug
PHP_XDEBUG_START_WITH_REQUEST: "yes"
PHP_IDE_CONFIG: serverName=phpstorm
PHP_XDEBUG_IDEKEY: "phpstorm"
PHP_XDEBUG_CLIENT_HOST: host.docker.internal
INSERT INTO ps_access SELECT 1, `ar`.`id_authorization_role` FROM `ps_authorization_role` ar
LEFT JOIN ps_access a ON( ar.id_authorization_role = a.id_authorization_role AND a.id_profile = 1)
WHERE a.id_profile IS NULL
@d70rr3s
d70rr3s / .gitconfig
Created June 17, 2021 12:14
My Git configuration
# This is Git's per-user configuration file.
[alias]
last = log -1 --stat
cp = cherry-pick
co = checkout
cl = clone
ci = commit
cin = commit --no-verify
st = status -sb
br = branch
@d70rr3s
d70rr3s / README.md
Created September 2, 2021 22:56 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp

Keybase proof

I hereby claim:

  • I am d70rr3s on github.
  • I am d70rr3s (https://keybase.io/d70rr3s) on keybase.
  • I have a public key ASBXnGzDGb0MBBybQgWWdWwME1WJTbykN--UztBHl1JOcgo

To claim this, I am signing this object: