Pages

Thursday, February 28, 2013

How to install OpenVPN on a Debian/Ubuntu VPS instantly


This is a follow up post to How to setup a VPN server on a CentOS VPS instantly same requirements and instructions apply.
Minor distribution specific changes were made on the previous CentOS script to get it working under Debian and Ubuntu. We might create one single script which will install OpenVPN on most distributions and architectures in future.
To install issue the following commands logged in as root on your VPS (Refer to this post if you are facing any issues)
wget http://vpsnoc.com/scripts/debian-openvpn.sh
chmod +x debian-openvpn.sh
./debian-openvpn.sh
For any other issues and feedback please e-mail us at support@vpsnoc.com
You may use and modify this script however you see fit, provided that you do not edit the original copyright.
#!/bin/bash
# Quick and dirty OpenVPN install script
# Tested on debian 5.0 32bit, openvz minimal debian OS template
# and Ubuntu 9.04 32 bit minimal, should work on 64bit images as well
# Please submit feedback and questions at support@vpsnoc.com
# John Malkowski vpsnoc.com 01/18/2010
ip=`grep address /etc/network/interfaces | grep -v 127.0.0.1  | awk '{print $2}'`
apt-get update
apt-get install openvpn libssl-dev  openssl
cd /etc/openvpn/
cp -R /usr/share/doc/openvpn/examples/easy-rsa/ /etc/openvpn/
cd /etc/openvpn/easy-rsa/2.0/
chmod +rwx *
. ./vars
./clean-all
source ./vars
echo -e "nnnnnnn" | ./build-ca
clear
echo "####################################"
echo "Feel free to accept default values"
echo "Wouldn't recommend setting a password here"
echo "Then you'd have to type in the password each time openVPN starts/restarts"
echo "####################################"
./build-key-server server
./build-dh
cp keys/{ca.crt,ca.key,server.crt,server.key,dh1024.pem} /etc/openvpn/

clear
echo "####################################"
echo "Feel free to accept default values"
echo "This is your client key, you may set a password here but it's not required"
echo "####################################"
./build-key client1
cd keys/
client="
client
remote $ip 1194
dev tun
comp-lzo
ca ca.crt
cert client1.crt
key client1.key
route-delay 2
route-method exe
redirect-gateway def1
dhcp-option DNS 10.8.0.1
verb 3"
echo "$client" > $HOSTNAME.ovpn
tar czf keys.tgz ca.crt ca.key client1.crt client1.csr client1.key $HOSTNAME.ovpn
mv keys.tgz /root

opvpn='
dev tun
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
group daemon
daemon'
echo "$opvpn" > /etc/openvpn/openvpn.conf
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j MASQUERADE
iptables-save > /etc/iptables.conf
echo "#!/bin/sh" > /etc/network/if-up.d/iptables
echo "iptables-restore < /etc/iptables.conf" >> /etc/network/if-up.d/iptables
chmod +x /etc/network/if-up.d/iptables
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
/etc/init.d/openvpn start
clear
echo "OpenVPN has been installed
Download /root/keys.tgz using winscp or other sftp/scp client such as filezilla
Create a directory named vpn at C:Program FilesOpenVPNconfig and untar the content of keys.tgz there
Start openvpn-gui, right click the tray icon go to vpn and click connect
For support/bug reports email us at support@vpsnoc.com"

How to Install rTorrent/ruTorrent on Debian/Ubuntu VPS


This tutorial will guide you through the setup of a fully-featured seedbox running on a Debian or Ubuntu system, including:
  • libtorrent 0.13.0
  • rTorrent 0.9
  • ruTorrent Web UI (3.0)
This guide has been tested with Debian 6 (x86_64) and Ubuntu 11.04 (x86_64).

