Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
ps -eo pid,ppid,%mem,%cpu,comm --sort=-%cpu | head | |
# Result : | |
# | |
# PID PPID %MEM %CPU COMMAND | |
# 948934 948837 2.9 44.4 spotify | |
# 948781 1 2.9 27.5 spotify | |
# 948876 948836 1.5 9.2 spotify | |
# 80755 1 7.5 5.3 firefox | |
# 948919 948781 1.1 3.6 spotify |
# encode | |
echo [email protected] | base64 | |
# decode | |
echo BASE64_CODE | base64 -d |
grep -Ril "text-want-to-find" <directory> | |
# -i for ignore case | |
# -R for recursive | |
# -l for show the file name | |
# Example: | |
# In my case, I forgot the location of my mirrors config | |
# but I remember what mirrors i used | |
grep -Ril "aliyun" /etc |
exports.validateRegister = async (ctx, next) => { | |
const data = ctx.req.body; | |
const e = (data) => !!data.email && isEmail(data.email); | |
const p = (data) => !!data.password; | |
const n = (data) => !!data.name; | |
const checks = [e, p, n]; | |
const isPass = (check) => check(data); |
import {createStore} from 'redux'; | |
// STORE -> GLOBALIZED STATE | |
// ACTION | |
// like restaurant menu | |
const increment = () => { | |
return { | |
type: 'INCREMENT' | |
} |
let say you are doing web development:
<a href="www.google.com">link</a>
we want to change the google link to github link. we use h j k l move to href, and then press "v" to select the google link, press "c" to change it to 'www.github.com" Instead, we can just type below at the line any position
c i "
remove Lock = Caps_Lock | |
keysym Escape = Caps_Lock | |
keysym Caps_Lock = Escape | |
add Lock = Caps_Lock | |
# usage | |
# xmodmap ~/.swapper |
finder(){ | |
du -a $1 | awk '{print $2}' | fzf | xargs -r $EDITOR | |
} | |
# Usage: | |
# finder {folder} | |
# eg: finder .config |
Recode video screen size 1366x768, rate 25, audio input by default, Output video call output.mkv
ffmpeg -video_size 1366x768 -framerate 25 -f x11grab -i :0.0 -f pulse -ac 2 -i default output.mkv