Saturday, 27 September 2014

Løpet som forsvant

Bilde fra 2012, fra arrangøren, tatt av Stian S Møller.

Den 9. september gikk motbakkeløpet Gaupekollen Opp av stabelen. Det er nå ca tre uker siden. Etter disse motbakkeløpene har det tidligere alltid kommet en liten reportasje. Enten på arrangørenes hjemmesider, eller på kondis.no. Denne gangen skjedde ikke det. I stedet ble det merkelig stille. Nesten som om arrangementet ikke hadde skjedd. Det var kun enkelte løpebloggere som skrev om motbakkeløpet, og forsåvidt også etterlyste resultater, bilder og informasjon fra arrangøren.

Resultatene ble heldigvis funnet på tidtagerens hjemmeside. Forholdsvis godt skjult for de fleste. Resultatene ble imidlertid aldri helt oppdaterte. Vinneren av løpet, en av Norges aller beste løpere, sprang nemlig for klubben "#NeiTilLisens" denne tirsdagen. En sak som man skulle tro at både arrangøren og Kondis ville skrive om. Men her måtte man tro igjen, for det skjedde aldri. Det var nok enkelte som var fornøyd med det.

"NOTEAM" eller "#NeiTilLisens", ikke helt det samme.

Løpssesongen 2014 er snart over. Det er ikke stort som tyder på at mosjonsskatten forsvinner. Selv har jeg uttalt at jeg ikke skulle løpe noen lisensløp i år. Det har vært enkelt. Men hva jeg gjør neste år vet jeg enda ikke. For å være helt ærlig er jeg litt lei av alle disse konkurransene, så kanskje det ikke blir så mange løp i 2015 uansett.





Thursday, 18 September 2014

CS:GO DS on DO

Behind this cryptic title hides the sentence "Counter-Strike: Global Offensive Dedicated Server on Digital Ocean". This is a "how to" on setting up your own CS:GO dedicated server, that I wrote after setting up "RipHard CS:GO Server".


The Server
First of all you do need a server to install the software on. I went for Digital Ocean. Currently, for as little as $5 a month, you can get your own virtual server. It only takes seconds to get it up and running. Debian is a good choice. Pick a location near you.

The droplet settings.

The tasks below were done to the server.

Change root password
This was done automatically on first login.

Change ssh port
From default port 22 to something else, to increase security.

root@gameit:~# nano /etc/ssh/sshd_config 
port 22 changed to port XXXX
root@gameit:~# /etc/init.d/ssh restart
[ ok ] Restarting OpenBSD Secure Shell server: sshd.

Update packages
Nice to do, now and then. At least when the server is new.

root@gameit:/home/gameit# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Add new steam user
Add a new user, named "steam", to be used for the dedicated server installation.

