Category Archives: Unix-like systems

curl without password in command line

https://stackoverflow.com/questions/20803339/basic-authorization-command-for-curl Another way is to get Base64 encoded token of “username:password” from any online website like – https://www.base64encode.org/ and pass it as Authorization header of curl as follows: Here, dXNlcm5hbWU6cGFzc3dvcmQ= is Base64 encoded token of username:password.

Tricks in command line

Serve current directory tree at http://$HOSTNAME:8000/ $ python -m SimpleHTTPServer Currently mounted filesystems in nice layout $ mount | column -t Get your external IP address / host / user agent / port from http://ifconfig.me/ $ curl ifconfig.meor$ curl ifconfig.me/ip$ curl ifconfig.me/host$ curl ifconfig.me/ua$ curl ifconfig.me/port Execute a command at one, given time $ echo… Read More »

Save file to your Nextcloud from bash

Sometimes you need to upload from command line to you Nextcloud storage. You can do it with a simple curl command. At first you have to create a shared directory in your Nextcloud with “Allow upload and editing” share option. You will get a share link for example: https://nextcloud.myserver.com/index.php/s/gz8BS7mtxGbwkQB The string “gz8BS7mtxGbwkQB” will be used… Read More »

Useful Bash aliases

An alias is nothing but the shortcut to command or group of commands. It allows to use options and filenames. You can add your own user-defined aliases to ~/.bashrc file. You can cut down typing time with these aliases, work smartly, and increase productivity at the command prompt. More about aliases Use alias command without… Read More »