Powered By

Powered by Blogger

Tampilkan postingan dengan label rkv. Tampilkan semua postingan
Tampilkan postingan dengan label rkv. Tampilkan semua postingan

Kamis, 25 Februari 2010

[How-To] Listen to Pandora And Spotify Outside US / UK In Linux, Using TOR (With Country Specific Exit Nodes)

This is yet another guest post from RKV. We've seen how to get an invitation for free on Spotify UK and now that you have an account, you must log in using a UK proxy every 14 days or your account gets blocked.

To log in to Spotify (and while we're here, also for Pandora, with a different set of Exit Nodes) using an UK proxy, you'll have to configure TOR to use some specific exit nodes. Here is the exact step by step how-to for Linux (Ubuntu).


Step 1: Install Vidalia Bundle [Tor+Privoxy]

Add the tor ppa repo:
echo "deb http://deb.torproject.org/torproject.org experimental-$(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 886DDD89

(or add the stable Tor repository - see HERE, although I recommend the experimental repository!)

And install them:
sudo apt-get update && sudo apt-get install tor vidalia privoxy


Step 2: Configure Tor to use US exit nodes
sudo gedit /etc/tor/torrc

Note from Andrew: that didn't work for me for some reason, but editing the ~/.vidalia/torrc file worked, so if the first one doesn't work for you either, try this second file.

And paste this at the bottom of the file:

a) For US exit nodes (Pandora):
ExitNodes desync,whistlersmother,lefkada,bettyboop,croeso,TorLuwakOrg,nixnix,inap1,redpineapple,cronic,sasquatch,slowturtle2,moria1,moria2,torxmission,augrime,err,foundry,peertechdata,sasq,0xL37N1Tor,agrippator,3x0rcyst5p4dd3dc311,52c5eSH5,703server,allium,amendment10,Blackmage,BostonUCompSci
StrictNodes 1
CircuitBuildTimeout 5
NumEntryGuards 6
KeepalivePeriod 60
NewCircuitPeriod 15


b) For UK Exit nodes (Spotify):
ExitNodes 0000000000Marauder,anonion,colinwillsdorkyahoo,gigatux,gerkin,devasdfasdf,Persepolis,ephemer2,000000000000haven,Alice
StrictNodes 1
CircuitBuildTimeout 5
NumEntryGuards 6
KeepalivePeriod 60
NewCircuitPeriod 15


Step 3: Configure Privoxy to use tor
sudo gedit /etc/privoxy/config

Navigate to the bottom of the file, and add the following line:
forward-socks5   /               127.0.0.1:9050 .

Yes, with a space and a dot at the end!



Step 4: Restart the services

Restart the Tor and Privoxy services of the changes to take effect:
sudo /etc/init.d/tor restart
sudo /etc/init.d/privoxy restart


Step 5a: Use Pithos to listen to Pandora (Recommended)

We have covered Pithos, a client for Pandora here (and I just Love It!).

Follow the above link to find instructions to install pithos, after installation, Pithos needs to configured to use tor.


pithos proxy

Open up Pithos (Applications > Sound & Video > Pithos), insert your Pandora login details (if you don’t have one, just register it for free. Follow the step5b and then head on to Pandora.com to register). Then insert the proxy details as “http://127.0.0.1:8118


Step 5b: Use Firefox to listen to Pandora

pandora screenshot


I would suggest installation of FoxyProxy as it automatically will redirect Pandora to use Tor, whereas other sites will use normal connection.


foxyproxy


After installation of the FoxyProxy addon, double click on “FoxyProxy” in the right lower corner. Click “add new proxy”, Under “Manual Proxy Configuration” enter ip address as 127.0.0.1 and port 8118.


foxyproxy pattern

