Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Renew DHCP IP address in Ubuntu

Answer:

To rename an IP address using DHCP in Ubuntu, try enter the commands below:

1. Release the current IP

# sudo dhclient -r

2. Renew a new IP

# sudo dhclient

Create Facebook Test Users

Answer:

In the last article, you already know how to get the Facebook access token. In this post, I will tell you how to create testing accounts for your app's testing.

# curl -F 'access_token=ACCESS_TOKEN' 'https://graph.facebook.com/APP_ID/accounts/test-users?installed=true&permissions=read_stream'

You can manipulate the permissions as needed.

How to get my Facebook App' access token?

Answer:

Assume you have your created a Facebook application, and you have the two things: App ID & App Secret.

You can get the access token by a simple curl command.

# curl -F type=client_cred -F client_id=APP_ID -F client_secret=APP_SECRET https://graph.facebook.com/oauth/access_token

Show HTTP response header using curl

Answer:

To show the response of HTTP request to a specific server, you can use the "curl -I" command.

Example:

#  curl -I "http://www.example.com"
HTTP/1.0 302 Found
Location: http://www.iana.org/domains/example/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0

Allow a remote IP for incoming connection in UFW (Uncomplicated firewall)

Answer:

To allow a remote IP for incoming connection in Ubuntu's UFW (Uncomplicated firewall), you can use the following command:

# sudo ufw allow from x.x.x.x

Of course you need to reload the firewall.

# sudo ufw reload