Posts Tagged ‘tutorial’

Setting up an OrientDB server on Ubuntu

January 19th, 2013 13 comments

Go to the directory you want to install OrientDB.

cd /opt

Download one of the two flavors of OrientDB (standard or graph edition). (If you don’t know which to take, pick the Graph Ed.)

sudo wget
#sudo wget

Unpack the file

sudo tar -zxvf orientdb-1.3.0.tar.gz

I usually remove the tar.gz file and add a symlink

sudo rm orientdb-1.3.0.tar.gz
sudo ln -s orientdb-1.3.0/ orientdb

Configure the default orientdb password. (I use vi, you use your own favorite editor ;))

sudo vi orientdb/config/orientdb-server-config.xml

Go to the section [orient-server > storages > storage] in the xml, change the default username and password and save the file

<!-- Default in-memory storage. Data are not saved permanently. -->
<storage path="memory:temp" name="temp" userName="yourUsername" userPassword="yourPassword" loaded-at-startup="true" />

Get the root password for later use or/and add your own preferred account in [orient-server > users]:
(I prefer to remove the root account and add a new one)

<user name="yourUsername" password="yourPassword" resources="*"/>

As the file is holding passwords it might be a good idea to remove the read permission for other users.

sudo chmod 640 /opt/orientdb/config/orientdb-server-config.xml

Create a user that will run the server:

# -d, --home-dir HOME_DIR       home directory of the new account
# -M, --no-create-home          do not create the user's home directory
# -r, --system                  create a system account
# -s, --shell SHELL             login shell of the new account (/bin/false =  no login)
# -U, --user-group              create a group with the same name as the user
sudo useradd -d /opt/orientdb -M -r -s /bin/false -U orientdb

Change ownership of orientdb directory/links:

sudo chown -R orientdb.orientdb orientdb*

Modify the user group rights so that users in the orientdb group can invoke shell scripts.

