How to make yourself Server Admin (again) on Teamspeak 3

When installing a Teamspeak server for the first time we obtain a token key (also called a priveledge key) which we can use to gain the initial admin rights. However, when you loose the admin permissions for some reason, the option to use a priveledge key on the Teamspeak client is disabled (note that the first token key can only be used once, so you would need to generate a new one).

The great thing about the Teamspeak server is that it offers us a special interface to which we can connect by using telnet (called the ServerQuery interface). By default this is port 10011 (TCP), which is also called the serverquery port. We can use for example puttytel or the windows telnet client.

 

Connecting and logging in

We connect by using

puttytel <ip or hostname> <port>

and login by using

login serveradmin <your serveradmin password here>

If your login is correct then you will get the following output:

error id=0 msg=ok

You now need to specify which virtual server to use (use the command serverlist if you have more than one server):

use 1

 

Obtaining the admin group ID

By default the Admin group ID is set to 6, but this can of course be changed. So to make sure you have the right ID we will look at the list of all groups:

servergrouplist

This outputs all the available groups on the chosen virtual server. You can check for sgid=6 and verify that the name is “Server Admin”.

Adding ourselves to the admin group

Before we add ourselves to the admin group we should connect to the server with our Teamspeak client (Important: and stay connected!). Get your Unique ID (in Windows: Settings > Identities ) and use this as follows to obtain the client database ID:

clientdbfind pattern=<your UID> -uid

If your nickname on the server is unique (at least when connected to the server) then you can also search for the client db ID by using a name:

clientdbfind pattern=<your current nickname>

The output should then be something like this:

cldbid=12
error id=0 msg=ok

 

Adding ourselves to the admin group

We can now finally add ourselves to the admin group:

servergroupaddclient sgid=6 cldbid=12

Becoming Serverquery admin by using privelegekeys

privilegekeyadd tokentype=0 tokenid1=6 tokenid2=0

which will give you the privilegekey which you can copy and paste in TS by using Permissions > Use Privilege Key

Final notes

There are more ways to achieve this. One of them is to simply ask another existing admin to add you to the server group manually, or in the worst case installing everything from scratch.

See also the TS3 Server Query manual for more detailed information.

How to send large files using µTorrent

Introduction

There are numerous ways to share your files. This includes the usual mail, Windows Live Messenger, file-hosting sites like RapidShare, Dropbox, FTP and many other ways.

However, all have the following problem. Lets say that you want to share some REALLY big amount of data with someone, like for example 5GB or maybe even 20GB. In that case all of the above mentioned ways of sharing have serious drawbacks.

Windows Live Messenger is often very slow, can share only a few files at a time and does not support resume on sending files (which basically means that if for example your connections dies out while having 99% of your file already sent, you have to send the file all over again!). File-hosting sites like RapidShare, MegaUpload and similar sites have file size limits so that you need to upload big files by splitting it in different parts that are withing this limit  and so on (which is also the case if you use Dropbox). FTP does not pose a limit on the number or size of the files, but it again does not offer a resume of a download like Windows Live Messenger. Other drawbacks of all these type of methods  is the requirement of some initial setup, technical knowledge, user registration on websites, ads, etc.

Continue reading How to send large files using µTorrent

How to manually add a package to MiKTex

The fact that I’m writing this article implies that it is far from a trivial task to do this. After about 2 hours I finally found a solution that just works. Note that I’m using MiKTeX 2.9 on Windows 7, so the solution may not be working for other versions of MiKTeX and the path to the directory may vary depending on your version of windows and/or your installation preferences. The concept however is the same.

To make this work you should complete the following steps:

  1. Download the package file that you want to install.
  2. Create a directory in (make sure that you have admin privileges in case of Vista/7):
    • C:\Program Files\MiKTeX 2.9\tex\latex\base (for Windows XP/Vista/7 on a 32-bit Windows version)
    • C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base (for Vista/7 on a 64-bit Windows version)
  3. Go to Start > MiKTeX > Maintenance (Admin) > Settings (Admin) and click on Refresh FNDB.
  4. Restart your LaTeX editor (in my case it was WinEdt 6.0) and now you should be able to use your new package.

 

