start new:
tmux
start new with session name:
tmux new -s myname
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |
# /etc/profile.d/best_bash_history.sh | |
# Save 5,000 lines of history in memory | |
HISTSIZE=10000 | |
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing) | |
HISTFILESIZE=2000000 | |
# Append to history instead of overwrite | |
shopt -s histappend | |
# Ignore redundant or space commands | |
HISTCONTROL=ignoreboth | |
# Ignore more |
GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.
For more information, visit our search help section.
#!/bin/sh | |
umask 077 | |
# File extension for the notes | |
note_ext="md" | |
fzf_opts="--height 50%" | |
# Preview script part of FZF.vim. Defaults to something else if not present (but | |
# not as fancy) |
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
# see https://github.com/defunkt/resque/issues/49 | |
# see http://redis.io/commands - new commands | |
namespace :resque do | |
desc "Clear pending tasks" | |
task :clear => :environment do | |
queues = Resque.queues | |
queues.each do |queue_name| | |
puts "Clearing #{queue_name}..." |
This is just a random collection of commands which I have found useful in Bash. This Gist is expected to grow over time (until I have mastered the whole of Bash). Another useful resource is this list of Unix commands on Wikipedia. Hyperlinked bash commands in general lead to relevant Man (manual) pages.