Skip to content

Instantly share code, notes, and snippets.

View omaryoussef's full-sized avatar
🍎

Omar omaryoussef

🍎
View GitHub Profile
@omaryoussef
omaryoussef / Create_Laravel_Pipeline.txt
Last active December 13, 2023 13:25
Creates a Filebeat pipeline to ingest Laravel Monolog/log lines.
PUT _ingest/pipeline/laravel
{
"description": "Parses Laravel log files.",
"processors": [
{
"rename": {
"field": "message",
"target_field": "event.original"
}
},
@omaryoussef
omaryoussef / .shell_utilities.zsh
Last active August 17, 2019 17:33
Add Ctrl+P functionality to the ZSH command line
# Adds Ctrl+P funcionality similar to Ctrl+T in fzf to open a file directly in vim from the command line
command -v fzf >/dev/null 2>&1 || { exit 0; }
# Optional to use Ripgrep, comment this out if otherwise
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --glob "!{.git,node_modules}/*"'
fzf-ctrlp-widget() {
local file="$(__fsel)"
local ret=$?
@omaryoussef
omaryoussef / gist:553fe0e0ee3c708303d04b7e1e41a392
Created August 14, 2019 14:42
Generate Self-Signed Certificates
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 730
@omaryoussef
omaryoussef / laravel-debug-all.sh
Created July 2, 2019 20:56
Tmux Script to tail all Laravel logs
#!/bin/bash
TMUX_TAIL=$(which "tmux-tail-f.sh") || { echo "This script requires tmux"; exit 1; }
LARAVEL_DATE=`date +%Y-%m-%d`
sudo $TMUX_TAIL -t "./storage/logs/laravel-worker.log" "./storage/logs/laravel-${LARAVEL_DATE}.log" "/var/log/nginx/error.log" "/var/log/nginx/access.log"
@omaryoussef
omaryoussef / tmux-tail-f.sh
Last active March 1, 2022 15:00
Tail multiple files with Tmux
#!/bin/bash
# By mapio
# https://github.com/mapio/tmux-tail-f/blob/master/tmux-tail-f
TMUX=$(type -p tmux) || { echo "This script requires tmux"; exit 1; }
SESSION="$TMUX-tail-f-$$"
NOKILL=0