Note that in step 3 I have deliberately wrote that you should chose the Admin folder, which is important if you are running Windows Vista or Windows 7, since otherwise refreshing FNDB will not result in your package being added to the database! Alternatively, you can also open the settings from the non-Admin or in some other way, but in any case make sure that the process has admin rights to update the database. If you have a more complex setup you can read this post that gives some more advanced information on how to manually add packages.

Restore Outlook Account Settings From Second Drive

Introduction
In some strange situations it might occur that you want to recover your Outlook Account Settings from an old drive or partition on which you are unable to boot in Windows (or you just don’t want to). Unlike the Outlook mails which are stored in a PST file, the Outlook account settings are located in the Windows Registry. If you haven’t deleted your Windows files it is possible to access certain registry keys so that you can export all the account settings information and import it in your current registry.

This tutorial applies for Outlook 2007, but it might also be usable for Outlook 2003 and Outlook 2010.

Continue reading Restore Outlook Account Settings From Second Drive

How to Recover Lost or Deleted Partitions


Introduction
Here I will describe how to recover lost or deleted partitions with a cool tool called TestDisk that I recently found with which

I successfully restored my own broken partition. The tool is OpenSource and is licensed under the terms of the GNU General Public License (GPL).

Symptoms and problem description
You are not able to boot your hard drive because the partition is damaged or deleted and you want to recover all your files.

Multiple recover options
There are a few ways to fix the problem since it depends on your specific situation and what options we have available.

If your lost partition is on a second drive that is also plugged in, like it was in my case, or you have a working partition on your hard drive that you can boot normally (while the damaged/deleted partition is on the same drive) , then read Recover partition from a booted working partition.

It is very possible that your only partition that you used to boot became corrupted and you don’t have a second working hard drive available. In that case you can use a Live CD by following the steps described in the part Recover partition by a Live CD.

Recover partition from a booted working partition
Your best way to recovery is from an already booted OS (Windows/Linux/Mac). You can download TestDisk from here. In the following description I will use TestDisk version 6.11.3 and show the recovery steps that may include some Windows specific details. This should be analogous to other versions and OS’es.

  1. After you have extracted the downloaded file, run TestDisk from your extracted testdisk folder (win/testdisk_win.exe).
  2. Now follow the TestDisk Step by Step instructions that are described on the TestDisk wiki page.

Recover partition by a Live CD
You might not be able to boot anything since you don’t have another working partition. In that case you can use a Live CD that will basically boot in memory after which you can start TestDisk without having to boot an operating system. Hence:

  1. Download and then burn the TestDisk Live CD on an empty CD, insert it in your machine and boot from it. *
  2. Now you can basically follow the same TestDisk Step by Step instructions as if booted from an OS.

* Note that you have to setup your BIOS such that your first boot option is your CD/DVD drive. In case your first boot option is your hard drive, the Live CD will not boot up!

Keep in mind
Keep also in mind that you have to be careful when performing the above described operations. Don’t overwrite or fully format the partition if you want to be able to recover your partition and files. Also note that there may be various situations that you can encounter that are not covered by this tutoriol, and hence I cannot be held responsible for any consequences that might occur after you decide to use the tool. It should not get dramatic, but keep in mind anyway that you use it at your own risk.

Extract Microsoft CAB Files in Windows

In short
To extract Microsoft CAB files, you can use the expand command in command line as follows:

expand cabfile -F:* path

which will extract all the files from the cabfile in the give path. For example

expand en-catalog-web.cab -F:* c:\expanded

Single files
I experienced problems with extracting a cab file where within a single xml file was stored. I found out that renaming the files after extraction can solve the problem. This is done by doing the previous example with an -r option:

expand en-catalog-web.cab -F:* c:\expanded -r

