Difference between revisions of "Snoopy"

From ArchWiki
Jump to: navigation, search
(Snoopy script)
(18 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Introduction ==
+
[[Category:Gaming]]
Snoopy is a program similar to Warcraft III Banlist, aimed at improving the experience of Warcraft III players on Battle.net. Though focused on hosting, snoopy can be useful for any users as it allows for pinging, location checks, friends list following, and more. Snoopy is a native program built to use with Warcraft III on wine.
+
Snoopy is a program similar to Warcraft III Banlist, aimed at improving the experience of Warcraft III players on Battle.net. Though focused on hosting, snoopy can be useful for any users as it allows for pinging, location checks, friends list following, and more. Snoopy is a native program built to use with [[WarCraft III]] on [[Wine]].
  
 
== Installation ==
 
== Installation ==
Snoopy can be found in the [http://aur.archlinux.org/packages.php?ID=20199 AUR], or installed with yaourt:
 
yaourt -S snoopy
 
  
== Getting Started ==
+
Snoopy can be found in the [[AUR]] as package {{AUR|snoopy}}.
  
===Snoopy Programs===
+
== Getting started ==
  
Snoopy installs three programs in the /usr/bin directory, snoopy-sh, snoopy-ping, and snoopy-nox.
+
=== Snoopy programs ===
  
 +
Snoopy installs three programs in the {{ic|/usr/bin}} directory:
  
<tt>snoopy-sh</tt> is a not so useful on arch script intended to run snoopy-nox for the current user. Ignore this.
+
* {{ic|snoopy-sh}} is a not so useful on arch script intended to run snoopy-nox for the current user. Ignore this.
 +
* {{ic|snoopy-ping}} is a frontend to the ping command that snoopy uses to ping. Feel free to ignore this too.
 +
* {{ic|snoopy-nox}} is the primary program that snoopy runs. This is all we're really going to worry about.
  
<tt>snoopy-ping</tt> is a frontend to the ping command that snoopy uses to ping. Feel free to ignore this too.
+
=== Executing snoopy ===
  
<tt>snoopy-nox</tt> is the primary program that snoopy runs. This is all we're really going to worry about.
+
Snoopy can be executed in either of the following ways. The alias approach is a single-user solution, as opposed to the script which will work for all users.
  
===Snoopy Script===
+
==== Snoopy alias ====
The quickest way to get snoopy up and running is to make your own script to run snoopy-nox. It takes three parameters: your network device, your uid, and your gid. These are necessary because snoopy must be ran as root. We'll make a new script. Call it whatever you want. I'll call mine snoopy-sh-local.
+
  
nano /usr/bin/snoopy-sh-local
+
A simple way to get snoopy working is to use an alias.
  
If you don't know your network interface run
+
* First edit your .bashrc file, add the following line as a new line with your interface (for example "enp1s0"):
  
  ifconfig
+
{{hc|~/.bashrc|2=
 +
  alias snoopy-sh-local='sudo snoopy-nox enp1s0 $(id -u) $(id -g)'
 +
}}
  
to determine what it is. My interface (default ethernet) is eth0.
+
* For this time you have to run:
  
How you make your script is ultimately up to you. In my example I get the user's uid and gid using <tt>id -u</tt> and <tt>id -g</tt> respectively. I set the interface explicitly, eth0. Sudo is used because snoopy must be run as root. My script looks like this:
+
  $ source ~/.bashrc
  
#!/bin/bash
+
This command re-reads your .bashrc and is afterwards not necessary because your .bashrc is read on every login.
sudo snoopy-nox eth0 `id -u` `id -g`
+
  
When you've finished your simple script make sure it is executable:
+
==== Snoopy script ====
  
# chmod 755 /usr/bin/snoopy-sh-local
+
You can make your own script to run snoopy-nox. It takes three parameters: your network device, your uid, and your gid. These are necessary because snoopy must be run as root. We'll make a launch script.
  
That's it. Snoopy should now work properly. It is up to you how you want to run it with regards to Warcraft 3. It shouldn't matter whether you start snoopy before or after Warcraft 3. Perhaps you'll want to change your script to run Warcraft 3 as well after snoopy starts.
+
First, if you do not know your network interface run:
  
===Snoopy Alias===
+
# ip a
  
The last step is not necessary. You do not have to make your own script just to execute the program with the correct parameters. All you have to do is to define yourself an alias.
+
to determine what it is. A typical default ethernet interface name is enp1s0.
  
*In your home directory run
+
How you make your script is ultimately up to you. In my example I get the user's uid and gid using {{ic|id -u}} and {{ic|id -g}} respectively. I set the interface explicitly, enp1s0. sudo is used because snoopy must be run as root. Here is an example script:
nano .bashrc
+
 
*Add the following line as a new line with your interface (for example "eth0").
+
{{hc|/usr/bin/snoopy-sh-local|
alias snoopy-sh-local='sudo snoopy-nox eth0 `id -u` `id -g`'
+
#!/bin/bash
*Save and exit the file.
+
sudo snoopy-nox enp1s0 $(id -u) $(id -g)
*For this time you have to run
+
}}
. .bashrc
+
 
This command re-reads your .bashrc and is no longer necessary because your .bashrc is read on every login.
+
When you've finished your simple script make sure it is executable:
 +
 
 +
# chmod 755 /usr/bin/snoopy-sh-local
 +
 
 +
Now snoopy should now work properly. It is up to you how you want to run it with regards to Warcraft 3. It shouldn't matter whether you start snoopy before or after Warcraft 3. Perhaps you'll want to change your script to run Warcraft 3 as well after snoopy starts.
  
 
=== Allowing sudo for snoopy ===
 
=== Allowing sudo for snoopy ===
You might want to allow nopassword sudo for snoopy. First, edit the sudo config file  
+
 
 +
You might want to allow nopassword sudo for snoopy. First, edit the sudo config file:
  
 
  # visudo
 
  # visudo
  
Add a line like the following: %wheel can be replaced with specific usernames if desired, otherwise it'll work for any users in the wheel group.
+
Add a line like the following. %wheel can be replaced with specific usernames if desired, otherwise it'll work for any users in the wheel group.
  
 
  %wheel ALL=NOPASSWD:/usr/bin/snoopy-nox
 
  %wheel ALL=NOPASSWD:/usr/bin/snoopy-nox
  
== Additional Resources ==
+
== See also ==
* [http://snoopy.tuxfamily.org Snoopy Website]
+
  
[[Category:HOWTOs (English)]]
+
* [http://snoopy.tuxfamily.org Snoopy website]

Revision as of 20:42, 23 September 2013

Snoopy is a program similar to Warcraft III Banlist, aimed at improving the experience of Warcraft III players on Battle.net. Though focused on hosting, snoopy can be useful for any users as it allows for pinging, location checks, friends list following, and more. Snoopy is a native program built to use with WarCraft III on Wine.

Installation

Snoopy can be found in the AUR as package snoopyAUR.

Getting started

Snoopy programs

Snoopy installs three programs in the /usr/bin directory:

  • snoopy-sh is a not so useful on arch script intended to run snoopy-nox for the current user. Ignore this.
  • snoopy-ping is a frontend to the ping command that snoopy uses to ping. Feel free to ignore this too.
  • snoopy-nox is the primary program that snoopy runs. This is all we're really going to worry about.

Executing snoopy

Snoopy can be executed in either of the following ways. The alias approach is a single-user solution, as opposed to the script which will work for all users.

Snoopy alias

A simple way to get snoopy working is to use an alias.

  • First edit your .bashrc file, add the following line as a new line with your interface (for example "enp1s0"):
~/.bashrc
alias snoopy-sh-local='sudo snoopy-nox enp1s0 $(id -u) $(id -g)'
  • For this time you have to run:
 $ source ~/.bashrc

This command re-reads your .bashrc and is afterwards not necessary because your .bashrc is read on every login.

Snoopy script

You can make your own script to run snoopy-nox. It takes three parameters: your network device, your uid, and your gid. These are necessary because snoopy must be run as root. We'll make a launch script.

First, if you do not know your network interface run:

# ip a

to determine what it is. A typical default ethernet interface name is enp1s0.

How you make your script is ultimately up to you. In my example I get the user's uid and gid using id -u and id -g respectively. I set the interface explicitly, enp1s0. sudo is used because snoopy must be run as root. Here is an example script:

/usr/bin/snoopy-sh-local
#!/bin/bash
sudo snoopy-nox enp1s0 $(id -u) $(id -g)

When you've finished your simple script make sure it is executable:

# chmod 755 /usr/bin/snoopy-sh-local

Now snoopy should now work properly. It is up to you how you want to run it with regards to Warcraft 3. It shouldn't matter whether you start snoopy before or after Warcraft 3. Perhaps you'll want to change your script to run Warcraft 3 as well after snoopy starts.

Allowing sudo for snoopy

You might want to allow nopassword sudo for snoopy. First, edit the sudo config file:

# visudo

Add a line like the following. %wheel can be replaced with specific usernames if desired, otherwise it'll work for any users in the wheel group.

%wheel ALL=NOPASSWD:/usr/bin/snoopy-nox

See also