To start, access your VPS via SSH (as the root user) and do the following to update your platform and install some required dependencies:
# apt-get update
# apt-get install subversion build-essential automake libtool libcppunit-dev libcurl3-dev libsigc++-2.0-dev unzip unrar-free curl libncurses-dev
# apt-get install apache2 php5 php5-cli php5-curl
Enable scgi for Apache:
# apt-get install libapache2-mod-scgi
# ln -s /etc/apache2/mods-available/scgi.load /etc/apache2/mods-enabled/scgi.load
Install XMLRPC:
# mkdir /install;cd /install
# svn checkout http://xmlrpc-c.svn.sourceforge.net/...mlrpc-c/stable xmlrpc-c
# cd xmlrpc-c
# ./configure --disable-cplusplus
# make
# make install
Intall libtorrent:
# cd /install
# wget http://vps6.net/src/libtorrent-0.13.0.tar.gz
# tar xvf libtorrent-0.13.0.tar.gz
# cd libtorrent-0.13.0
# ./autogen.sh
# ./configure
# make
# make install
Install rTorrent:
# cd /install
# wget http://vps6.net/src/rtorrent-0.9.0.tar.gz
# cd rtorrent-0.9.0
# ./autogen.sh
# ./configure --with-xmlrpc-c
# make
# make install
# ldconfig
Create required directories:
# mkdir /home/seeder1/rtorrent
# mkdir /home/seeder1/rtorrent/.session
# mkdir /home/seeder1/rtorrent/watch
# mkdir /home/seeder1/rtorrent/download
Setup .rtorrent.rc file (rTorrent config):
# cd ~/
# wget http://vps6.net/src/.rtorrent.rc
# cp .rtorrent.rc /home/seeder1/
(Edit the settings in .rtorrent.rc, like max upload/download speed, max connected peers, etc, as needed.)

Install rTorrent:
# cd /install
# wget http://vps6.net/src/rutorrent-3.0.tar.gz
# tar xvf rutorrent-3.0.tar.gz
# mv rutorrent /var/www
# wget http://vps6.net/src/plugins-3.0.tar.gz
# tar xvf plugins-3.0.tar.gz
# mv plugins /var/www/rutorrent
# rm -rf /var/www/rutorrent/plugins/darkpal
# chown -R www-data:www-data /var/www/rutorrent
Secure /rutorrent:
# a2enmod ssl
# a2enmod auth_digest
# a2enmod scgi
# openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
# chmod 600 /etc/apache2/apache.pem
# htdigest -c /etc/apache2/passwords seedbox seeder1
(Enter a password of your choice when prompted, you will use this to log in to the ruTorrent web UI.)
# cd /etc/apache2/sites-available/
# rm -rf default
# wget http://vps6.net/src/default
# a2ensite default-ssl
# /etc/init.d/apache2 reload
Install screen:
# apt-get install screen
Start rTorrent in a detached shell using screen:
# screen -fa -d -m rtorrent
(To start rtorrent automatically when the VPS is booted, add the above command to /etc/rc.local)

You can now access ruTorrent at http://xx.xx.xx.xx/rutorrent/(replace xx.xx with your server's IP address). You should be greeted with a login prompt, where the username is "seeder1" and the password is the one you set above in the "secure /rutorrent" section.

Easy ruTorrent installer + Web server, FTP, Webmin (Ubuntu/Debian/Fedora/More)

All credit goes to Author brock from forums.rutorrent.org  original post here for reference also check there for faq questions regarding his script

This is an easy installer for ruTorrent (multi-user support), rtorrent, plugins and other dependencies. It requires noLinux knowledge. The only requirement is that you can copy and paste three lines of code. In 5-10 mins, you should have a fully working ruTorrent.

To install it, use one of the three lines of code below, depending on which OS you are using. The installation script will ask you some questions and then install everything you selected.

Ubuntu and Ubuntu clones:
cd
wget --no-check-certificate -O autodl-setup http://sourceforge.net/projects/autodl-irssi/files/autodl-setup/download
sudo sh autodl-setup

Any other OS
Log in as root:
yum update
allow it to update all
su -
Then install it:  to install wget on centos use "yum install wget"
wget --no-check-certificate -O autodl-setup http://sourceforge.net/projects/autodl-irssi/files/autodl-setup/download
sh autodl-setup

