Pages

Wednesday, April 17, 2013

Scrap.tf - Automated TF2 bots that scrap bank and trade items

Scrap.tf is a website that you can log in with steam to scrap bank items quickly through the many trade bots that the site offers. You can get in a queue to scrap-bank your weapons and it doesn't matter what class each weapon is, just how many you trade. You can trade up to 200 items at once, giving you about 8 refined metal for all of those items. It is a good resource for idlers with TF2idle accounts to scrap all of their dropped weapons for a given week, or weeks if necessary.



Scrap.tf also has other trade bots that can bank items or even sell you items. There are hat trading bots, item trading bots, and even key trading bots. Keys can be bought for 4.44 refined as of right now. You could then use those keys to buy items from the item banking bot, which offers earbuds (buds), max's severed heads, and bills, among other things.

Good luck fellow TF2ers.

Tuesday, April 16, 2013

Kill a Process by Process Name from Ubuntu Command Line



There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is named irssi
kill $(pgrep irssi)
killall -v irssi
pkill irssi
kill `ps -ef | grep irssi | grep -v grep | awk ‘{print $2}’`
These techniques can be useful in shell scripts, where you wouldn't know the process ID and would need to restart or kill a process.

Wednesday, April 10, 2013

RPi VNC Server



What does it do?

Sometimes it is not convenient to work directly on the Raspberry Pi. Maybe you would like to work on it but from another computer by remote control. You can do this and the remote computer can even be anywhere in the world over the internet. This tutorial shows how you can view and control the raspberry pi desktop from your computer's desktop by using special software.

What do you need?

  • A Raspberry Pi
  • A boot SD card for the Raspberry Pi
  • A network connection (Ethernet or WiFi)
  • Special software on both the Raspberry Pi and the remote, controlling computer

What skill level is required?

This project does not require any coding or compilation. Very basic Linux and networking knowledge would be useful, but not essential.
You need to...
  • Install software
  • Enter basic Linux commands
  • Use standard software tools (Windows/Linux/Mac) to add software to your PC
  • Connect computers using ethernet cables

How does it work?

The commands described below start a "virtual" graphical session. Instead of using a hardware framebuffer, this uses RAM for a framebuffer. It also opens a network channel or port that allows programs on other computers (if they provide the password) to show the framebuffer and provide mouse and keyboard events.
This way you can run a desktop session on the raspberry pi, but display and control it elsewhere.
Because the framebuffer isn't the real framebuffer you cannot take advantage of the GPU to accelerate operations on the screen.

Overview of this project

You need to
  • Install VNC (Virtual Network Computing) server software on the Raspberry Pi
  • Start the VNC server software
  • Install a VNC client on another computer
  • Connect over a network from your computer to the Raspberry Pi

Instructions

Log in to your Pi and install the Tight VNC Package
$ sudo apt-get install tightvncserver
Next Run TightVNC Server which will prompt you to enter a Password and an optional View Only Password
$ tightvncserver
Once that is done you can start a VNC server from the shell prompt. This example starts a session on VNC display zero (:0) with full HD resolution:
$ vncserver :0 -geometry 1920x1080 -depth 24
(If fonts appear the wrong size, add '-dpi 96' to the end.) Or you could create a script to save typing in the whole thing.
$ nano svnc.sh (call the file whatever you like)
Add the lines:
#!/bin/sh
vncserver :0 -geometry 1920x1080 -depth 24 -dpi 96
Ctrl-x y <return> (To Exit Nano and Save)
Set the file to Execute
$ chmod +x svnc.sh
then to run
$ ./svnc.sh
Run at boot.
Start a root session
sudo bash
Create a file in /etc/init.d with a suitable name such as vncboot with the following content.
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO

#! /bin/sh
# /etc/init.d/vncboot

USER=root
HOME=/root

export USER HOME

case "$1" in
 start)
   echo "Starting VNC Server"
   #Insert your favoured settings for a VNC session
   /usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565
   ;;

 stop)
   echo "Stopping VNC Server"
   /usr/bin/vncserver -kill :0
   ;;

 *)
   echo "Usage: /etc/init.d/vncboot {start|stop}"
   exit 1
   ;;
