Love this! I have some of my own collection as well. A mix of alias and functions.
# A nice little readme function, to make a README file into a webpage# usage: rmd path/to/README.md
rmd (){
grip -b$1 &
TASK_PID=$!sleep 10
kill$TASK_PID}# Takes a video and converts it to mp4 for web# usage: genwebmp4 path/to/video.ext# ffmpeg can handle many ext type so you are not limited (.mov, .avi and so on)
genwebmp4 (){
ffmpeg -i$1-vcodec h264 -acodec aac -strict-2$2}# Takes a video and converts it to webm for web# usage: genwebm path/to/video.ext# ffmpeg can handle many ext type so you are not limited (.mov, .avi and so on)
genwebm (){
ffmpeg -i$1-c:v libvpx-vp9 -b:v 2M -pass 1 -c:a libopus -f webm /dev/null &&\
ffmpeg -i$1-c:v libvpx-vp9 -b:v 2M -pass 2 -c:a libopus $2}#usage: genvideothumb path/to/video.ext
genvideothumb (){
ffmpeg -ss 00:00:01 -i$1-vframes 1 -q:v 2 $2}# for those who struggle spelling! This will take your best guess and give you a list of what you probably meant.#usage: spl paranoya # & paranoya 8 0: paranoia, Parana, paranoiac (as you see the first option after the 0, gives the correct spelling
spl (){
aspell -a<<<"$1"}#Clean up your git branches that have already been merged in.#usage: best to first do a git fetch --all and then run gitCleanBranches
gitCleanBranches(){
git branch --merged | egrep -v"(^\*|master|develop)" | xargs git branch -d}#usage: wavToMp3 path/to/file# no extension needed
wavToMp3(){
ffmpeg -i$1.wav -codec:a libmp3lame -qscale:a 2 $1.mp3
}#usage: mp3ToOgg path/to/mp3's# no extension needed
mp3ToOgg(){for file in*.mp3
do ffmpeg -i"${file}""${file/%mp3/ogg}"done}alias itunes='/usr/local/bin/itunes'alias storybook="start-storybook -p 9001 -c .storybook"alias ll='ls -al'alias dc='docker-compose 'alias dci='docker-compose images'alias dps='docker ps'alias dcreup='docker-compose down && docker-compose up --build'alias deleteMergedBranches='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'alias dstop='docker stop $(docker ps -a -q)'alias sf='bin/console ' //symfony console
alias memhog='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head'alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor'
I also use oh-my-zsh, with many of it's oh-my-zsh plugins. it's osx plugin is pretty awesome when working on mac, giving you ability to open current paths in the finder, or getting the current selected file in the finder, as a path in the terminal.
There are so many pluigns, you'll have to check out the oh-my-zsh plugins list.
There's also this monstrosity for building a new kernel in /root/.bashrc:
alias dokern='cd /usr/src/linux && mount /boot && make clean && make distclean && make mrproper && zcat /proc/config.gz > .config && make -j12 && make modules_install && make install && grub-mkconfig -o /boot/grub/grub.cfg && emerge -avt @module-rebuild && umount /boot && cd -'
I'm not even sorry. I had a similar line for cleaning up artifacts from an old kernel but it got gross enough to merit its own script.
In a similar vein to eup for emerge, there's Rust and OCaml toolchains:
alias cpsh='cat ~/.ssh/id_rsa.pub | pbcopy' # copy ssh key to clipboard (macOS)
alias ef='nvim ~/.config/fish/config.fish' # open fish config
alias eh='sudo nvim /private/etc/hosts' # edit hosts file
alias esh='nvim ~/.ssh/config' # edit SSH config
alias ev='nvim ~/.vimrc' # Edit vim config
alias serve='ruby -run -ehttpd . -p8000' # Quick static web server in current directory
alias whatsmyip='curl ifconfig.co' # Get my IP address
# Time warrior functions, these are all for time tracking with Time Warrior
alias tsi='timew summary :ids'
alias tsl='timew summary :lastweek :ids'
alias tsw='timew summary :week :ids'
My Fish functions (What fish uses instead of Alias)
# copy ssh key to clipboard (macOS)
function cpsh
cat ~/.ssh/id_rsa.pub | pbcopy
end
# open fish config
function ef
nvim ~/.config/fish/config.fish
end
# edit hosts file
function eh
sudo nvim /private/etc/hosts
end
# edit SSH config
function esh
nvim ~/.ssh/config
end
# Edit vim config
function ev
nvim ~/.vimrc
end
# Quick static web server in current directory
function serve
ruby -run -ehttpd . -p8000
end
# Time warrior functions, these are all for time tracking with Time Warrior
function tsi
timew summary :ids
end
function tsl
timew summary :lastweek :ids
end
function tsw
timew summary :week :ids
end
# Get my IP address
function whatsmyip
curl ifconfig.co
end
I don't believe in one character aliases. I utilize tabs to reduce keystrokes. My aliases are some per-configuration for tools. And some personalized tools are prefixed with fl_ or with flp_
#-------------------------------------------------------------
# Aliases for windows like functionality
#-------------------------------------------------------------
alias cmd="gnome-terminal"
alias cd..="cd .."
alias md="mkdir -p"
alias cls="clear"
alias ipconfig="ifconfig"
#-------------------------------------------------------------
# Aliases for sane functionality
#-------------------------------------------------------------
alias rm="rm -rf --preserve-root"
alias lla="ls -la --color=auto"
alias lsd="ls -d */ --color=auto"
alias lld="ls -ld */ --color=auto"
alias llf="ls -al --color=auto | grep '^[-l]'"
alias lsf="ls -a --color=auto | grep '^[-l]'"
alias cd-="cd -"
alias cd~="cd ~"
alias cdd="cd -P"
#-------------------------------------------------------------
# App Specific Aliases
#-------------------------------------------------------------
# Youtube-dl - dnf install youtube-dl ffmpeg ffmpeg-libs
alias youtube-dl-mp3="youtube-dl -x --audio-format mp3 "
alias youtube-dl-playlist="youtube-dl -cio '%(autonumber)s-%(title)s.%(ext)s' "
# Hub - https://hub.github.com/
alias git="hub"
#-------------------------------------------------------------
# Simple docker
#-------------------------------------------------------------
# Remove all the <none> images. Even though it is not recommended.
alias fl_docker_remove_dangling='docker rmi $(docker images -f dangling=true -q)'
# Stop all running docker containers.
alias fl_docker_stop_all='docker stop $(docker ps -aq)'
# Kill all running containers.
alias fl_docker_kill_containers='docker kill $(docker ps -q)'
# Delete all stopped containers: 'docker rm $(docker ps -a -q)'
alias fl_docker_clean_containers='docker container prune'
# Delete all saved images: 'docker rmi $(docker images -q)'
alias fl_docker_clean_images='docker image prune'
# Delete all containers and images
alias fl_docker_clean_all='docker system prune'
# Restart all containers
alias fl_docker_restart_all='docker restart $(docker ps -a -q)'
# Start all stopped containers:
alias fl_docker_restart_stopped='docker start $(docker ps -a -q -f status=exited)'
#-------------------------------------------------------------
# Better progressbar in axel
#-------------------------------------------------------------
alias axel="axel -d"
#-------------------------------------------------------------
# Mimic the behavior of Mac Open Command while preserving the
# errors generated.
# N.B. Replaced by much more roubust open function.
#-------------------------------------------------------------
#alias open="xdg-open &>$HOME/.xsession-errors"
#-------------------------------------------------------------
# Search History.
# Usage: histg <keyword>
#-------------------------------------------------------------
alias histg="history | grep"
#-------------------------------------------------------------
# Show which applications are connecting to the network.
#-------------------------------------------------------------
alias listen="lsof -P -i -n"
#-------------------------------------------------------------
# Show the active ports
#-------------------------------------------------------------
alias show-port='netstat -tulanp'
#-------------------------------------------------------------
# Ubuntu like update-grub command.
#-------------------------------------------------------------
alias update-grub='sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg'
Trying out the @MicrosoftEdge beta for the next couple of weeks. Got all my extensions installed and bookmarks imported. Let's see how she goes.
01:23 AM - 06 Oct 2019
0
3
It is Chromium-based, so I expect it to pretty much behave like Chrome, and Brave, another browser I was using. I am still curious what will make someone grab one Chromium browser over the other. I wrote about it here.
I think in the case of Edge, most people that get new PC laptops/desktops will probably just go with it unless they are already a die hard Chrome fan, but we will see.
Full-stack dev shipping Django/React SaaS and Shopify stores since 2018. 37 client projects, 11 live Shopify builds. I write production war stories so you don’t repeat my outages.
alias cookiecutter="cookiecutter https://github.com/pydanny/cookiecutter-django"
alias python="python3"
alias pip="pip3"
alias run="python manage.py runserver"
alias make="python manage.py makemigrations"
alias migrate="python manage.py migrate"
alias run_environ='source env/bin/activate'
Love this! I have some of my own collection as well. A mix of alias and functions.
I also use oh-my-zsh, with many of it's oh-my-zsh plugins. it's osx plugin is pretty awesome when working on mac, giving you ability to open current paths in the finder, or getting the current selected file in the finder, as a path in the terminal.
There are so many pluigns, you'll have to check out the oh-my-zsh plugins list.
Definitely stealing those
ffmpeglines.please do! they helped me a lot.
Why not?
Hell yes. I still haven't outgrown my Gentoo phase, so I update with
u:On my aging laptop running Void:
There's also this monstrosity for building a new kernel in
/root/.bashrc:I'm not even sorry. I had a similar line for cleaning up artifacts from an old kernel but it got gross enough to merit its own script.
In a similar vein to
eupforemerge, there's Rust and OCaml toolchains:My Bash Equivalent aliases
My Fish functions (What fish uses instead of Alias)
Ubuntu update on demand:
Open this alias file (I use Visual Studio Code, hence the
code):Load aliases:
I use
gfor git as well. 🔥 I updated the post. I must have missed that line as I was only copying part of my .zshrc file. 🙃I don't believe in one character aliases. I utilize tabs to reduce keystrokes. My aliases are some per-configuration for tools. And some personalized tools are prefixed with
fl_or withflp_I also have some utility functions like
If you're wondering what Edge doing in there, I decided to take it for a spin for the next little while as it is a new browser on the block.
It is Chromium-based, so I expect it to pretty much behave like Chrome, and Brave, another browser I was using. I am still curious what will make someone grab one Chromium browser over the other. I wrote about it here.
The Chromium Browser Wars
Nick Taylor ・ May 21 ・ 2 min read
I think in the case of Edge, most people that get new PC laptops/desktops will probably just go with it unless they are already a die hard Chrome fan, but we will see.
Here's mine
lias chrome=should bealias chrome.alias fu=‘sudo $( fc -ln -1 )’that is, “what i just said but with sudo at beginning now will you do it”
zshconfigsaves one character fromvi ~/.zshrcat the expense of having a command that only works on your own systems.That
edgeone makes sense, though.alias eat='rm -rf'