If you already have another web server installed, you may need to disable it or uninstall it. If you don't, the web server this script installs (*) might not work.

What it will do:
  • Install a web server (*)
  • Install ruTorrent with multi-user support (http and https)
  • Install 1st party ruTorrent plugins
  • Install an encrypted FTP server (vsftpd)
  • Install rtorrent with xmlrpc-c support
  • Install the IRC auto downloader plugin (autodl-irssi)
  • Install Webmin
  • Install a startup script for rtorrent and Irssi

You can disable any of the above by answering no when you run the installer.

* Apache, nginx, or lighttpd.

I've tested the following OSes (clean installs):
  • Arch Linux 2010.05
  • ArchBang 2010.10
  • CentOS 4.8
  • CentOS 5.5
  • ClearOS 5.2
  • Debian 4.0r7
  • Debian 5.0.3
  • Debian 5.0.7
  • Debian 6.0.0
  • Fedora 13
  • Fedora 14
  • Fedora 15
  • Frugalware 1.3
  • Gentoo 1.12.14
  • Linux Mint 8
  • Linux Mint 9
  • Linux Mint 10
  • Mandriva Linux release 2008.0
  • Mandriva Linux release 2010.1
  • MEPIS 8.5
  • openSUSE 11.1
  • openSUSE 11.3
  • openSUSE 11.4
  • Pardus 2009.2
  • Pardus 2011
  • PCLinuxOS 2010
  • Peppermint OS
  • RHEL 5.5
  • RHEL 6.0
  • Sabayon 5
  • Scientific Linux 5.5
  • Scientific Linux 6.0
  • Ubuntu Server 6.06.2 LTS
  • Ubuntu Server 8.04.4 LTS
  • Ubuntu Server 10.04.1 LTS
  • Ubuntu Server 11.04
  • Ubuntu 10.10
  • Unity release 2010

If your OS isn't listed, but is derived from one of the above OSes, then the installer could still work. Eg., all Ubuntu and Debian derived OSes should work.


Issues:
SELinux:
  • If you have SELinux enabled, it's possible Apache or vsftpd won't work.
  • To disable Selinux.
  • Edit /etc/selinux/config (e.g. $sudo vi /etc/selinux/config)

    Find the line:

    SELINUX=enforcing

    If you simply want to set selinux to permissive mode - which will still warn you when something would have been denied

    change to

    SELINUX=disabled

Firewall:
  • The script doesn't open any ports in your firewall. If your firewall is enabled, you may need to open a few ports.
  • if u cant access webgui use "iptables -F"

Ubuntu Server 6:
  • You need to enable the universe repository

RHEL/CentOS/Scientific 4 & 5:

geoip plugin:
  • Some OSes don't have the PHP geoip module (thus disabling the ruTorrent geoip plugin).

[Linux] Setting Up a Debian VNC Server (via SSH tunnel)


I. Abstract
No doubt, configuring a web server won’t work without being in the know of basics about the terminal, vim or nano. Anyway many tasks can also be performed by administrating a server using a GUI. The problem is: only Windows 2003 or Windows 2008 come with a preinstalled remote desktop connection – and they are really much more expensive than Linux solutions. When using our beloved and most stable Linux distributionDebian, it mostly comes preinstalled with almost nothing.
The following article assumes, you have a server, which can be managed via ssh rather than by physically access. We will show you how to setup a GNOME desktop on that server and virtually connect to that desktop using an SSH tunnel.
In case you are running a client machine with:
  • Linux or Mac OS X, just keep on reading, all tools come onboard
  • MS Windows, please install Cygwin with the openSSH package first
    (Note: you may also use the Putty/Pageant combo instead, but this will require some different steps. The following article is straightened to using Cygwin, because we feel it’s got several client sided advantages in contrast to Putty)