sudo chmod 775 /opt/orientdb/bin
sudo chmod g+x /opt/orientdb/bin/*.sh
sudo usermod -a -G orientdb yourUsername

Copy the init.d script:

sudo cp orientdb/bin/ /etc/init.d/

Update the init.d script with this sed script or just edit the file. (The copied one)

sudo sed -i "s|YOUR_ORIENTDB_INSTALLATION_PATH|/opt/orientdb|;s|USER_YOU_WANT_ORIENTDB_RUN_WITH|orientdb|" /etc/init.d/

And change the following lines, we use sudo because our system account does not have a login shell.

# You have to SET the OrientDB installation directory here (if not already done so)
#su -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./ 1>../log/orientdb.log 2>../log/orientdb.err &" - $ORIENTDB_USER
sudo -u $ORIENTDB_USER sh -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./ 1>../log/orientdb.log 2>../log/orientdb.err &"
#su -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./ 1>>../log/orientdb.log 2>>../log/orientdb.err &" - $ORIENTDB_USER
sudo -u $ORIENTDB_USER sh -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./ 1>>../log/orientdb.log 2>>../log/orientdb.err &"

Update the rc.d dirs

cd /etc/init.d
sudo update-rc.d defaults

The server will now start and stop on startup/shutdown. For now we start it by hand.

sudo /etc/init.d/ start

Verify that it is running by opening the studio (e.g. http://localhost:2480/) or run ‘sudo /etc/init.d/ status’.

Now we can log in and create a new database,
Start the console:


Create a new database:

create database remote:/yourDatabaseName yourUsername yourPassword local

Done. Grab a beer, you’ve earned it. 😉

Team Fortress 2 – Dedicated Server

October 18th, 2007 68 comments

Ok, in this short tutorial I will show you how to set up a TF2 dedicated server on a windows machine.

  1. Download the HLDS Update Tool from the Steam site.
  2. Run the tool to get it installed.
  3. Create a directory for steam, the game files will be created in this directory.
  4. Run the hldsupdatetool executable: (I ran a windows installation, but linux will be similar)

    Windows command:

        -command update 
        -game tf 
        -dir <directory name created in step 3, surround with quotes if spaces are in it>

    Linux command:

        -command update 
        -game tf 
        -dir <directory name created in step 3, surround with quotes if spaces are in it>

    You can use the same command when you need to update your server to the latest version.

  5. This will take some time, grab a beer, a cup of coffee, or something else that will help you relax.
  6. Don’t relax too much! You might get some ‘Connection reset by peer’ exceptions. Don’t worry, just rerun the same command again and again and again and again until finally you have received all files.
  7. Create a server.cfg file in the orangebox/tf/cfg directory.
  8. Fill it with some basic info. See a small example below.
  9. // The name of your server shown in the server browser
    hostname "TF2 Server"
    // Server e-mail contact
    // Password used for remote console access
    rcon_password "asillypassword"
    // If you are having trouble connecting with rcon try enabling the rcon_address line.
    // Also make sure your ports are forwarded (tcp: 27000-27020)
    // rcon_address "your_ip_address"
    // 1 for private LAN, 0 for internet play
    sv_lan 1
    // Region that the server is located in
    // U.S. East - sv_region 0
    // U.S. West - sv_region 1
    // South America - sv_region 2
    // Europe - sv_region 3
    // Asia - sv_region 4
    // Australia - sv_region 5
    // Middle East - sv_region 6
    // Africa - sv_region 7
    // Rest of the World - sv_region 255
    sv_region 3
    // Network settings
    sv_mincmdrate 30
    sv_minupdaterate 20
    sv_maxcmdrate 100
    sv_maxupdaterate 100
    sv_maxrate 100000
    sv_minrate 1000
    //sv_unlag 1 Unknown Command
    // Enforces fair and optimal settings
    sv_client_predict 1
    sv_client_interpolate 1
    sv_client_min_interp_ratio 1.0
    sv_client_max_interp_ratio 2.0
    sv_client_cmdrate_difference 30
    // External download server
    // sv_downloadurl ""
    // Max download size of 100 MB
    net_maxfilesize 100
    // mp_capstyle (Sets the style of capture points used. 0 = Fixed players required to cap. 1 = More players cap faster, but longer cap times)
    // mp_respawnwavetime (Time between respawn waves)
    // mp_capdeteriorate_time 90.0 (Time it takes for a full capture point to deteriorate)
    // mp_teams_unbalance_limit (Teams are unbalanced when one team has this many more players than the other team. (0 disables check))
    // mp_bonusroundtime (Time after round win until round restarts)
    // mp_winlimit (Max number of rounds one team can win before server changes maps)
    // mp_stalemate_timelimit (Timelimit (in seconds) of the stalemate round.)
    // mp_switchteams (Switch teams and restart the game)
    // mp_scrambleteams (Scramble the teams and restart the game)
    // mp_forcerespawnplayers (Force all players to respawn.)
    // mp_disable_respawn_times (Disable respawn timer)
    // mp_timelimit (Set timelimit for map)
    // mp_maxrounds (Set number of rounds before reset. Mutually exclusive with mp_timelimit. So if this is enabled disable the mp_timelimit)
    // mp_tournament (Enable or Disable tournament mode)
    // tf_weapon_criticals (Enable or disable weapon crits)
    // tf_flag_caps_per_round (Number of flag caps before round ends)
  10. Create a shortcut to the srcds.exe executable in the /orangebox directory
  11. Edit the shortcut and change the startup command to look like something like this
  12. "C:\Program Files\Valve\HLServer\orangebox\srcds.exe" -game tf -console +exec server.cfg +maxplayers 24 +map ctf_2fort

    This will make the server run the TF2 game, with console enabled and it will execute the server.cfg file we created. Next to that it will set the player limit to 24 and load the map ctf_2fort at startup.

  13. Start the server by running the shortcut

Please note that you can also create custom map cfg files which will run automatically when a mapchange occurs. Eg: If you have the map cp_dustbowl you could create a custom cp_dustbowl.cfg file and place it in the cfg directory and it will be auto-executed when the level is loaded. This will enable you to use settings that are map specific.

The next part in this tutorial will describe how to install MetaMod:Source and SourceMod on your (TF2) dedicated server.

MetaMod and SourceMod are plugin API’s/frameworks that will allow you to run custom administration/game plugins on your server.
Visit this link to see what mods are available for SourceMod.

  1. Visit this page and follow the directives there. Be sure to download the a version >= 1.6 of MetaMod:Source.
  2. Go to the SourceMod site and download the latest release. Then follow the directives found here.

If you got SourceMod running you can install any plugins you like. Have fun!