Speaking of Windows, "pushd \\servername\sharename" is a simple way to mount a share in Windows, if you have the login creds cached, and set the new drive letter as your active drive. Useful if you need to bounce around a bunch of shares.
It's not "start" is an alias to "explorer", it's that "start" runs the args through "ShellExecute".
I mention this only because it has some other uses. For instance, Windows apps can install run handlers so that something like Start->Run->Excel will launch Excel. Just running "excel" on a command prompt won't work, but "start excel" will work, since that kicks off the right path.
You can also use something like "start /w filename.txt" to start an instance of your editor, and wait for it to close (well, mostly, some apps do weird things and break this)
For linux one can use `xdg-open .` to use the associated application. Works with pdf, image files, videos, etc.
I have the alias x=xdg-open in my .bashrc, so that I use `x somefile` to open files.
noti() {
osascript -e \
'on run argv
display notification (item 1 of argv) with title "Notification"
end run' \
$1
}
# Example:
noti 'Hello world!'
This fixes any escaping issues by passing the notification string to osascript as an argument instead of embedding it in the text of the program (which makes things like quotation marks not work correctly).Sticking it in your .bashrc or .zshrc will make it available at any time in your shell.
Can also combine with a vocal message: sleep 2; osascript -e 'say "Hello World!"'; osascript -e 'display alert "hello world"'
The last one copied from https://code-maven.com/display-notification-from-the-mac-com...
This one is great. Very, very useful.
https://github.com/jvinet/dotfiles/blob/master/bin/rin
Examples:
$ rin +30 Check the turkey
$ rin '14:30 tomorrow' Watch baseball
I currently have it setup so it pops up a modal dialog using Zenity. As well, it uses my cheap-and-cheerful bespoke notification doohickey that I have running in waybar, another script called notify: https://github.com/jvinet/dotfiles/blob/master/bin/notifyThis way, I have a nagging badge/icon in my waybar system tray until I finally do check that turkey and watch that baseball.
explorer.exe $(wslpath -w "$PWD")
It's a bit lengthy so this is always aliased in my .bashrc when using WSL alias open="/mnt/c/Windows/explorer.exe"
Edit: Added formatting
"python3 -m http.server" is really useful when building simple JavaScript pages, or when you need a simple static file server for testing.
"ss -p" is great, but if you just want to see what's hogging your bandwidth, iftop and nethogs are much better.
My favourite one-liner is "open .", to open the current directory in Finder. The open command can also open URLs and other files.
I also have an alias for "osascript -e 'display notification "'"$1"'"'", which will display the text you choose in a MacOS notification. It's useful when you need to be notified at the end of a long-running task. "printf '\a'" is also useful if you need the terminal to "ding".