II. Preparations
First of all: log into your server via SSH as root. Make sure openSSH has been updated, a serious security flaw has been discovered some days ago concerning Debian based Linux distros. Make also sure you have secured your SSH access. We really recommend public-, private-key crypto for ssh login.
III. Update and Upgrade your server with current packages
Being logged into your server as root, do the following:
  • server$ apt-get update
  • server$ apt-get upgrade
  • server$ apt-get dist-upgrade
to upgade your whole installation.
IV. Installing GNOME
After having done a dist-upgrade we are used to reboot the servers. This might not be necessary in all cases and might be a strange obsession from ancient MS Windows times, but we would recommend it to allow all scripts to become initialized anew.
After reboot login as root again and do the following:
  • server$ apt-get install gnome-desktop-environment
V. Install fonts for GNOME and VNC
Install some (required) fonts for the VNC server GNOME session:
  • server$ apt-get install xfonts-100dpi
  • server$ apt-get install xfonts-100dpi-transcoded
  • server$ apt-get install xfonts-75dpi
  • server$ apt-get install xfonts-75dpi-transcoded
  • server$ apt-get install xfonts-base
VI. Install VNC server
We prefer TightVNCServer, simply because it worked from the very beginning…
  • server$ apt-get install tightvncserver
    (installs TightVNCServer)
  • server$ tightvncserver :1
    (initialize the VNC server for the first time, it will copy some files to ~/.vnc folder and it will ask twice for a VNC password – we recommend to provide it for your own safety)
  • server$ tightvncserver -kill :1
    (stop VNC server – for further configuration purposes)
VII. Configure VNC server
In this example we’re gonna use nano, you can also use vimvi or whatever you think what editor fits your needs best:
  • server$ nano ~/.vnc/xstartup
We need to change the standard X-Windows interface, since we like to use GNOME.
Original xstartup file:
  • #!/bin/shxrdb $HOME/.Xresources
    xsetroot -solid grey
    x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    x-window-manager &
Change this to
  • #!/bin/shxrdb $HOME/.Xresources
    xsetroot -solid grey
    x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    # x-window-manager &

    gnome-session &
Save and exit nano (ctrl + x).
VIII. Setup an SSH tunnel for VNC connections
VNC connections are usually to be found on port 5901. Usually they are not encrypted on that port. That means you send the VNC password unencrypted thru the net to that port. Since this allows too many attacks, it is just too weak for a web server solution.
We don’t want to provide possible Zombies. So the solution is: we just setup an SSH tunnel as a wrapper for our VNC connection. Further information about SSH tunneling can be found here and here.
On your client machine do the following:
  • client$ ssh -f -N -L 5901:localhost:5901 root@yourserver.net
In case you changed the ssh port on your server (like we recommended in our article here), you need to specify your ssh port for the SSH tunneling aswell, like:
  • client$ ssh -f -N -L 5901:localhost:5901 root@yourserver.net -p 8722
    (in this case we use port 8722 instead of the standard port 22)
IX. Connect to your server via VNC
Start tightvnc on your server:
  • server$ tightvncserver :1
In case you like to have a different screen resolution than 1024×768 you may start tightvnc with:
  • server$ tightvncserver -geometry 1280x1024 :1
On a Mac the VNC client is called Chicken of the VNC (Download here). On Windows you can use RealVNC (Download here). Both work quite similar and contain almost the same features.
Use the VNC client (like Chicken of the VNC) to connect to your SSH tunnel,
  • connect to localhost (or 127.0.0.1)
  • display 1, because of port 5901 (display 0 would be port 5900)
  • enter your VNC password
    (the password, that has been setup in step VI. Install VNC server)

  • hit connect and
  • you should see something like that (on vservers the performance may be kinda slow and GNOME’s GUI may take some time to initialize).
Congratulations, you’re done.
X. Stopping VNC session and SSH tunneling
You can simply quit the VNC session by just closing your VNC client. But the SSH tunnel from your client to your server will still be up until you stop it (means until you kill it). We may provide a simple script to do that when we finished cleaning it up. Right now it is kinda spaghetti code. Although this is not too comfy, you may live with a simple command until then:
  • client$ killall ssh
