Print execution time of a shell command

time is a built-in command in most shells that writes execution time information to the tty. You could also try something like start_time=`date +%s` <command-to-execute> end_time=`date +%s` echo execution time was `expr $end_time – $start_time` s. Or in bash: start_time=`date +%s` <command-to-execute> && echo run time is $(expr `date +%s` – $start_time) s

How to check if an URL exists with the shell and probably curl?

Using –fail will make the exit status nonzero on a failed request. Using –head will avoid downloading the file contents, since we don’t need it for this check. Using –silent will avoid status or errors from being emitted by the check itself. if curl –output /dev/null –silent –head –fail “$url”; then echo “URL exists: $url” … Read more

How to verify downloaded file with .sig file?

You need to import public key: C3C45C06 Can be done in three steps. find public key ID: $ gpg gcc-4.7.2.tar.gz.sig gpg: Signature made Čt 20. září 2012, 12:30:44 CEST using DSA key ID C3C45C06 gpg: Can’t check signature: No public key import the public key from key server. It’s usually not needed to choose key server, but it can be … Read more

Error: EACCES: permission denied, access ‘/usr/lib/node_modules’

It’s not recommended to use sudo with npm install, follow the steps from npmjs official docs instead 🙂 Make a directory for global installations: mkdir ~/.npm-global Configure npm to use the new directory path: npm config set prefix ‘~/.npm-global’ Open or create a ~/.profile file and add this line: export PATH=~/.npm-global/bin:$PATH Back on the command … Read more

Is there an Eclipse plugin to run system shell in the Console? [closed]

It exists, and it’s built into Eclipse! Go to the Remote Systems view, and you’ll see an entry for “Local”. Right-click “Local Shells” and choose “Launch Shell.” You can’t launch it directly from the project navigator. But you can right-click in the navigator and choose “Show in Remote Systems view”. From there you can right-click … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)