Skip to content

Instantly share code, notes, and snippets.

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

Helmer helmerdavila

🏠
Working from home
View GitHub Profile
@helmerdavila
helmerdavila / profile.jsonc
Last active April 14, 2020 05:59
Windows terminal config (Requires ubuntu)
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"profiles": {
"defaults": {
// Put settings here that you want to apply to all profiles
},
"list": [
@helmerdavila
helmerdavila / launch_server.bat
Created June 9, 2019 22:03
Run Java Minecraft server script (Windows 10)
:: Save this in your Minecraft server folder as launch_server.bat
:: Then. Right click in this file and Run as admin
:: Update the ram memory values below as you want
cd %~dp0
java -Xms2048M -Xmx3084M -jar %~dp0server.jar nogui
pause
<?php
namespace App\Traits;
/**
* Trait SecureUpdatable
* Allows to secure update without override the existing fields in a model
* This dependes on the $fillable and $guarded attributes too
* @package App\Traits
*/
@helmerdavila
helmerdavila / .zshrc
Last active September 16, 2021 15:20
🤑 ZSH CONFIG HELMER 🤑
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Langs (required for Python)
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
@helmerdavila
helmerdavila / mysql_sock_error.md
Created August 2, 2018 05:48
Mysql sock error

First uninstall mysql

brew uninstall mysql@5.7

Delete the folders/files that were not removed

rm -rf /usr/local/var/mysql
rm /usr/local/etc/my.cnf

Reinstall mysql and link it

@helmerdavila
helmerdavila / command.sh
Created June 8, 2018 20:17
Keep alive the ssh session
ssh -o TCPKeepAlive=yes -o ServerAliveInternal=100 -i {YOUR_KEY} user@server
@helmerdavila
helmerdavila / instructions.md
Last active April 30, 2018 16:58
Increase RAM (memory_limit) and execution time in php.ini
  1. Edit with vim /usr/local/etc/php/7.2/conf.d/php-memory-limits.ini
  2. Change the number to 1024 and save
  3. Edit with vim /usr/local/etc/php/7.2/php.ini
  4. Change max_execution_time = 600
@helmerdavila
helmerdavila / mix-function-adonis.md
Last active April 17, 2018 22:22
Laravel Mix function for Adonis Edge views

Use this code in start/hooks.js

const { hooks } = require('@adonisjs/ignitor');
// Import the mix manifest file
const manifest = require('../public/mix-manifest');

hooks.after.providersBooted(() => {
  const View = use('View');

 // Creating the mix function in edge views
@helmerdavila
helmerdavila / facebook_warning.html
Created January 4, 2018 00:17 — forked from tosbourn/facebook_warning.html
How to recreate Facebook's console warning
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;';
const warningDescCSS = 'font-size: 18px;';
@helmerdavila
helmerdavila / laravel_forge_security.md
Created May 16, 2017 01:35
Laravel Forge Security after provisioning

I install some of the following software to help me debug and make it more secure.

sudo apt-get install fail2ban bwm-ng htop iotop iftop nethogs tcptrack

fail2ban - blocks failed logins for a number of services (a must for me) bwm-ng - bandwidth monitor (generally good to see the traffic on a server) htop - updated top command to see CPU/RAM/processes running (just nicer) iotop - see disk usage and the process (handy for checking problems)