esac

exit 0
Modify the file permissions so it can be executed
chmod 755 /etc/init.d/vncboot
Enable dependency based boot sequencing
update-rc.d /etc/init.d/vncboot defaults
If enabling dependency based boot sequencing was successful, it says
 update-rc.d: using dependency based boot sequencing
But if it says
update-rc.d: error: unable to read /etc/init.d//etc/init.d/vncboot
then try the following command
update-rc.d vncboot defaults
Reboot your Raspberry PI and you should find a vncserver already started.

Install Tight VNC on your desktop from the link below or most VNC clients work I believe.
http://www.tightvnc.com/download.php
Or install it using your package manager. The following works on my ubuntu 11.10 workstation
sudo apt-get install xtightvncviewer
Then use <Your Pi IP>:1 (e.g. 192.168.1.2:1) as the host name when connecting.[1]
Works Great, select full screen from the tool bar and a full 1080p 24bit desktop is yours from anywhere.
  1.  You can put your raspberry pi in /etc/hosts on Linux systems. I think you can make such a file on windows too. Then you can refer to your raspberry pi as "rpi" or whatever you called it.

Getting VNC Server to Work on a Specific User

Instead of using the script in the Raspberry Pi wiki, use this one provided by "PenguinTutor":
#!/bin/sh
# /etc/init.d/tightvncserver
# Customised by Stewart Watkiss
#http://www.penguintutor.com/linux/tightvnc
# Set the VNCUSER variable to the name of the user to start tightvncserver under
VNCUSER='pi'
eval cd ~$VNCUSER
case "$1" in
 start)
   su $VNCUSER -c '/usr/bin/tightvncserver :1'
   echo "Starting TightVNC server for $VNCUSER "
   ;;
 stop)
   pkill Xtightvnc
   echo "Tightvncserver stopped"
   ;;
 *)
   echo "Usage: /etc/init.d/tightvncserver {start|stop}"
   exit 1
   ;;
esac
exit 0
Now, change the VNCUSER=pi to your desired username, so for example: VNCUSER=jsmith
That'll make it boot on the username of which you want it to boot on... but I then received the grey screen error when remotely accessing the Pi from my computer, now the way you fix this is, open up the xstartup file that was created when VNCSERVER executes on your desired username. Now the way you access it and edit it is by:
sudo nano .vnc/xstartup 
.vnc is usually in the home directory.
Delete everything that is in xstartup (or not in as mine was), and add this:
!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid black
/usr/bin/lxsession -s LXDE &
Now it should work.

Does Your Openbox Configuration Settings Not Start on VNC?

You'll often find yourself in a position where VNC will start, but you'll get things such as multiple virtual desktops appearing, and you try to save it in the "Openbox Configuration Manager," and they go away for a second, but then you find you'll restart the Pi and then they appear again. Here's how to fix it:
Create, or edit the current autostart.sh file which is located in:
.config/openbox/autostart.sh
Edit using "Nano" or any other text editor, I use Nano as it is the most comfortable for me, so do:
sudo nano .config/openbox/autostart.sh/
Add the line: exec openbox-session
Now add the line exec openbox-session again in .vnc/xstartup and now it should work.
But you can't really save the setting in Openbox Configuration Manager on VNC, but you have to do it manually; so you open this file:
nano .config/openbox/lxde-rc.xml
Scroll down to: <desktops>
You should see a bunch of stuff there, but only focus on this: <number>6</number> or something similar.
Change the number of desktops you want within the <number></number> bit.
I changed mine to 1, because that's all I want.
It should now work!

Limitations and Alternatives

In this example TightVNC has been used. This is a popular and relatively friendly program that uses the VNC protocols and is included in most GNU/Linux distributions. However it does have it's limitations. The biggest of these is that it creates new desktops for each connection. It may be that what you want to do though is view and control the same desktop that shows on the monitor/TV plugged into the Raspberry Pi. To do this a better tool to use is x11vnc. This is more powerful but less easy to use. However if you already have a desktop running it will latch on to it and share it as a default. This too is fairly popular and included in many GNU/Linux distribution repositories such as Raspbian.

