Reply
Thread Tools
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#31
Originally Posted by vi_ View Post
Easy mode


As root, on device;

Code:
wget -O ~/hosts http://www.mvps.org/winhelp2002/hosts.txt && echo "127.0.0.1" $(cat /etc/hostname) "localhost" > /etc/hosts && tr -d '\015' < ~/hosts >> /etc/hosts
***big fat warning. I do not actually have an N9 so I do not know if this will actuall work...it should, it works on an n900.
***this will wipe your hosts file, so if you have put anything custom in there, you will have to re-ad it.
vi_,

The download and transfer of file to /etc/hosts works but the $(cat /etc/hostname) didn't put RM696 into the hosts file...

See:
Code:
127.0.0.1  localhost
I don't know about other n9's but my hostname file is empty:
Code:
:~# ls -al /etc/hostname
-rw-r--r--    1 root     root             0 Nov 29 20:11 /etc/hostname

I had deleted the same hosts file that I already had prior to your post so its a fresh test...


Edit: Why not replace (cat /etc/hostname) with (uname -n)?

Edit 2: Replacing with (uname -n) in your command didn't do the change too; will check and report...

Last edited by thedead1440; 2012-11-29 at 12:30.
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#32
fixed:

Code:
wget -O ~/hosts http://www.mvps.org/winhelp2002/hosts.txt && echo "127.0.0.1 RM696 localhost" > /etc/hosts && tr -d '\015' < ~/hosts >> /etc/hosts
I was trying to write a generic script that would work on any device, however I have now changed it to specifically put the 'RM696' in hosts. So the above is N9 only.


I cannot imagine why:
Code:
echo "127.0.0.1" $(uname -n) "localhost"
Does not work for you, it works for me. I did not use because I did not know about it! uname -n >> /vi_/brain/unix_vocabulary.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2012-11-29 at 12:36.
 

The Following User Says Thank You to vi_ For This Useful Post:
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#33
Are you sure it works correctly with uname -n?

Doing:
Code:
~# wget -O ~/hosts http://www.mvps.org/winhelp2002/hosts.txt && echo "127.0.0.1" $(uname -n) "localhost" > /etc/hosts && tr -d '\015' < ~/hosts >> /etc/hosts
Creates the entry of "127.0.0.1 RM696 localhost" into the first line of file instead...


Edit: Would you know how to instead in the above commands replace the contents of line 23 with the echo command instead?

Edit 2: Ah just realized my stupidness...The uname echo can remain as first line; it won't make any difference...

Last edited by thedead1440; 2012-11-29 at 12:46.
 
Posts: 359 | Thanked: 322 times | Joined on Jun 2010
#34
This works like a charm to speed up the browser! Are there any new host files to update with?
 
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#35
Originally Posted by Hacker View Post
This works like a charm to speed up the browser! Are there any new host files to update with?
Updated Jan 18 2013; same as vi_'s one-liner above:

Code:
wget -O ~/hosts http://winhelp2002.mvps.org/hosts.txt && echo "127.0.0.1" $(uname -n) "localhost" > /etc/hosts && tr -d '\015' < ~/hosts >> /etc/hosts

E: If you just recently ran the one-liner then you are surely updated as the updates are just pushed to the same URL
 

The Following 5 Users Say Thank You to thedead1440 For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#36
I guess that on N950 you need to replace RM696 with RM680, right?
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#37
Originally Posted by marmistrz View Post
I guess that on N950 you need to replace RM696 with RM680, right?
The one-liner reads your hostname and does the change accordingly so you don't need to do anything other than the one-liner...
 

The Following User Says Thank You to thedead1440 For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#38
Originally Posted by thedead1440 View Post
The one-liner reads your hostname and does the change accordingly so you don't need to do anything other than the one-liner...
thx,

the one liner should be put into the op. Or maybe a deb on apps for meego!
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#39
Originally Posted by marmistrz View Post
the one liner should be put into the op.
Done...
 

The Following User Says Thank You to thedead1440 For This Useful Post:
Posts: 11 | Thanked: 6 times | Joined on May 2012
#40
I have a strange issue with that.

I downloaded the ad-blocking hosts file from the link given and changed 127.0.0.1 localhost to 127.0.0.1 RM696 localhost manually with kate (I'm on Kubuntu). Then I transferred the new hosts file to my Downloads directory and replaced the original /etc/hosts (I made a copy before).

Everything works fine except the fact that I am not able to access any website when I am in my wireless home network

What is really strange about this issue that I got it working back again when I changed my hosts file back to the standard one. When I tried out the ad-blocking hosts file again it didn't work again for me. But now my old hosts file does not work too! Any tips?

Edit: Well, obviously this could not be caused by the hosts file. there was some encryption error, I changed b&g to b and then to auto108mbps and now it is working again. Very strange. yesterday I downloaded some maps through my wifi...

Last edited by Mark Twain; 2013-05-15 at 15:27.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:34.