Extracting all the files to the current working directory can be done as follows:

expand cabfile -F:*  -r

Windows Live Essentials Offline Installer

Introduction
The current Windows Live Essentials 14.0.8117.0416 you can get by downloading the online installer from the official website. The installation files of all the components are downloaded during this setup. You might want to store these component files like Windows Live Messenger for offline installations for some reason. In this post I will describe my short analysis on how you can retrieve these installations for offline usage and maybe automate this information retrieval. Finally I will provide actual download links of both WLE and WLM from the official download site.

Windows Live Essentials Watcher Page
Before I continue with the analysis I just want to mention that you can find a complete list of all the available Windows Live Essentials components on the Windows Live Essentials Watcher Page. I will try to update the page with more older and newer versions when they come available.

Analysis
After analyzing the setup log of the online installer of Windows Live Essentials (version 14.0.8117.0416) I managed to extract some interesting information about the whole procedure the installer uses to download all the components. The location of the setup logs is dependent on the operating system you are on. The paths per operating system should normally be:

On XP:

C:\Documents and Settings\All Users\Application Data\Microsoft\WLSetup\Logs

On Vista/7:

C:\ProgramData\Microsoft\WLSetup\Logs

Furthermore, all the components that are downloaded by the setup are read from a XML catalog file. See here the catalog file for the current English version 14.0.8117.0416 that is used.

The downloaded components have the following link structure

http://wl.dlservice.microsoft.com/download/../../../ID/LANG/FILE

which is generally used for all the language versions.

If you want to backup your current and/or future versions of Windows Live, then you can find the downloaded files after the installation is done in the following cache directory:

C:\Program Files\Common Files\Windows Live\.cache

Official Windows Live Essentials 14.0.8117.0416 offline setup

Download Windows Live Essentials 14.0.8117.0416 (134MB)

  • Size: 141.399.376 bytes (134 MB)
  • MD5 hash: 4f079107f0d6fa1921f8a2f989864ac4

Download Windows Live Messenger 14.0.8117.0416 (23.9 MB)

  • Size: 25.148.416 bytes (23.9 MB)
  • MD5 hash: 819ff00b35959f5100ff787ef9484936 (MSI file inside the downloaded cab)

Official Windows Live Essentials 14.0.8089.726 offline setup

Download Windows Live Essentials 14.0.8089.726 (135MB)

  • Size: 141.402.440 bytes (135 MB)
  • MD5 hash: 0ff7f12bb44f91cad117632e3edd13ae

I also found out that there exists the same version of this full setup but with another file size from the official website. It seems older, and it is very strange that the version is exactly the same. Anyway, you can find it here (Size: 141.394.760 bytes – MD5 hash: 7a9f0e19f9d7ac193c8efd9d7f351b4a). The WLM cab is not downloadable from the same folder.

Download Windows Live Messenger 14.0.8089.726 (24.0 MB)

  • Size: 25.240.576 bytes (24.0 MB)
  • MD5 hash: 500e43ce39cede387e263ed886d24a74 (MSI file inside the downloaded cab)

Other seperate components – Windows Live Essentials version 14.0.8117.0416
Download Family Safety (x86)
Download Junk mail filter update
Download Microsoft Application Error Reporting (x86)
Download Microsoft Application Error Reporting (x64)
Download Microsoft Search Enhancement Pack
Download Microsoft Sync Framework Runtime Native
Download Microsoft Sync Framework Services Native
Download Microsoft Choice Gard
Download Microsoft Office Outlook Live Add-in
Download Microsoft Office Outlook Connector
Download Toolbar
Download WLXSuite
Download Windows Live Movie Maker
Download Windows Live Communications Platform
Download Windows Live Call
Download Windows Live Upload Tool
Download Windows Live Sign-in Assistant / Windows Live Login Browser Helper Object
Download Windows Live Sync
Download Windows Live Writer
Download Windows Live Mail
Download Windows Photo Gallery

