Skip to content

Instantly share code, notes, and snippets.

View 50l3r's full-sized avatar
🏠
Working from home

50l3r 50l3r

🏠
Working from home
View GitHub Profile
@50l3r
50l3r / script.js
Created May 14, 2024 10:38
Export only whitelisted tables on PHPMyAdmin
const wlist = ['table_name', 'table_name_2']
$('.export_table_select input').each(function () {
const self = $(this)
const type = self.attr('type')
const isCheckAll = self.hasClass('checkall')
if (type === 'checkbox' && !isCheckAll) {
const table = self.val()
const isWhitelist = wlist.includes(table)
@50l3r
50l3r / commands.sh
Last active May 18, 2023 12:18
Comandos útiles de linux
# Buscar y remplazar string en carpeta actual
find . -type f -exec sed -i 's,//dominio.com,//new.dominio.com,g' {} \;
# Buscar y remplazar string en carpeta especificada
grep -rnw '/var/www/vhosts/' -e 'dominio.com'
@50l3r
50l3r / cloneWP.sh
Last active December 16, 2021 18:30
Clone Wordpress on a PLESK instance
#!/bin/bash
# VARS
ORIG_DOMAIN="example.com"
ORIG_FOLDER="/var/www/vhosts/example.com/httpdocs"
ORIG_DB_USER=""
ORIG_DB_PASS=''
ORIG_DB_NAME=""
DEST_DOMAIN="beta.example.com"
@50l3r
50l3r / 50l3r.omp.json
Last active November 14, 2021 14:06
Oh My Posh Custom Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": true,
"osc99": true,
"console_title": true,
"console_title_style": "template",
"console_title_template": "{{if .Root}} ⚡ {{end}}{{.Folder | replace \"~\" \"🏠\"}} @ {{.Host}}",
"blocks": [
{
"type": "prompt",
@50l3r
50l3r / terminalConfig.json
Last active June 9, 2024 13:25
Windows Terminal Config
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "newTab",
"index": 3
},
"keys": "ctrl+4"