Showing posts with label wget. Show all posts
Showing posts with label wget. Show all posts

07 October 2013

Updating Linux Kernel

updating kernel

how to update ubuntu kernel to 3.10

The current long term linux kernel is 3.10 (correct as of 2013). so it's a good choice for previous longterm kernel user to jump to 3.10 for it bring many new features and improvement.
    Advantages of longterm kernel 3.10 are:

  • Tickless Timer
    Improve CPU performance and latency by reducing tick from 1000 to 1 per second.
  • Tail loss probe
    Improve network latency.
  • Bcache
    HDD performance improvement, by allowing SSD to act as cache.
  • ARM big.LITTLE support
  • MIPS KVM support
  • Memory, filesystem, Networking, crypto, Security, Virtualization Improvement
  • and many more...

Installing the latest kernel

# download the latest kernel in 'deb' format from kernel.ubuntu.com :

for 32-bit system
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.14-saucy/linux-headers-3.10.14-031014_3.10.14-031014.201310011335_all.deb
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.14-saucy/linux-headers-3.10.14-031014-generic_3.10.14-031014.201310011335_i386.deb
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.14-saucy/linux-image-3.10.14-031014-generic_3.10.14-031014.201310011335_i386.deb

for 64-bit system
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.14-saucy/linux-headers-3.10.14-031014_3.10.14-031014.201310011335_all.deb
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.14-saucy/linux-headers-3.10.14-031014-generic_3.10.14-031014.201310011335_amd64.deb
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.14-saucy/linux-image-3.10.14-031014-generic_3.10.14-031014.201310011335_amd64.deb

# install by running:
sudo dpkg -i *.deb

See The Changes

Unfortunately, you will have to reboot your computer to see the changes. the new kernel shall be visible in GRUB menu during bootup. Generally, GNU/Linux does never need to reboot for software, library etc et al to work after install. But kernel will be an exception.

# in rare case if it does not appear or update the grub menu itself:
sudo update-grub

note: this method will work on ubuntu and its derivatives.

11 April 2013

BACKUP FACEBOOK PROFILE



Facebook is the leading social network, there is no doubt. It has more than 1 billion registered user. There is hardly any one who had not heard (or using) it.

This tutorial is an example on how to backup/download 'facebook profile' (our own profile). Frustated at not finding a single tutorial on how to backup my user profile. i went ahead and created this tutorial. back to the point, we will use 'cURL' (and 'wget') for this purpose as it is available for almost all system.

Facebook data are available from 'https://graph.facebook.com'. Basic info like id, username, name, link, gender & locale are available publicily. Throw in an access token you have all data that is in public or visible to friends. Example below:
https://graph.facebook.com/jor.teron

Required:
* cURL or wget
* User ID (UID)
* facebook access_token
* Basic idea on FQL and FQL tables (optional)

This method work by invoking graph explorer...
https://graph.facebook.com/fql?q=FQL_QUERY&access_token=ACCESS_TOKEN
where  FQL_QUERY  is the FQL query implemented by facebook. If  FQL_QUERY  is..
select description from group where gid=XXXXXXXX
..then url will be like.
https://graph.facebook.com/fql?q=select+description+from+group+where+gid=XXXXXXXX&access_token=ACCESS_TOKEN


STEP TO FOLLOW:
1) Goto Graph API Explorer, https://developers.facebook.com/tools/explorer. Login if necessary. Click 'Get Access Token' button. Select appropriate permission. save it. Copy the access token (those jumbled alphabet).

2) Note down your UID.

3) Open 'Command Prompt' and type in the following.
for cURL:
curl --user-agent 'Firefox 10' \
--output file.txt \
"https://graph.facebook.com/fql?q=select+uid,username,name+from+user+where+uid=UID&access_token=ACCESS_TOKEN"

for wget:
wget --user-agent='Firefox 10' \
--output-document=file.txt \
"https://graph.facebook.com/fql?q=select+uid,username,name+from+user+where+uid=UID&access_token=ACCESS_TOKEN"

note:
* Replace UID and ACCESS_TOKEN with its respective values you got in step 2 and 1 respectively.
* ACCESS_TOKEN is valid only for 1 hour, so you will need to get it (again) later if needed.

In the above example it'll download User Profile (containing id, username, name) and save it to 'file.txt'. You can specify more column if needed.


To download photos:
curl --user-agent 'Firefox 10' \
--output photo.txt \
"https://graph.facebook.com/fql?q=select+src_big+from+photo+where+owner=UID&access_token=ACCESS_TOKEN"
Sort out photos links using grep, sed, awk or regex to download them. In these way one can download facebook data from profile to photos, comments to likes, pokes to messages etc.


If FQL intimate you, there is an easier way to fetch data by using Graph Search....
https://graph.facebook.com/USER?fields=GRAPH_OBJECT&access_token=ACCESS_TOKEN
Example:
https://graph.facebook.com/jor.teron?fields=id,username,name&access_token=ACCESS_TOKEN

This tutorial will benefit those who want to backup their facebook data. Alternatively if you find this process hard to follow you can use facebook own feature 'Copy Facebook'.