Requirements:
Download .NET Framework
Download DirectX (x86)
Download DirectX (x64)
Download Windows Imaging Component
Download Windows Imaging Component Hotfix (Vista – x86)
Download Windows Imaging Component Hotfix (Vista – x86)
Download Windows Imaging Component Hotfix (Vista – x64)
Download Microsoft Visual Studio Runtime (MSVCRT)
Download Microsoft SQL Server Compact Edition 3.1
Download Microsoft Silverlight
Download Segoe Font

Other seperate components – Windows Live Essentials version 14.0.8089.726
Download Family Safety (x86)
Download Junk mail filter update
Download Microsoft Application Error Reporting (x86)
Download Microsoft Application Error Reporting (x64)
Download Microsoft Search Enhancement Pack
Download Microsoft Sync Framework Runtime Native
Download Microsoft Sync Framework Services Native
Download Microsoft Choice Gard
Download Microsoft Office Outlook Live Add-in
Download Microsoft Office Outlook Connector
Download Toolbar
Download WLXSuite
Download Windows Live Movie Maker
Download Windows Live Communications Platform
Download Windows Live Call
Download Windows Live Upload Tool
Download Windows Live Sign-in Assistant / Windows Live Login Browser Helper Object
Download Windows Live Sync
Download Windows Live Writer
Download Windows Live Mail
Download Windows Photo Gallery

Requirements:
Download .NET Framework
Download DirectX (x86)
Download DirectX (x64)
Download Windows Imaging Component
Download Windows Imaging Component Hotfix (Vista – x86)
Download Windows Imaging Component Hotfix (Vista – x86)
Download Windows Imaging Component Hotfix (Vista – x64)
Download Microsoft Visual Studio Runtime (MSVCRT)
Download Microsoft SQL Server Compact Edition 3.1
Download Microsoft Silverlight
Download Segoe Font

Update
The most recent full Windows Live Essentials Standalone Installer can also be downloaded from the link below. I also provided the Windows Live Essentials 2010 Beta link.

Windows Live Essentials 2009 – Wave 3 (most recent version)
Windows Live Essentials 2010 Beta – Wave 4 (most recent version)

http://g.live.com/1rewlive3/en/wlsetup-all.exe

How to use cookies with CherryPy

Introduction

CherryPy uses the Cookie module from Python and in particular the SimpleCookie object type to handle cookies.

Sending a cookie to a browser is accomplished by using cherrypy.response.cookie and receiving a cookie from the browser by cherrypy.request.cookie.

Example

This is demonstrated in the following example code where we use a login and logout procedure :

import cherrypy

class Root(object):
  @cherrypy.expose
  def index(self):
    return """
              
""" @cherrypy.expose def doLogin(self, username, password): # Set cookie to send cookie = cherrypy.response.cookie cookie['user'] = username cookie['user']['path'] = '/' cookie['user']['max-age'] = 3600 cookie['pass'] = password cookie['pass']['path'] = '/' cookie['pass']['max-age'] = 3600 return 'Cookie set. You can now logout.' @cherrypy.expose def doLogout(self): # Request cookie that is already set reqcookie = cherrypy.request.cookie # Response cookie that overwrites the old one and expires rescookie = cherrypy.response.cookie for name in reqcookie.keys(): rescookie[name] = name rescookie[name]['path'] = '/' rescookie[name]['max-age'] = 0 # or: rescookie[name]['expires'] = 0 return 'Logged out succesfully. You can now login again.' cherrypy.quickstart(Root())

Download source code

Creating a cookie

It is important to note that

  • cookie[name]
  • cookie[name][‘path’]
  • cookie[name][‘max-age’]

are a bare minimum of attributes that you have to set in order to get this working. If you do not set one of these three attributes, the cookie will simply not be set.

Deleting a cookie

Instead of cookie[name][‘max-age’]=0 you can also use cookie[name][‘expires’]=0, which results in the same effect of deleting the cookie.