It simply kills every SSH process :-)
XI. Final words
We hope you enjoyed our trip into the amazing VNC worlds on Debian and also hope you learned something. You could now setup a firewall like firestarter, which is GUI driven. We will publish some words about this in the early future.

Administer Ubuntu Server 12.04 using VNC


Once you've installed Ubuntu Server you will need a mechanism to be able to administer it. One way is to Install Putty. Putty gives you a "Command Line" interface and so you'll need to learn a few Linux commands in order to be able to administer your server this way. Some people find this prospect rather too daunting and would rather use a graphical user interface (GUI) instead. As a result many people actually install Ubuntu Desktop instead of installing Ubuntu Server since the desktop version of Ubuntu has the GUI built in. There is a better way however, and that is to install VNC. VNC provides a "virtual desktop" so it is more lightweight than a full blown desktop installation.

NOTE: If you're jumping into this guide here then it's worth mentioning that this guide has been tested on Precise Pangolin 12.04LTS, Lucid Lynx 10.04LTS, Karmic Koala 9.10, 9.04 Jaunty, and 8.10 Intrepid. However, at the time of writing VNC is quite flaky on Precise Pangolin 12.04LTS (although it is getting better all the time) and so I don't particularly recommend you attempt to install it on this version of Ubuntu. You might want to head over to the forums for the latest views on VNC on 12.04.
So to perform the installation of VNC you can either type the following commands from a Putty session or, if you've got a screen and keyboard attached to your server, then you can use the command line itself.
First off you need to type:
sudo apt-get update
You'll be prompted for a password. This is the password you created when you installed Ubuntu. Ubuntu tends to prompt for a password each time you issue a "sudo" command.
TIP: If you're going to be following this guide step by step using Putty then you can save yourself some typing by simply highlighting each command below, right-clicking on it and selecting Copy. Then toggle over to your Putty Session and right-click once more. The command you've just copied from here will be automatically pasted into your Putty Session.

Install the Gnome components

First off we need to install the Gnome components for our virtual desktop. So type the following command (or copy it!):
sudo apt-get install gnome-core
when prompted type Y and then press [Enter]. This will install the gnome desktop components.

Install a Virtual Desktop using VNC

Now we've installed the gnome components for the desktop we need to install VNC to be able to interact with it. So type:
sudo apt-get install vnc4server
when prompted type Y and press [Enter]. This will install VNC Server which is required for running the virtual desktop on the server. Next type:
vncserver
You'll then be prompted to create and verify a new password. Once you've entered it you'll see the following screen:

We now need to kill the session we just created and make a tweak to the startup script for VNCServer to make it work properly. If we don't perform this step then all we will see is a grey cross-hatched screen with an "X" cursor and/or a grey screen with a Terminal Session, depending on the Ubuntu version. Not very useful!
You're probably wondering why we just created a session and then killed it before we'd actually used it? Well, creating the session for the first time automatically generates the file we now need to edit.

So, type the following command to kill the session:
vncserver -kill :1
Now type the following command to open up the file we need to edit:
vim .vnc/xstartup
The modifications we need to make to this file depend on the version of Ubuntu we're using so make sure you follow the correct section:

Ubuntu versions up to and including 9.10 Karmic Koala

Scroll down to the line which currently reads #unset SESSION_MANAGER and press the [Insert] key once (this will switch us into "edit" mode) and then remove the #
Do the same for the line after that. Plus change that line to read as follows:
exec sh /etc/X11/xinit/xinitrc
Note the "sh".
Change the xterm -geometry line as below and once you've made these changes the file should look like this:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Ubuntu Versions 10.04 Lucid Lynx & Maverick Meerkat 10.10

Change the file as above but note the last two lines are different in these versions of Ubuntu:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

Ubuntu Version Precise Pangolin 12.04LTS

Change the file so it looks like this:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
gnome-session --session=gnome-classic &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
So, we've unmasked the unset SESSION_MANAGER line, added the gnome-session --session=gnome-classic & lineand masked the last two lines out.

All Versions

