≡ Menu

curl command

How to use curl command with http/2 on MacOS X

I am using a MacOS sierra (version 10.12.1). How do I use curl command with http2/ protocol? I am getting an error that read as follows:

            curl -I --http2 https://google.com
            curl: (1) Unsupported protocol

How do I solve this problem and use cURL with HTTP/2 on Mac OS X or MacOS Sierra?
[click to continue…]

Sysadmin because even developers need heroes!!!

How to use curl command with proxy username and password on Linux or Unix

My sysadmin provided me the following proxy details:
       IP: 202.54.1.1
       Port: 3128
       Username: foo
       Password: bar

The settings worked perfectly with Google Chrome and Firefox browser. How do I use it with the curl command? How do I tell the curl command to use my proxy settings from Google Chrome browser?
[click to continue…]

curl Command Resume Broken Download

I know wget can resume a failed download. I am on a Mac OS X and do now want to install wget command. How can I resume a failed download using curl command on Linux or Unix-like systems?
[click to continue…]

Mac OS X: Install wget Network Downloader Utility

I recently learned that “wget” can continue getting a partially-downloaded (resume download) file. I am unable to find wget command on Mac OS X. How do I install install wget on Mac OS X (Mountain Lion/ Mavericks / Snow Leopard)? How can I install wget in Mac OS X without 3rd-party repo such as Homebrew or MacPorts?
[click to continue…]

Nginx: 301 Redirect To A Domain Name

I am a new Nginx web server user. How do I redirect to a different domain using nginx (say example.org to example.com) permanently?
[click to continue…]

Mac OS X: Terminal Download File Command

I often need to download files using the Terminal. However, I am unable to find the wget command on OS X. How do download files from the web via the Mac OS X bash command line option?
[click to continue…]

Bash: Display Web Page Content In Terminal

How can I fetch HTML web page content from bash and display on screen using shell utilities?
[click to continue…]

Nginx Redirect Mobile / Smart Phone Traffic To Mobile Version Of the Web Site

I am a new nginx user and I would like to redirect all mobile / smart phone users from www.example.com to m.example.com domain. How do I detect a mobile phone browser in nginx? How do I redirect all mobile users to sub-domain using regex based rules? How can I automatically redirects visitors on mobile devices to its mobile version at http://m.example.com/ and also allow mobile devices to the desktop website at www.example.com if visiting via http://www.example.com/?desktop=true?
[click to continue…]

Mac OS X: Wake Up Servers Using Wake-on-LAN ( WOL ) Command Utility

I know how to send WOL command using Linux or FreeBSD wake command. But, how do I send Wake on LAN (WOL) frames to hosts on a local Ethernet network using Apple OS X Unix operating systems to wake up my servers or nas devices?
[click to continue…]

Nginx: Block URL Access (wp-admin/wp-login.php) To All Except One IP Address

I am the small business owner and runs my own web-site. I have noticed increased cracking activity against by blog. What’s the best way to block WordPress URLs such as example.com/blog/wp-login.php and example.com/blog/wp-admin/ in the nginx web-server?
[click to continue…]