Skip to content

Instantly share code, notes, and snippets.

@daniDLL
daniDLL / show-queries-real-time
Last active March 2, 2020 15:47
Show executed queries in real time
## Show real-time
watch -n1 'mysql -u root -ppassword --execute="SHOW FULL PROCESSLIST"'
## Show real-time and pipe all info to file
watch -t -n1 '(mysql -h dbhost -u dbuser dbname -ppassword --execute="SHOW FULL PROCESSLIST") | tee -a mysql-process-list.log'
## Show slow queries real-time and pipe all info to file
watch -t -n1 '(mysql -h dbhost -u dbuser dbname -ppassword --execute="SELECT * FROM information_schema.processlist WHERE TIME > 5 ORDER BY TIME DESC") | tee -a /tmp/mysql-process-list.log'
@daniDLL
daniDLL / alias-create-password
Created November 22, 2019 10:33
Alias to Create Random Passwords
alias create_password="</dev/urandom tr -dc '1234567890!@#$%&;:.-_[]qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMG' | head -c16; echo ''"
@daniDLL
daniDLL / git-clean-local-branches
Created June 19, 2019 10:10
Git clean local branches that are not on remote anymore
git branch -vv | grep -E "desaparecido|gone" | awk '{print $1}' | xargs -n1 git branch -d
@romainl
romainl / grep.md
Last active April 28, 2024 19:53
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

@levsthings
levsthings / docker-ce-ubuntu-17.10.md
Last active April 13, 2023 21:05
Install Docker CE on Ubuntu 17.10

Installing Docker CE on Ubuntu 17.10 Artful Aardvark

As of 20/10/2017, a release file for Ubuntu 17.10 Artful Aardvark is not available on Download Docker.

If you are used to installing Docker to your development machine with get-docker script, that won't work either. So the solution is to install Docker CE from the zesty package.

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@jacobtomlinson
jacobtomlinson / minikube-update-hosts.sh
Last active October 26, 2022 15:50
A script to update your /etc/hosts file from minikube ingest records
#!/bin/bash
#
# A script to update your /etc/hosts file from minikube ingest records
#
# Installation
# ------------
# curl -L https://gist.github.com/jacobtomlinson/4b835d807ebcea73c6c8f602613803d4/raw/minikube-update-hosts.sh > /usr/local/bin/minikube-update-hosts
# chmod +x /usr/local/bin/minikube-update-hosts
set -e
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active February 6, 2024 20:57
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@adamzaninovich
adamzaninovich / neovim-setup.md
Last active February 13, 2024 11:24
How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

Example

Installing neovim

brew install neovim/neovim/neovim