When you're done editing the file for your particular version of Ubuntu press the [Esc] key once and type the following:
:wq
This should save the changes and bring you back to the command line. If you make a mistake editing the file then issue :q! instead of :wq to abort your changes.
Next type the following command to create the VNC Session once more:
vncserver -geometry 1280x1024
where 1280x1024 is the resolution of your DESKTOP COMPUTER. It has nothing to do with the resolution of the server itself. This command will create a new VNC session on your server. Note: For versions of Ubuntu prior to Precise Pangolin 12.04LTS add a -depth 24 argument so the command should read vncserver -geometry 1280x1024 -depth 24
Next, download and install TightVNC onto your desktop computer. When you launch it type the "X Desktop name" in the VNCServer box. See the DOS-type screenshot above for the name of your "X Desktop name". So, in my case I'd typeMyMediaServer:1 in the VNC Server Listbox. See below.
then click Connect, enter the password you created when you typed the vncserver command the first time round and you should then see a screen like this (Note that on Precise Pangolin 12.04LTS the screen is blue and that error message doesn't appear):

Click the Delete button on the error message which is displayed and you now have a nice shiny desktop view onto your server!
Incase you're wondering how what we've just installed differs to simply installing the full blown Desktop version of Ubuntu then connect a screen to your server now and you'll see it's still sitting there on a black screen with a flashing cursor waiting for you to type your username in. What we've just installed is just a "virtual desktop" onto your server. Neat eh!
Currently this "virtual desktop" runs in a window on your Windows desktop. If you want to switch to "Full Screen" mode, right-click on the TightVNC icon on the taskbar on your windows desktop and select Full screen from the menu. ClickOK on the next message. Now it's as tho you're actually sitting in front of your server. Very cool!
To switch out of Full Screen mode and return to Window mode press Ctrl-Esc on your keyboard to bring back your Windows Desktop taskbar. Then right-click on the TightVNC icon on the taskbar and uncheck the Full Screen option.
I know a lot of people wouldn't bother installing a virtual desktop on their servers (and I've no doubt any Linux veterans reading this will be scoffing that I've done so) but I was a total Linux newbie when I started this project and the thought of administering everything using the command line was simply too daunting a prospect. Even tho I now feel much more comfortable with Ubuntu I still find it really handy to just nip into the Ubuntu desktop and tweak something.
When you reboot the server you'll discover that you are unable to re-launch the VNC session and you'll receive a "Failed to connect to server" error message. This is because the vncserver -geometry 1280x1024 -depth 24 command we typed above is not persistent. To solve this we need to ensure that VNC is run on boot: How to run VNC on startup

The Synaptic Package Manager is not installed by default in Lucid or Karmic

At the time of writing the Synaptic Package Manager does not get installed by default in Lucid or Karmic when you install the core gnome desktop. The Synaptic Package Manager is a great tool which makes adding and removing applications a breeze. So we'll simply install it manually by typing the following two commands in a Terminal/Putty session:
sudo apt-get update
sudo apt-get install synaptic
When you now go into your server desktop via VNC you'll find the Synaptic Package Manager under the System ->Administration menu.

How to prevent Gnome starting on the server on boot

On Ubuntu versions 10.10 (Maverick Meerkat), 11.04 (Natty Narwhal), 11.10 (Oneiric Ocelot) & 12.04 LTS (Precise Pangolin) gnome is automatically started on boot once the above instructions have been followed. So, if you connect a monitor to your server you will see the GUI sitting there waiting for you to log in. You can prevent this happening by carrying out the following tweak:
So, issue the following command to open up the relevant script:
sudo vim /etc/init/gdm.conf
You want to mask out the few lines which start the service ie. start on ((filesystem.... so the first few lines of the script should look like this once you've edited it:
# gdm - GNOME Display Manager
#
# The display manager service manages the X servers running on the
# system, providing login and auto-login services

description "GNOME Display Manager"
author "William Jon McCann <mccann@jhu.edu>"

#start on ((filesystem
# and runlevel [!06]
# and started dbus
# and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
# or stopped udev-fallback-graphics))
# or runlevel PREVLEVEL=S)

stop on runlevel [016]

emits login-session-start
Save your changes then reboot the server and that log-in screen should no longer appear. 

Wednesday, February 27, 2013

Hard Reset Or 30/30/30 on a router


Image:Warning.png
DO NOT attempt to reset or power cycle the router while it is still in the process of upgrading!
Wait a couple of minutes after upgrade is complete and the router has rebooted itself.

Hard Reset (aka 30/30/30 reset):

The following procedure will clear out the NVRAM and set dd-wrt back to default values:
  • With the unit powered on, press and hold the reset button on back of unit for 30 seconds
  • Without releasing the reset button, unplug the unit and hold reset for another 30 seconds
  • Plug the unit back in STILL holding the reset button a final 30 seconds (please note that this step can put Asus devices into recovery mode...see note below!)
This procedure should be done BEFORE and AFTER every firmware upgrade/downgrade.
Do not use configuration restore if you change firmware builds (different svn build numbers).
[NOTE] - For Asus units, the standard 30/30/30 method will reset the router but you will need to use the Restore button followed by a Power cycle. The only exception (so far) is the RT-N16 model, follow the same method as stated above but use the WPS button instead of the Restore button. If all else fails to reset you can also do it by command line (all units). Login to the router via telnet/ssh and issue the command "erase nvram". This will reset the nvram partition to defaults for this Make of router.....redhawk

Erasing NVRAM:

As an alternative method, it is possible to restore DD-WRT to default settings without using the reset button (useful if you're locked out of the web interface or the reset button is disabled, broken, etc. or if your router just refuses to reset using 30/30/30).
[CAUTION] - On some devices, resetting NVRAM in this fashion may cause more problems than it solves. For example, Asus WL-500g and the Motorola WR850G bootloader will not recreate default values and will not boot properly after being reset. If you do this on a Siemens SE505 V1, your router will not be accessible to you anymore! You will have to reflash it with the stock firmware on IP address 192.168.1.1 (NOT 192.168.2.1 as the installation procedure says!!)
The following requires that DD-WRT already be installed on your router, and Telnet (or SSH) services be enabled and accessible.
Telnet (or SSH) into 192.168.1.1
Issue commands:
erase nvram
reboot
or
mtd -r erase nvram
The mtd method should be used with caution! The erase nvram;reboot method is much safer!
All should be in default settings now.


Default password

After resetting DD-WRT, you need to login with the user name "root" and password "admin".

DD-WRT on Linksys E1000 v1 or v2


Linksys E1000

Please see this thread for information on E1000 and dd-wrt compatibility http://www.dd-wrt.com/phpBB2/viewtopic.php?t=79673

Install / Flash Linksys E1000 v1 only! (see above link for v2)

The following instructions are copied from Dark_Shadow's forum post / wiki see: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=79673 (same as link above). I am adding them here after testing and validating they work as per his request in the forum. They worked flawlessly for me installing on a Cisco Linksys E1000 v1 [--Apus.one 05:08, 15 October 2011 (CEST)].
  1. Read the Peacock Announcement.
  2. Download dd-wrt.v24-15279_NEWD-2_K2.6_mini_e1000.bin. If you wish to experiment with a newer build, you should read the "build thread" for any build you are considering putting on your router, before flashing a newer build, (as discussed in the peacock announcement).
  3. Set a static IP on your computer to 192.168.1.7. Subnet mask should be 255.255.255.0
  4. Connect the lan cable from your computer to a LAN port of your router. Make sure your router is plugged in. Nothing should be connected to your computer or the router except the lan cable between them.
  5. Ensure you have a physical ethernet connection to your router, and disable your wireless adapter, antivirus/firewall protection, and any software that makes strong use of your network (BitTorrent, Streaming Audio/Video, etc).
  6. Perform a hard 30/30/30 reset.
  7. Navigate to http://192.168.1.1/ in your web browser of choice.
  8. At the Linksys Administration > Firmware Upgrade page, do not give the reboot command. You will use this page to upgrade your firmware.
  9. Browse to the firmware you downloaded and click Upload.
  10. Do not touch anything. The page will tell you that the upgrade was successful and the router is now rebooting. Your router may take upwards of a couple minutes to reboot. Watch the lights... once the wireless and power indicators are on steadily for several seconds, your router is fully rebooted and you can click "Continue" in your browser window.
  11. If the DD-WRT password change page displays, your upgrade has been successful, and you must now perform another hard 30/30/30. This time, when you navigate to http://192.168.1.1/, click "Reboot" and wait for the router to come online again so you can configure it.
If the DD-WRT password change page does not display, your page request times out, or you can't ping 192.168.1.1, make sure both wireless and power lights are on steadily first, then do a hard power cycle (unplug the power from the router--do not do a 30/30/30 reset). Wait a few seconds and plug the power back into the router. Wait until both wireless and power lights are on steadily, then navigate to http://192.168.1.1/ in your browser of choice again. If the DD-WRT password change page displays, your upgrade has been successful, and you must now perform another hard 30/30/30. This time, when you navigate to 192.168.1.1, click "Reboot" and wait for the router to come online again so you can configure it.
You can also flash the same firmware of TomatoUSB as described for WRT160N_v3.0


Performing a 30/30/30 Reset on a Linksys E1000 v1.0

  1. Perform a normal 30/30/30 reset.
  2. Login to http://192.168.1.1/ and you will see the Linksys - Management Mode page.
  3. Click "Reboot."
  4. In a moment, you will see "Command reboot completed." The router will now start the reboot process. When the lights return to their normal state, you can click "Continue" to be taken to the router's main page.

Serial Recovery

I had an awfully difficult time doing serial recovery on this router. It was my first time so you can imagine that I had no idea what I was doing. There are some slight deviations from the standard serial recovery procedure that is in the Wiki so I decided it would be a good idea to add the information here. First of all, the pinout is the same as the E2000 (at least for the E1000 v2).
You should familiarize yourself with the Serial Recovery article before trying this, I'm not going to explain everything again here.
Here is the serial pinout. Image:E1000v2_serial.jpg
Looking from the back of the router you should see the 2x6 JTAG port and above that 5 holes. These 5 holes are the serial port. Again, looking from the back of the router: VCC - RX - TX - ? - Gnd
Once at the prompt you need to assign an IP/Subnet mask to eth0. I'm not sure if eth0 is the routers interface to the switch or one specific port but I had a CAT5 cable hooked up to port 1 on the router and it worked.
If you type "ifconfig eth0" you will see that there is no address assigned to the interface. The following command will assign an address/mask.
CFE> ifconfig eth0 addr=192.168.1.1 mask=255.255.255.0
Now you can flash using a TFTP client from your computer, which is plugged in to port 1 on the router, just like theSerial Recovery page says.

JTAG!

Barryware, using a mixture of perseverance and brilliance, has found a way to fix the fact that Linksys, in for completely baffling reasons, did not connect the jtag port to the processor. This isn't for the faint of solder, but there IS now a way to jtag the 160nV3 and the E1000_V1! See this: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=146077

flash -ctheader : flash1.trx

TF2 Idle Skip TF2 file validation in Steam Windows 7

When I first installed TF2 some time ago on a Windows 7 install, it exhibited this behaviour for me. The problem as it turns out was with my hard disk. By defragmenting my disk and my game, I managed to resolve the issue. You can try defragmenting the game files in Steam through the Local Files tab of Team Fortress 2's Properties page in the Steam Library, but I found using the OS's defragmentation tool was necessary if I recall. I'd recommend doing both just to be safe. You may need to validate files manually after this, but it should hopefully be the last time. At the time, there were no bad sectors reported and the hard drive was less than a year old, but fast-forward a year or two and that hard disk died on me so this may be an early indication of a problem with the hard disk that you may want to look into.

I used Auslogics Disk Defrag and highly reccomend it. It worked faster than the OS defrag option.