root@gameit:~# adduser steam
Adding user `steam' ...
Adding new group `steam' (1001) ...
Adding new user `steam' (1001) with group `steam' ...
Creating home directory `/home/steam' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for steam
Enter the new value, or press ENTER for the default
Full Name []: 
Room Number []: 
Work Phone []: 
Home Phone []: 
Other []: 
Is the information correct? [Y/n] Y

Disable root ssh login
Being able to login as root using SSH is never a good thing. Turn it off.

root@gameit:~# nano /etc/ssh/sshd_config 
PermitRootLogin yes changed to PermitRootLogin no
root@gameit:~# /etc/init.d/ssh restart
[ ok ] Restarting OpenBSD Secure Shell server: sshd.

CS:GO Dedicated Server
The server is ready, next step is to install the CS:GO Dedicated Server software. A complete receipt on how to do this is found on Valve's own pages.

Install Steam
steam@gameit:~$ mkdir /home/steam/steamcmd
steam@gameit:~$ cd /home/steam/steamcmd
steam@gameit:~/steamcmd$ wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
steam@gameit:~/steamcmd$ tar -xvzf steamcmd_linux.tar.gz
steam@gameit:~/steamcmd$ rm steamcmd_linux.tar.gz

At this point you can start Steam. In my case that lead to an error:

steam@gameit:~/steamcmd$ ./steamcmd.sh 
./steamcmd.sh: line 29: /home/steam/steamcmd/linux32/steamcmd: No such file or directory

Solution:
root@gameit:~# apt-get install ia32-libs

Install CS:GO
Start Steam and install CS:GO

steam@gameit:~/steamcmd$ ./steamcmd.sh 
Steam>login anonymous
Steam>force_install_dir ./csgo/
Steam>app_update 740 validate

Run CS:GO
Start the dedicated server from the command line, to check that everything is working.

cd /home/steam/steamcmd/csgo/
./srcds_linux -steam_dir /home/steam/steamcmd -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2

If the server starts (yes, you will see a few error messages / warnings) and you can log on, you are set to start with the configuration.

Server Launcher
A helpful tool is the "CSGO Server Launcher". A command line tool for starting and updating your server.

Trying to run this you might see the error message:
./csgo-server-launcher.sh: line 132: screen: command not found

Solution:
root@gameit:~# apt-get install screen

Example of using the tool:
steam@gameit:~/steamcmd$ ./csgo-server-launcher.sh start
steam@gameit:~/steamcmd$ ./csgo-server-launcher.sh restart
steam@gameit:~/steamcmd$ ./csgo-server-launcher.sh stop

Remember, to close console, without shutting down server press
CTRL + A
CTRL + D

Note:
I ended up renaming this script to "csgo_launcher.sh" and moved it to a separate "scripts" folder.

Auto update
You can use "CSGO Server Launcher" and Cron for auto updating of the server. However, I wrote my own little script.

csgo_updater.sh
/home/steam/steamcmd/steamcmd.sh +runscript /home/steam/scripts/csgo_updater.txt

csgo_updater.txt
// update cs:go
login anonymous
force_install_dir ./csgo/
app_update 740
quit

cron daemon
0 4 * * * /home/steam/scripts/csgo_updater.sh >/dev/null 2>&1

Startup Errors
When starting your server you see several errors. To fix (some of ) them you can do:

steam@gameit:~/steamcmd/csgo/csgo/addons$ mkdir /home/steam/.steam
steam@gameit:~/steamcmd/csgo/csgo/addons$ mkdir /home/steam/.steam/sdk32
steam@gameit:~/steamcmd/csgo/csgo/addons$ ln -s /home/steam/steamcmd/linux32/steamclient.so /home/steam/.steam/sdk32/steamclient.so

You might also see the message "Error parsing BotProfile.db - unknown attribute 'Rank'" when starting your server. A solution to this can be found here. And if you want to check my updated "botfile.db" that fixes this error, that can be done here.

To avoid the "Invalid file size for host.txt" create a file named "host.txt" under the "csgo/csgo" directory. Not sure what the purpose of this file is. I read somewhere that it was related to what banner to display upon server login, but it had no other effect than removing the error message on my server. View my version of this file here.

Those Config Files
You have several cfg, or config, files that you need to add or update. I find it slightly confusing and not straight forward to know where to put the different server and game settings. These files are located in the "csgo/cfg" (or "csgo/csgo/cfg") directory.

autoexec.cfg
This file should be created if you want to add some logging to your server. More on that further down. Check my version of this file here.

server.cfg
This file you need, to specify name and maybe some basic server settings. Check my version of this file here.

gamemode_xxxxxx_server.cfg
You will also need some config files to setup different game modes, for the server. I copied the existing gamemode files ("gamemode_armsrace.cfg" to "gamemode_armsrace_server.cfg", "gamemode_casual.cfg" to "gamemode_casual_server.cfg"  and so on) and tuned them slightly. These files change the game settings for each game mode. Check all my versions of these files here.

go_xxxxx.cfg
As a server admin it is also nice being able to quickly change game mode on the server. For that I created a few cfg files of my own. "go_armsrace.cfg" changes to armsrace mode (note that "gamemode_armsrace_server.cfg" automatically will be executed), "go_casual.cfg" changes mode to classic casual mode, and so on. Check these files here.

From the "CSGO Server Launcher" console this script can be executed by writing:
exec go_armsrace

From the game, you need to open the in-game console (Activate the console in Help & Options -> Game Settings -> Enable developer console. This will then allow you to open the console using the tilde key ~.), and write this:
rcon_password yourrconpasswordhere
rcon exec go_armsrace

set_bots.cfg
I also made a little script that fills up CT side with bots. Nice if you want to play against bots without bots on your own team. Check the file here.

gamemodes_server.txt
Directly under the "csgo" directory you should add the file "gamemodes_server.txt". In this file you should specify your mapgroups, what maps to be played with what game modes. Note that you manually have to download non standard maps to your server, if you want to use any. Check my version of this file here.

motd.txt
Under the "csgo" game directory ("...steamcmd/csgo/csgo" on the server) you find the file to update the server's message of the day. Just edit the "motd.txt" file. My version of this file can be viewed here.

All My Tuned files
All the files I have updated or created on my server can be viewed on GitHub.

Appendix

Workshop
I had some issues starting the CS:GO server in Workshop mode. However, after having spent some time I managed to set it up. Follow the guide given in the link on the above line. I added "webapi_authkey.txt" (generate own key here), "subscribed_collection_ids.txt" and "subscribed_file_ids.txt" to the "csgo" game directory. As well I have added all workshop maps into one mapgroup, in the "gamemodes_server.txt". To quickly generate the list of workshop maps, used in the "gamemode_server.txt" I wrote a little Perl program.

Note: I ran into problem that I was unable to change map to any workshop map at all. I realised that this was because some maps never got downloaded to the server. The map folder, under the "maps/workshop" had been created, but was empty. The fix was to delete those failed maps from the "subscribed_file_ids.txt" (and delete the empty folders). My little Perl program mentioned above warns you if it find any workshop folder without map files in them.

Server failed to download several maps, unknown why.

CVAR
List of all CVARs will come in handy. You can see a complete overview here:
https://developer.valvesoftware.com/wiki/List_of_CS:S_Cvars

Statistics
You might want some statistics for your server.

GameTracker
GameTracker.com is a nice solution. A few extra lines in "server.cfg" is needed:
host_name_store       1
host_info_show        1
host_players_show     2

GameMe
If you want more server specific statistics you should check out gameme.com. It costs $5 a month. For this to work you have to add a few lines to "autoexec.cfg". You will find what to write in your autoexec.cfg in your own GameMe console. Please note that you do not need to install any mods for this to work. The only reason for using a mod (SourceMod or AMX Mod X) is for the GameMe ingame plugin, which display real time statistics, while playing. However that is not at all needed. Keep it simple. Stats can be viewed after the match is over.

Server Mods
You have several server mods that can be installed on the server. I tried MetaMod, SourceMod and Mani Admin Plugin. However, I did realised that I did not at all need any of these mods. So I threw them all out. They only cluttered up the server installation. With CS:GO you have included much of the functionality that these mods was very nice for in CS:Source, like map voting, and other votes.

SourceMod also messed up the built in map vote. Below an example from the logs:
CHANGELEVEL: ConVar 'nextlevel' is set, next map will be 'de_sugarcane'
CHANGE LEVEL: de_sugarcane
L 09/04/2014 - 20:50:33: [SM] Changed map to "de_aztec"

Opening ports
This should not be necessary. If you have done what I did above you have no firewall running. However, in case you can not access your server you might try running the following commands:

root@gameit:~# /sbin/iptables -A INPUT -p udp -m udp --dport 27000:27030 -j ACCEPT
root@gameit:~# /sbin/iptables -A INPUT -p tcp -m tcp --dport 27014:27050 -j ACCEPT
root@gameit:~# /sbin/iptables -A INPUT -p udp -m udp --dport 4380 -j ACCEPT
root@gameit:~# /sbin/iptables -A INPUT -p udp -m udp --dport 3478 -j ACCEPT
root@gameit:~# /sbin/iptables -A INPUT -p udp -m udp --dport 4379 -j ACCEPT
root@gameit:~# /sbin/iptables -A INPUT -p udp -m udp --dport 1200 -j ACCEPT
root@gameit:~# /sbin/iptables -A INPUT -p udp -m udp --dport 4380 -j ACCEPT




Wednesday, 10 September 2014

NoCountryRedirect and the right to be forgotten

NCR - prevent that redirect!

With the stupid right-to-be-forgotten privacy rule EU has introduced (yes, it is stupid, because it does not work. If interested read this as well.) Google are forced to remove links if people or companies complain. Hence it is more relevant than ever to use google.com as your search engine, instead of a country specific version, like google.de. That is because google.com is (still) not censored, while google.de and other EU specific domains are.

But what you as a user might have noticed is that you are automatically transferred to google.de if in Germany, google.es ig in Spain, google.fr if in France and what have you got. If you are using Google Chrome there is a simple way to prevent or avoid getting redirected to country-specific versions / domains of Google (if not using Chrome you can visit google.com/ncr instead of just google.com).

The nifty solution is an extension called NoCountryRedirect (NCR).

I made the extension back in 2012, and today I published a new version of it, with some bug fixes and a new feature called "whitelisting". As the time of writing there are about 1500 users. Enough for me to keep the extension up-to-date. The extension also disables redirects for Google blogs, or Blogger / blogspot.com blogs, if you want it to do so.

The extension was featured in technorms.com last year, so you can read more about it there.

Download and install the NoCountryRedirect (NCR) extension here.

src





Gaupekollen opp 2014

Race #35 2014 - 3.2 km - 21:46 - Tuesday 9th of September

Sindre decided to join on very short notice, and not surprisingly won the race. I did not care being beaten by him nor Mr LG (src).

Gaupekollen opp is a great hill race, by team SRM. Personally this is the track I like the most. Starts easy, at least three wide roads / paths where you can run past people, and varied terrain. The great view from the top doesn't make the experience any worse. Nor do all the great people participating.

I started off slow and controlled. It felt hard at first, but the longer I ran the better it felt. Overall a nice feeling. Not at all as tiring as some of my previous hill races. Having said that, climbing hills are never easy.

Ran slower than last year (21:18), but I can at least blame a few seconds on the slippery slope. Last year I finished 26th, this year 23rd.

Links
| results | garmin connect |





Wednesday, 3 September 2014

The Draw Every Day Challenge

MoCh - Challenge #16 August 2014 - The Draw Every Day Challenge

I got a kick on drawing mountains. This is one of several rocky drawings (src).

The 31 drawings from August's "Draw Every Day Challenge" can be viewed here. I used to draw a lot when I was a kid. Then I once again got a kick when I for the first time in years made a drawing, some weeks back. That experience resulted in this challenge. So for a month I have spent quite a few hours, with pencil and paper. Drawing can be truly relaxing, almost like meditation. Another nice challenge has been completed.

Tried doing a self portrait. That was not easy at all. Whatever, this is the result. (src)

I thought that I could not draw. That was of course not true. Everyone can draw, as long you are able to hold a pencil, one way or another. It doesn't matter how you draw, or if other people draw something that looks different, better, or worse, than what you create. There will always almost be someone better than you, in whatever you do. That doesn't mean you can't do it as well. You just do it your own way, in that you are unique, and that is just perfect.

View the result of this challenge here.

Drawing zentangles became my favourite way of drawing. This is my "Masterpiece". (src)



More Challenges
To view a complete list of all my challenges, check out this page.





Sub 39 at #399

Race #33 2014 - 9.7 km - 38:56 [PB] - Wednesday 27th of August

38, it is just a number.

I managed to go below 39 on the three round Sognsvann Rundt Medsols last Wednesday, at SRM race number 399. Unexpected, as I in average for the last year have done less running than before, assumingly around 30-40 km a week (luckily I have lost track of the exact number). Instead of many kilometres I go for quality. Most of my runs are intervals, and often uphill, like my Red House Hill sessions, or Linderudkollen sessions. Here is the Garmin Connect data from the race.

SRM 2014 has been hot. This photo from SRM 392, 17th of July 2014 (photo: Jørgen Lindalen / Kondis).

August is the PB month. 151 SRMs on the record, +2 on the side, as Darth Vader and Luke Skywalker.

SRM 400
Today I will join the 400th Sogsvann Rundt Medsols race, with my 152+2 th race.

What Else
- I have published a book.
- I have started doing yoga.

Monday, 1 September 2014

Viking Race 2014

Race #32 2014 - 4.6 km - 31:59 [debut] - Saturday 23rd of August

Photo by Epic Action Imagery / Viking Race.

Finally I have tried out an obstacle race. It was fun. It was hard. It was Viking Race. I ended as number 16 out of 499, in the 5 km race. Pleased. Guess I should aim for the 10 km next year, if I am up for it. A big thanks to the cool people that came up with the idea for this race, and organised it for the second year. For those of you who have never done a race like this, you should sign up for Viking Race 2015!

A video from the race, by Roy Lachica:




Links
| race page | official results | kondis article | photos | garmin connect |