Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

To insert a blank line after the current line while staying in command mode, use:

***: r !echo***
This is the "read in a file" command, but instead of giving it a filename, we tell it to read the output of a shell command (!); that shell command, echo, simply prints a blank line. After the blank line is inserted, you remain in command mode.
3 years ago
To insert a blank line after the current line while staying in command mode, use:

***: r !echo***
This is the "read in a file" command, but instead of giving it a filename, we tell it to read the output of a shell command (!); that shell command, echo, simply prints a blank line. After the blank line is inserted, you remain in command mode.
3 years ago
A python example for calculating the number of days I've walked the planet:
***$ python
>>> from datetime import date as D
>>> print (D.today() - D(1980, 6, 14)).days
11476***
3 years ago
For OS X you can use this bit of applescript:
***activate application "Firefox"
tell application "System Events" to keystroke "r" using command down***
3 years ago
I had problem with arrow keys while trying vim inside Windows 8.1 using cygwin. The issue was, printing A/B/C/D while navigating with Arrow keys in insertion mode. The solution worked for me is:
***cp vimrc_example.vim ~/.vimrc***

Basically, above command copying **vimrc_example.vim** file to **/home//.vimrc**.
3 years ago
ffmpeg can do this. Useful if you already have ffmpeg. No need for installing other tools.

Simply:
***ffmpeg -i file.webp out.png***
3 years ago
Usually, **ssh** will give you a remote shell by executing what is set up as your remote users login shell (e.g. **/bin/bash**). **-N** will prevent running anything, which is useful when you just want to use ssh to establish a connection and you don't need a remote shell.

e.g. forwarding ports or creating tunnels:
***ssh -N -L 8080:127.0.0.1:80 user@server***

And this is not only useful for forwarding ports.

E.g.: I use it in combination with **-f** and **ControlMaster** and **ControlPath** options (e.g. set up in .ssh/config), it can be used to create reusable connections.
***ssh -fN user@server # creates a connection in the background that can be reused.***
3 years ago
This command should work:
***$ git fetch origin [branch]***

The above command only fetches metadata from remote repository, it not does merge sources.

If you want to fetch and merge the sources, the command would be:
***$ git pull origin [branch]***

Be careful with the branch where you are executing merge command. It will be where the sources are merged.
3 years ago
SSH is a protocol for secure communication over an insecure network. It allows for end to end encryption of all communication such that it cannot (feasibly) be intercepted and decrytped.

ssh the utility is an implementation of the protocol. SFTP is a subsystem of ssh that uses the protocol for secure password and file transfer.

su does not use the ssh protocol.
3 years ago
You Can use the folllowing command:
*** dig YOURDOMAIN +nssearch
***
3 years ago
You can use something like this:
***function displaytime {
local T=$1
local D=$((T/60/60/24))
local H=$((T/60/60%24))
local M=$((T/60%60))
local S=$((T%60))
(( $D > 0 )) && printf '%d days ' $D
(( $H > 0 )) && printf '%d hours ' $H
(( $M > 0 )) && printf '%d minutes ' $M
(( $D > 0 || $H > 0 || $M > 0 )) && printf 'and '
printf '%d seconds\n' $S
}***
3 years ago
Use this **--download-archive archivefile.txt** option.
***youtube-dl --download-archive FILE***
**youtube-dl** both reads and adds to a list of files not to download again. Every time a file is successfully downloaded, that video id is added to file.
3 years ago