Security Considerations

Be aware that basic VNC is not secure. It is not encrypted unless you are advanced in setting it up. If you use it over the internet it can result in criminals "bouncing" you off your connection and taking over. There are even computer robot tools that try to do this. You must set a password but even then it is sometimes possible to take over someone's connection after they have entered it. A good tip is to set the server to shift from the default port 5900 to something else chosen randomly as long as it is spare.

Monday, April 8, 2013

Outputting a directory listing (ls) in Linux to a text file

So i needed to make a listing of files that were in a folder on my *Nix box. This command couldn't be any simpler.

ls > listing.txt

I tried to figure this out on windows and it was giving me a headache. Here's to the power of Linux!

Saturday, April 6, 2013

Raspberry PI as a seedbox alternative storage with openVPN


  1. Believe it or not, seed box users are notorious about hit & running. They stick around for the initial swarm, and then seed for less than a month on that connection because hdd space is limited. This is where long seeding comes in for 'natural' seeders. The longest seeds are generally non box users. They may be a seed box user seeding from his home connection, but generally old seeds are natural.

    Seed for ages and upload fresh content.



You are right, we seed box users have to manage the HD space and that usually means having to delete older stuff to make room. This is the reason I added a raspberry pi at home with a 2TB drive for the sole purpose of long term seeding.

I use the the PI to augment my seedbox. My seedbox provider (Feral) offers openvpn as part of the service. By using the VPN both my seedbox and my PI have the same IP address so security is the same. The difference is, as others have already stated, speed. My home speed is nowhere near what my seedbox provides but it provides a lot more HD space for long term seeding. This is really handy on trackers that offer seeding bonuses.

Friday, April 5, 2013

ESET SMART SECURITY : How do I exclude certain files or folders from real-time scanning?



KB Solution ID: SOLN560|Last Revised: September 20, 2012
File-level scanning of some email servers, backup software, gaming applications, etc. can occasionally cause abnormal system behavior. To exclude specific applications or folders from the real-time scanner, follow the step-by-step instructions below:
  1. Open ESET Smart Security or ESET NOD32 Antivirus. How do I open my ESET product?
     
  2. Press the F5 key to display the Advanced Setup window.
     
  3. From the Advanced Setup tree, click Antivirus and antispyware  Exclusions and then click the Add... button.
     
      

    Figure 1-1
  4. The Add exclusion window will be displayed. Using the directory tree, browse for the folder or file you wish to exclude. The directory path will automatically display In the Exclusion: field. Click OK to save the exclusion.


    NOTE:

    To exclude the contents of an entire drive, the * symbol can be used as a wildcard. For example, to exclude scanning of the entire C:\ drive, you would enter C:\* in the Exclusion: field. To exclude all .doc files from scanning, you would enter C:\*.doc in the Exclusion: field. For additional information on the use of wildcards to exclude file/folder scanning, press F1 from the Add exclusion window.




    Figure 1-2
  5. Click OK again and close the main program window. Restart your computer.

NOTE:

If the application you are excluding communicates using a network protocol (HTTP, FTP, etc.) you must also follow the steps below:
  
  1. From the Advanced Setup tree, click Antivirus and antispyware  Web access protection  HTTP  Web browsers.
     
  2. If the application you wish to exclude is listed, double-click the corresponding check box. A red 'X' will appear. ClickOK to save changes—you are finished. If you do not see the application you are trying to exclude, proceed to step 3.
     
      

    Figure 1-3
  3. Click the Add button to browse and select the .exe file of the desired application. The application will appear in the list of applications to exclude. Double-click the corresponding check box until you see a red 'X'. Click OK to save changes.

Wednesday, April 3, 2013

