Skip to content

Instantly share code, notes, and snippets.

View jperocho's full-sized avatar

John Mark Perocho jperocho

View GitHub Profile
@jperocho
jperocho / .zshrc 2
Created July 18, 2023 07:03
My .zshrc config V2
# Colors
autoload -Uz colors
colors
export TERM="xterm-256color"
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt INC_APPEND_HISTORY_TIME
@jperocho
jperocho / generateKey.sh
Created March 18, 2023 16:30
Generate RS256 key for jwt
ssh-keygen -t rsa -b 4096 -m PEM -f private_key.pem
openssl rsa -in private_key.pem -pubout -outform PEM -out public_key.pem
@jperocho
jperocho / E480_Fedora_37_iwlwifi.md
Last active February 21, 2023 04:27
How to fix iwlwifi firmware error "no suitable firmware found!" in Linux in Thinkpad E480 Fedora 37

How to Fix iwlwifi Firmware Error "no suitable firmware found!" in ThinkPad E480 Fedora 37

If you encounter the "no suitable firmware found" error for iwlwifi in Fedora Linux on a ThinkPad E480, you can follow the steps below to fix it.

Prerequisites

Before proceeding with the steps, make sure you have the following:

  • A ThinkPad E480 running Fedora 37
  • An internet connection
@jperocho
jperocho / setup-wp-lemp.sh
Last active February 1, 2023 16:01
Rocky Linux: Install latest Wordpress Lemp with PHP 8.0
#!/bin/bash
# This script is for Rocky Linux or any same distribution
# Caution: This script is designed for a fresh installation of Rocky Linux. If you already have a WordPress installation on your server, it is not suitable for your use case and it will overwrite your existing installation. Use it at your own risk, as it may cause unintended consequences.
#
# How to run:
# curl -o setup-wp-lemp.sh https://gist.githubusercontent.com/jperocho/e42b510d3236fcb7de5b55657a386243/raw/setup-wp-lemp.sh && chmod +x setup-wp-lemp.sh && ./setup-wp-lemp.sh
# Install the yum-plugin-fastestmirror package
sudo yum install yum-plugin-fastestmirror -y
@jperocho
jperocho / .vimrc
Last active May 19, 2022 10:46
Minimal vimrc for vim 8.2
" Plugin Manager Plug
call plug#begin()
" Javascript plugins
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'w0rp/ale'
call plug#end()
syntax on " Syntax on
let g:vim_jsx_pretty_colorful_config=1
@jperocho
jperocho / .zshrc
Last active May 18, 2022 00:21
Basic zshrc that works
# Zsh plugins
. ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# Brew path
export PATH=$PATH:/usr/local/lib/pkgconfig
# Python 3 path brew install
export PATH=$PATH:/usr/local/opt/python@3.9/libexec/bin/
@jperocho
jperocho / keybindings.json
Last active April 15, 2022 21:29
Key Bindings for VS Code: Using CTL + ALT + [ h, j, k, l ] to navigate like vim
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+alt+k",
"command": "cursorUp",
"when": "textInputFocus"
},
{
"key": "up",
"command": "cursorUp",
du -x -d1 -h /var/lib/mysql | sort -rh
@jperocho
jperocho / newuser.sql
Created June 2, 2020 03:25
Create administrator account in wordpress via mysql ssh terminal
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('newadmin', MD5('pass123'), 'firstname lastname', 'email@example.com', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');
@jperocho
jperocho / checksum
Created May 26, 2020 13:14
Check sha256 hash value
#!/usr/bin/env bash
FILE=$1
HASH=$2
[ -z "$FILE" ] && echo "Please provide valid file"
if [ -f "$FILE" ]; then
FILESUM=$(shasum -a 256 $FILE | cut -f 1 -d ' ' | grep '[a-f0-9]')