tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd"> | |
| <keyboard group="0" id="5000" name="QWERTY no option" maxout="1"> | |
| <layouts> | |
| <layout first="0" last="0" modifiers="48" mapSet="312" /> | |
| </layouts> | |
| <modifierMap id="48" defaultIndex="0"> | |
| <keyMapSelect mapIndex="0"> | |
| <modifier keys="" /> | |
| </keyMapSelect> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # This script will browse a Slack export folder and download all files in a new /export folder | |
| # | |
| # HOW TO: | |
| # 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export) | |
| # 2. Make sure you have jq installed (https://stedolan.github.io/jq/) | |
| # 3. Place this file at the root of your Slack export folder, next to channels.json | |
| # 4. Run `bash slack-files-downloader.sh` in your terminal | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From: http://web.archive.org/web/20160904174444/http://andreafrancia.it/2010/03/understanding-the-output-of-rsync-itemize-changes.html | |
| As you may know the rsync's --delete options if misused could make severe damage. | |
| To prevent this you can use the --itemize-change and the --dry-run options to figure out how the command will behave before launching the real one. | |
| The output will be something like that: | |
| .d..t..g... ./ | |
| .f...p.g... Something.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Short alias to allow automated copying of the 1password cli tool command 'op get somewebsite | jq ...' and then a timed clear on the gnome clipboard | |
| # TODO: specify designation as an argument and maybe a command to open the website in chrome | |
| pass=$(op get item $1 | jq -r '.details.fields[] | select(.designation=="password").value') | |
| if [ -n "$pass" ] | |
| then | |
| echo $pass | xclip -selection clipboard | |
| echo "Password was copied - clipboard will be wiped in 15 seconds" | |
| sleep 15 |
Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'
Example: To get json record having _id equal 611
cat my.json | jq -c '.[] | select( ._id | contains(611))'Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh() { | |
| if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then | |
| tmux rename-window "$(echo $* | cut -d . -f 1)" | |
| command ssh "$@" | |
| tmux set-window-option automatic-rename "on" 1>/dev/null | |
| else | |
| command ssh "$@" | |
| fi | |
| } |
