Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Tuesday, 29 September 2015

How to connect to WiFi using command line Ubuntu, Debian etc.

Tried to upgrade to Ubuntu 15.10 Beta 2, rebooted  and my system was broken. Could not connect to LAN, so my only option was to connect to Wifi via command line to hopefully repair my system.

This is what I did.

First, open a terminal:


If you got WPA like me you need wpa_supplicant to set it up, because iw can only handle WEP.

To bring up your wireless device (most likely wlan0):
sudo -s
ifconfig wlan0 up
#now scan for available wifi networks and note the ssid of your device
iwlist wlan0 scan
In /etc/wpa_supplicant.conf we need to put our ssid and password:
nano /etc/wpa_supplicant.conf
Example config:
                     psk="wifi password"

Ctrl + A to close and save.
To connect:
sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
Open a second tab/terminal:
sudo dhclient wlan0
Your connection should now work!

Sunday, 19 October 2014

How To Extract Page(s) From A Single PDF File Using Command Line

PDFtk allows users to perform common pdf tasks from the command line such as merging or splitting PDF files and pages.

To install the program:
sudo apt-get install pdftk

To extract a page from an existing pdf file. For instance just the first page (A1):
pdftk A=/home/user/Desktop/cv.pdf  cat A1 output outfile.pdf