Deluge Thin Client



  1. GTK UI
    1. Server Setup
      1. Enable Remote Connection
      2. Restart Daemon
      3. Verify IP Addresses
    2. Client Setup
      1. Create SSH Tunnel
  2. Web UI
    1. Server Setup
    2. Client Setup
Deluge can be setup in such a way that several machines (clients) can control deluge (daemon) on a central machine (server) through one of deluge's UI. For Deluge 1.2 upwards, all communication between the GTK UI and daemon is encrypted so SSH tunnelling is not a requirement.
The server setup sections are written for a headless linux server although they could be adapted for other platforms. The client setup sections are platform independent.
Note: Both the client and the server need to be similar versions, i.e. both 1.2.x or both 1.3.x.

GTK UI

Server Setup

  1. Install Deluge (including deluged) on the server.
  2. Run deluged, the Deluge daemon: (You may wish to enable logging and/or use an InitScript)
    deluged
    
  3. Add a user and password to the authentication file (this does not have to be your server's user/pass):
    echo "username:password:level" >> ~/.config/deluge/auth
    
    where "username" and "password" are the username and password you intend to use and "level" is your desired authentication level. For example:
    echo "bob:letMEin:10" >> ~/.config/deluge/auth
    
See UserGuide/Authentication for more information on authentication levels.

Enable Remote Connection

We will use deluge-console to configure deluged to accept connections from machines other than localhost.
Note: These steps can be omitted if you are using SSH Tunnelling.
  1. Run the Console UI:
    deluge-console
    
  2. Enable remote connections and check it was set properly:
    config -s allow_remote True
    config allow_remote
    
  3. Exit the Console UI:
    exit
    

Restart Daemon

pkill deluged
deluged

Verify IP Addresses

You will need to know the server IP address for setting up the client(s). If you do not know your server's private or public IP address use these commands:
  1. Private IP:
    ifconfig | grep -e 'inet addr' | grep -v '127.0.0.1' | cut -f2 -d':' | cut -f1 -d' '
    
  1. Public IP:
    curl ifconfig.me
    
Congratulations! The server is now setup for remote GTK UI access.

Client Setup

  1. Run deluge.
  2. Go to "Preferences -> Interface" and untick 'Classic Mode' to disable it.
  3. Restart deluge. You should now see the Connection Manager pop up.
  4. Remove the localhost daemon.
  5. Click "Add" and for 'Hostname' enter your server's IP. (For SSH Tunnelling use '127.0.0.2' and Create SSH Tunnel before continuing)
  6. Leave the Port as default (58846).
  7. Enter the Username & Password you added to the authentication file then finish by clicking 'Add'. A green tick should now appear as the status for the host you just added.
  8. (Optional) Expand "Options" and select "Automatically connect to selected host on startup" and "Do not show this dialog on start-up".
  9. Click "Connect" and the connection manager pop up box should disappear.
Congratulations! You can now access deluge on the server via the GTK UI.

Create SSH Tunnel

  1. Open up a terminal and enter the following, replacing <server> with the public IP of your server.
    ssh -fNL 127.0.0.2:58846:localhost:58846 <server>
    
Note: We use 127.0.0.2 instead of localhost so that deluge client knows that we are connecting to a remote daemon.
Note: If you get the error:
bind: Can't assign requested address
You need to add 127.0.0.2 as an alias for the loopback device:
sudo ifconfig lo0 add 127.0.0.2

Web UI

Server Setup

  1. Install Deluge on the server.
  2. Run the deluge daemon (You may want to enable logging and/or use an InitScript.):
    deluged
    
  3. Run deluge Web UI:
    deluge-web
    
    You can also use the --fork option to have the deluge-web process run in the background and again, you may want to use an InitScript.
    deluge-web --fork
    
  1. (Optional) If you do not know your server's public ip, run:
    curl ifconfig.me
    
Congratulations! The server is now setup for web UI access.

Client Setup

  1. Open your preferred web browser.
  2. Open the URL:
    http://<server>:8112
    
    where <server> is either the private or public ip of the server depending if you are on the server's private network or not.
  1. Default password is "deluge".
Congratulations! You can now access deluge on the server via the web UI.