Then go to the “URL Patterns” tab and click “Add New Pattern”. Give pattern name as “Pandora” and URL pattern as “*pandora.com/*” (without quotes). Leave the rest as it is. Click ok, ok and come out. Make sure that Foxyproxy is set to use the “Patterns” profile.

Now just navigate to www.pandora.com and enjoy!

PS: As of writing this tutorial, I was not able to signin using pithos (it worked earlier), but I could, using Firefox. So in case you encounter any problems, use Firefox and try with Pithos later on.


Step 5c: Setting TOR for using Spotify.

spotify proxy


The Spotify application is only available for Windows. But it can run on Linux by using Wine. Complete details to setting everything up can be found on THIS page.

The first thing you need to do is get a Spotify account. To get an invite, see THIS post.

Then you need to set up a proxy for Firefox (using TOR) to create the account. Since you've set up everything like in the above steps, all you have to do is to go to Firefox preferences (Edit > Preferences > Advanced > Network) and enter "127.0.0.1" as the SOCKS IP and "9050" as the port. Then proceed to creating your Spotify account.

To set up Spotify for use with TOR, navigate to Edit > Preferences in Spotify, and under Proxy select "Socks5", enter: "127.0.0.1" (or "localhost", it's the same) as the IP and "9050" as the port. Spotify can also use Pirvoxy meaning you can just set it a http proxy on "localhost" with "8118" port and since you've installed Pirvoxy too, use whichever you want.

For Spotify you only have to log in using TOR with UK exit nodes every 14 days. So basically you can simply use your normal internet connection for listening. But don't forget to log in using TOR with UK exit nodes every 14 days!


This is a guest post written by WebUpd8 reader rkv (thanks!). Credits for the post and screenshots: rkv. Browse all the posts by rkv.

Senin, 15 Februari 2010

Differences Between 3 Types Of Proxy Servers: Normal, Transparent And Reverse Proxy

proxy types


What is a Proxy Server?


A Proxy server is an intermediary machine, between a client and the actual server, which is used to filter or cache requests made by the client.

This article is focused on the Different Caching Web Proxies.


Normal (Regular/Caching) Proxy:


A regular caching proxy server is a server which listens on a separate port (e.g. 3128) and the clients (browsers) are configured to send requests for connectivity to that port. So the proxy server receives the request, fetches the content and stores a copy for future use. So next time when another client requests for the same webpage the proxy server just replies to the request with the content in its cache thus improving the overall request-reply speed.


Transparent Proxy:


A transparent proxy server is also a caching server but the server is configured in such a way that it eliminates the client side (browser side) configuration. Typically the proxy server resides on the gateway and intercepts the WWW requests (port 80, 443 etc.) from the clients and fetches the content for the first time and subsequently replies from its local cache. The name Transparent is due to the fact that the client doesn't know that there is a proxy server which mediates their requests. Transparent proxy servers are mostly used in big corporate organizations where the client side configuration is not easy (due to the number of clients). This type of server is also used in ISP's to reduce the load on the bandwidth usage.


Reverse Proxy:


A reverse proxy is totally different in its usage because it is used for the benefit of the web server rather than its clients. Basically a reverse proxy is on the web server end which will cache all the static answers from the web server and reply to the clients from its cache to reduce the load on the web server. This type of setup is also known as Web Server Acceleration.



This is a guest post written by WebUpd8 reader rkv (thank you very much!). Browse all the posts by rkv.

Kamis, 11 Februari 2010

RHEL: Chmod or Chown Issued By Mistake On System Folders [Fix]

Problem:
Permissions and Ownership on critical system files (in /etc/) directory modified. This may cause the system to not boot, lots of errors and Kernel Panic.

Cause:
Someone accidentally typed chmod -R 777 /etc.

Solution:
You may use the following solutions (if you use Chmod or Chown by mistake on System Folders and changed Permissions & Owners) to avoid the re-installation of whole RHEL O.S. This should work for any Red Hat Enterprise Linux version and what you have to do is reset the ownership and permissions of the files installed by RPM.


The RPM package manager maintains a database for all files that it installs onto the system. This includes information such as the filename, installation path, owning package and the file system ownership and permissions (including SELinux file context information). In the event that ownership or permissions are inadvertently changed, for example, through accidental misuse of the chown or chmod commands, it is possible to revert these to their values as stored in the database.

The command-line rpm tool provides the --setperms and --setugids switches to allow this to be done.

To re-set ownership and permissions for all packages on the system:
rpm --setperms -a
rpm --setugids -a


To re-set ownership and permissions for a specific package on the system:

rpm --setperms <package name>
rpm --setugids <package name>


Note: This will not restore ownership or permissions information for files that were not installed by an RPM package. Any incorrect ownership or permissions for user-owned files, or for packages installed outside of RPM control must be addressed separately.



This post was sent by Web Upd8 reader rkv (Credits: Purna) - thanks! You may also want to read his previous post: [How-To] Recover LVM Partition On Damaged HDD.

Selasa, 09 Februari 2010

[How-To] Recover LVM Partition On Damaged HDD

The following post was send by WebUpd8 reader rkv and it's a mix of story / how-to recover the LVM partition on a damaged HDD. Read on!


Scenario:

80GB SATA HDD, Bad Sectors, 4 Primary Partitions, boot, root, swap and a 60GB Volume Group can boot into the OS (very slow), LVM not recognized.


Solution:

I connected the hard-disk to another Linux box as a secondary drive, took a while to boot indicating bad HDD. After 20 mins (yeah 20 mins), box booted into single user mode, login as root.

I then ran the following commands:

dmesg

found lots of bad blocks errors.

fdisk -l

took a couple of minutes for the output but showed all the partitions.

vgdisplay

didn't recognize any volume groups.

Now i realized that the HDD is failing, as all the above commands are taking a lot of time, so I thought taking a physical dump using dd will help a lot. I could take the raw dump of the entire /dev/sdb4 (the lvm partition) but i just needed data from the home folder i.e. 45 GB / 60 GB so I decided to try some more.

Nnow i tried to recover the lvm metadata for the volume group ( Thanks Purna! )

lvgchange -ay

After 30 mins, i got no message, but fdisk -l shows a lot of mapper devices. vgdisplay gave me all the logical volumes in the physical volume.

Thanks for good labeling, i can see HOMEVOLUME, USRVOLUME, VARVOLUME, TMPVOLUME so now i know that i need to recover the HOMEVOLUME partition. So quickly I tried to mount the /dev/LVMVOLUME/HOMEVOLUME device but after couple of minutes, I got bad FS type error. I even tried specifying the partition type -- ext3 but with no luck.

I then thought its time for "the best command in linux": dd.

dd /dev/LVMVOLUME/HOMEVOLUME /mnt/homelvm.iso

But it failed, gave some bad block error. Target file was 0 kb!

On further research, i found some switches for dd, to ignore bad blocks and move on:
dd /dev/LVMVOLUME/HOMEVOLUME /mnt/homelvm.iso bs=64k conv=noerror,sync


You might be wondering why i specified block size as 64k, the reason is, if dd encounters a bad block, it will skip, so the block size defines how much to skip, so 64k ensures dd copies as much data as possible but will take lot of time to complete, as opposed to specifying higher block size, which will be fast but recovery wont be that successful.

Anyways so I left it overnight and in the morning i have my 47 GB iso file.

So enthusiastically i tried to mount it:
mount /mnt/homelvm.iso /opt -o loop

But didn't work, gave me unknown file system error.

So then i tired the command:
fsck.ext3 /mnt/homelvm.iso

It started checking the disk for errors, and found lots of them, i had to type yes for all the questions. I should have specified the "assume yes and move on" switch, but didn't want to cancel and take chances so after the file system check completed, i tried to mount the iso image again and VOILA, it returned the prompt quietly (I love Linux when it does this!)

All the files needed were intact, I checked few files, they were okay, there might be some corrupt files, but will find out only when I open them.

Hope this article helps!


Also check out how I fixed the "Couldn't mount because of unsupported optional features (2000200)" error.



This post was written by WebUpd8 reader rkv, so all the credits go to him!