grelbar just another hacker's blog

1Oct/090

Arrrrrr Trend Micro Office Scan

Okay, so this piece of shit program is pissing me off. It blocks sites like www.2600.com, which has *no* harmful content on it. When inquired on the reasons, they have not yet replied (I sent mail from my company account a few months ago). I guess it's kind of like the government blocklist for "child porn" sites, which can't be viewed, can't be challenged, and can only be changed for the worse.

So how to defeat this stupid piece of shit software: Ping the address you want to visit, and type in the ip address instead of the DNS name. Presto. It'll still complain if the site links to images or other stuff using the DNS name, but you'll be able to view the content. Office Scan 0, Me 1.

Filed under: Howto's No Comments
29Aug/098

Karmic Koala & ATI Radeon

This post will deal with the Alpha4 release of Ubuntu 9.10 "Karmic Koala", and it's new features, particularly the functionality of ATI Radeon cards.

I did a clean install yesterday, and this is what i'm liking so far:

  • Empathy, the new default IM client is awesome. I didn't find plugin support yet, but it's light, and clean. Just the way i like it.
  • The boot time is less than 20 seconds on my machine. It's nearly not enough to go do anything else while i'm waiting, which is a great feature for someone that has to deal with windows vista at work every day...
  • Firefox 3.5 ubuntu branded by default. Thanks. That package is missing from 9.04 right now, and while you can still install it, it takes some work to go from the Beta name of "Shiretoko" to Firefox, with icons and everything. It works, but it's not perfect.

What i don't like:

  • The new default login screen sucks ass.
  • While the new 2.6.31 series kernel is a great improvement in many areas, AMD has not yet supported it in it's binary fglrx drivers (which offer 3d acceleration and the works on ATI cards)

So this will be the topic of discussion today. ATI cards have traditionally been much worse than those of Nvidia on any Linux distro. AMD (ex. ATI) offers drivers called fglrx which provide full 3D acceleration in Linux, and when they are working, the cards can offer great performance. However. When they don't work, disaster ensues.

When you install Karmic, you'll get the traditional "Hardware Drivers" dialog, which will say you have a device that requires propietary drivers that weren't installed by default. Yeah no shit they weren't. You select your device, you hit install. It downloads the drivers, installs them, makes modifications to xorg.conf, and asks you to reboot. With Karmic Alpha4, i got no download dialog, even if it seemed to do something. The selection of my card remained inactive and grey, instead of the green "activated" button that appears when drivers have been installed. So i thought that the drivers somehow failed (didn't look at debug or anything). I went about my business, doing an apt-get update && apt-get upgrade, and then rebooting.

To my great dismay, it wouldn't load gdm at all, but instead displayed an esoteric graphical pattern in the top section of my screen. So, switch to a shell, check out /etc/X11/xorg.conf, and sure enough, fglrx was jotted down as the driver. So clearly, this didn't work.

To get past this problem, uninstall and clean the fglrx drivers. They are not supported in the 2.6.31 kernel yet, so we need to wait for AMD's 9.9 series drivers for this. Usually they'll be out in time for the Beta's or at least the release, so i'm not fretting.

Run:

aptitude purge xorg-driver-fglrx && dpkg-reconfigure -phigh xserver-xorg && exit

This removes the driver, deletes anything related to it, and runs a reconfigure on xorg.

You should now have a clean xorg.conf. Install the xorg-driver-radeon if you don't have them (i'm not sure, i think they were installed by default), and then edit xorg.conf and in the device section, set the driver option to "radeon", if it isn't.

You should now be able to boot in to a graphical user interface.

Okay dual screens. To make these work, as a "big desktop", make your xorg.conf look like this. I tried different options, and fiddling around with the "System -> Preferences -> Display" dealio, but that didn't get me anywhere. It'll ask you to "automatically set the virtual resolution to match your screens", but the end result was 2048 x 2048, in xorg.conf, which obviously didn't work.

Here's my xorg.conf:

Section "Screen"
Identifier      "Default Screen"
DefaultDepth    24
SubSection "Display"
Virtual 3360 1050
EndSubSection
EndSection

Section "Module"
Load    "glx"
EndSection

Section "Device"
Identifier      "Default Device"
Driver  "radeon"
EndSection

In all it's simplicity, i made the virtual resolution match the maximum resolutions of my screens set next to each other. I have two 22" Samsungs, each with a 1680x1050 resolution. So i added up the width resolution and that was it. I restarted X (why does ctrl-alt-bkspace not work anymore?), and went to Display, and then unchecked "mirror displays", and dragged the screens next to each other. Apply, Ok, restart X. Dual screen.

UPDATE! Video playback works *much* better with the radeon drivers than the fglrx drivers ever did in Jaunty 9.04! I'm playing a FullHD video, in full screen with no tearing (which was evident in 9.04 with fglrx drivers), and no problems. 40 CPU load on one core. 500 megs ram used with a bunch of other stuff on as well.

So conclusions: If you don't need 3d performance (i.e. compiz, gaming whathaveyou), don't install the propietary drivers. Stick with the open-source ones!

25Aug/090

Stupid Outlook 2007 autoproofing, and Nokia Ovi Maps 3.0

So i'd like to divert your attention to two things that bugged me this tuesday morning:

1) Outlook 2007 autoproofing. I had a client come in with an Outlook 2007, that automatically made headings out of the first words in a mail. So if you wrote "Hi", on the first line, followed by a line change, it'd make it heading 1. Annoying as hell, since you probably don't want the Hi to be size 9000 and bold and blue? So how do you turn this off. I had to google it, and turns out it was a helluva path. So, you go to Tools, Options, Mail Format, then Editor Options, Proofing, then Auto Correct Options, and then AutoCorrect as you type. From there, uncheck the shit you don't want Microsoft to do for you.... Grr!!!! I actually gave a post-it note to the client with the path there.

2) Nokia Ovi Maps doesn't detect your phone. So Nokia Maps is now Nokia Ovi maps, since everything Nokia is now Ovi (means door in Finnish). You plug in your phone, make sure you have PC Suite support installed (From PC-suite, go to help, then Install PC-suite support on phone or something). Download Nokia Map Updater from their site (version is something like 3.0 at the time of this writing), and then, you install that and like start it.

It should then detect your phone. PC-suite detected my phone. My phone detected the PC. I could even like..view the messages on my phone in PC-suite. But according to Nokia Maps Updater, no compatible phone was connected. It'd just say "searching for connected phone(s)", and nothing. It did say "This might take minutes", but to be fair, i gave it several, to no avail.

So how to get it to see the phone? Well: Switch it off. Then while the phone is off, plug in the usb-cord, then power up your phone. When it has booted, it'll ask for the "How do you want to connect", and offer options like PC-suite, Mass-memory and so on. Select PC-suite, then start Nokia Map Updater, and presto. Phone is detected right away without any searching.

Filed under: Howto's No Comments
25Aug/090

Tweeting with sms

So yeah. Activated my phone on twitter, so i can send SMS messages to update my status.

Why, you may ask, would one want to use something as rudimentary as a text message to update your twitter status? Well, one of the reasons is: Data is expensive if you are roaming, or if you don't have a plan.

Plans are pretty cheap here nowadays. You can get unlimited maximum speed 3G for 12,90 a month, as long as you submit yourself to be a whore of that company for two years. I know it's very common to be tied to a mobile service provider abroad, but we're kind of used to not being locked in.

Sure, we have subsidized phone plans as well, that require a 1 or 2 year contract, but most phones i'd wager are still the unlocked kind, with some kind of pay as you go plan, or a plan without a long contract.

But if you're outside a plan, or abroad, data costs you an arm and a leg. Why? I'm not really sure. I'm not really sure how moving one megabyte of data through the network can cost 1.5 euros (which is the standard going rate for un-planned data!). That's over two dollars a megabyte! Abroad it can be even more insane, where billing can be by the kilobyte. I heard in Turkey, certain roaming data costs like a euro per 50 kB.. insane.

So in these cases SMS might be a good choice. SMS will cost you the standard rate, which might also be a bit high abroad, but still not as high as data, probably. 140 characters isn't a lot, and loading the m.twitter.com page (or any other mobile page for that matter), won't cost you too much, but multiple updates will.

An SMS usually costs you less than ten cents, and even while roaming it's hardly ever over 30 cents. So if you just want to do a quick update, it might be a better choice than data.

Activation was pretty easy, you just slide in your number, then sms the twitter number with an activation code and you're done. After that you can just sms that same number and it'll tweet it. 140 chars though, so not even a full standard 160 char SMS.

Filed under: Howto's No Comments
14Aug/090

Ubuntu 9.04 & CPyrit-Stream now working!

Yay!

I've finally gotten the Pyrit program running and utilizing ATI Stream! I followed these instructions to the letter, though i built RPM from source with the patch for LZMA compressed RPM's, which did the trick (although, i've also read the 1.4.0 beta 2 package of the Ati Stream SDK doens't have this problem, but anyhow). I think i also had to apt-get some libraries that were missing, but they were listed pretty well in the instructions.

As for building pyrit, i used the instructions in the wiki, that can be found here. I ran in to an error while building the pyrit source, but that was fixed by doing an edit in a file according to these instructions. Fixes for other common errors are in the installation wiki.

So for the order: Install Atistream and Atical according to the instructions in the KB. Apt-get any packages you are missing. Build and install Pyrit, then CPyrit-Stream.

Run the command pyrit list_cores, which should show something like the screenshot below, and then run pyrit benchmark to see what kind of numbers you're getting on your hardware. I am amazed. Compare the over 8000 PMKs/s (pairwise master keys), with the ~700 of one Phenom II X4 940 cores. Look at those results (yes yes, synthetic benchmark..):

List cores and Benchmark on my Radeon 4850 (and Phenom 2 940)

List cores and Benchmark on my Radeon 4850 (and Phenom 2 940)

You'll note that it only shows three of the four cores on my Phenom, this is a feature. For every GPU core that it handles, it saves one CPU core for scheduling tasks.

A man can always dream... That there is about 3000 euros worth of hardware  (four Nvidia GTX295's, a motherboard to support 4 Pci-e cards, processor, memory.. i guestimated). 80 000 PMKs / s (or half of that, depending on how you read the benchmarks). It seems to see the cards as two cores each.

Edit for 15.8.09 - I'm working on a proper howto for this thing since the internets seem not to have a coherent guide for a current ubuntu version. The 8.04 guide is great, don't get me wrong, but i think it could be more complete. I've also e-mailed AMD to ask about providing .deb packages on my / their site, and or publishing the new howto.

11Aug/092

64-bit Ubuntu & Citrix XenApps

Hey!

This was a thing i was debating with a colleague for a long time. There is no official x64 client from Citrix for their XenApps dealio. But! There is a way to install it successfully!

I used Madox.net for a part of this, but the rest was googled by myself. I thought i'd compile the instructions here to avoid problems. So, follow the instructions of Madox.net. As for the certificate issue mentioned, you can search my blog for Thawte, or download any necessary certs and place them in your citrix installation folder /keystore/cacerts.

There are a few remaining problems, namely some 32-bit libs that can't be found when starting wfcmgr or wfica. To solve these, i found an awesome tool called getlibs. Getlibs gets 32 bit libs as they are needed. You can point it to the wfcmgr program (if you used the default, that's /usr/lib/ICAClient/wfcmgr), and it'll sniff out the needed libs, download, install and symlink as needed! It fucking worked! Thanks to cappy, if that's who made the tool. There are tons of other nifty options for that tool, you could look here for some of those.

Filed under: Hacking, Howto's 2 Comments
10Aug/092

Ubuntu 9.04 x64 & Pyrit with ATI Stream

Okay, so since i just got the new graphics card (an ASUS EAH4850), i wanted to try out some of the GPU computing possibilities of the card. The Pyrit project exists to take advantage of multiple GPU computing platforms, such as Nvidia CUDA, and ATI Stream, so i decided to give that a whirl.

I downloaded the Pyrit and the Ati Stream packages from the Pyrit site. I found out i also need the ATI Stream SDK, which can be obtained from the AMD site. The thing to be noted here is that there is currently only support for RPM based systems, such as Fedora, CentOS etc. So of course, i thought, "Alien!", the package converter. I apt-get'ed Alien and RPM, and got working on the thing.

You download the package, which is a .tar.gzip file. Unpack the file to get to the .run file. The run file can be exectured simply with ./filename.run. This should result in the script from the .run file being executed. It'll fail shortly after the EULA, or it did on my x64 system.

I opened up the run file, and commented out the part where it deletes the temporary folder where it extracts the actual RPM file (and before that, tries to run rpm on the file, which fails).

#!/bin/bash
echo "ATI Brook+ SDK Installer"

TMP="atibrook"

HERE=`pwd`
DST=/usr/local
FOPEN="more"
RPM="alien"

#Extract archive into /tmp/atibrook
echo -n "Extracting archive..."
dd if=$0 of=/tmp/${TMP}.tar.gz bs=1 skip=16384 >& /dev/null
echo "DONE"
mkdir /tmp/atibrook
cd /tmp/atibrook
echo -n "Uncompressing package..."
tar -xzf ../${TMP}.tar.gz
echo "DONE"

#Accept EULA
${FOPEN} EndUserLicense.txt
echo -n "Do you accept this license agreement? [y/n]: "
read agree
if test A"$agree" = Ay -o A"$agree" = AY; then
echo "You accepted the license, continuing installation."
else
echo "You declined the license, aborting..."
rm -rf /tmp/atibrook
rm /tmp/${TMP}.tar.gz
exit
fi

#Install via rpm
echo ""
echo -n "Select a path for installation [default]: "
read USERPATH

if test "$USERPATH" != ""; then
echo "Using '$USERPATH' for directory prefix."
echo ""
echo "Installing package via RPM..."
$RPM --prefix=$USERPATH /tmp/atibrook/*.rpm
else
echo "Using default directory /usr/local/atibrook"
echo ""
echo "Installing package via RPM..."
$RPM /tmp/atibrook/*.rpm
fi

#### THIS PART I COMMENTED OUT SO IT LEAVES THE RPM INTACT ####

#Cleanup
#echo ""
#echo "Removing Temporary Files..."
#rm -rf /tmp/atibrook
#rm /tmp/${TMP}.tar.gz
echo "Exiting installation..."
exit

So the result is that in /tmp/atibrook you now have the rpm file.

Running Alien against it results in an error about rpm.pm on line 155. Something relating to perl, the complete error is:

Installing package via RPM...
Unpacking of '/tmp/atibrook/atistream-brook-1.4.0_beta-1.x86_64.rpm' failed at /usr/share/perl5/Alien/Package/Rpm.pm line 155.
Exiting installation...

Now, i have no fucking idea how to fix it. Looking at line 155, it relates to the cpio command not working properly, but how and why and what the fuck? I'm not a developer. I'll need to show this to someone, like B, maybe he can figure it out.

I also tried instructions i found on the AMD Developer Forum (requires registration). These detail the use of rpm2cpio, instead of alien, but that doesn't work either. The RPM seems malformed somehow. Perhaps as a result of it being made with a specific tool (the name of which escapes me), which creates files that are unreadable by rpm2cpio.

Blargh. I'm gonna run a Fedora 11 live CD soon, and see that it actually works. Get some numbers off this thing. It's supposed to do 7800 PKM's, which is a lot faster than for instance an Intel I7 920. Sweetness.

30Jun/092

Intel 915 chipset and Windows 7

Lo! The latest incarnation of Windows Vista, also called Windows 7 has/had problems with certain integrated graphics chipsets, particularly lower end Intel chipsets, such as the 915 that i have in my Thinkpad X41. This was a shame, because it would only run 1280x1024, and had no chance of running anything fancy, since it was being detected as "Standard VGA Adapter".

There were no drivers either from Intel or Microsoft for the longest time. But Microsoft released a driver that claims to work with the Intel chipset i had. It just popped up on Microsoft Update, so i thought i'd give it a whirl. Usually the drivers microsoft releases are not perhaps the most optimized, but they mostly work.

This one did not.

The driver installed, and the hardware showed correctly in Device Manager. It wanted to reboot, so i did. And after that it was back to the status quo. No driver installed, and then it started "looping", just trying to install the driver, failing in it. I was miffed, and went back to the standard VGA driver.

But then i came to work, and i had to hook up my Dell E228WFP 22" monitor, and since i couldn't get the native resolution on the standard vga adapter, i was starting to get really pissed off. So i googled for a while, and came up with this thread, which apparently talks about the new driver that does not work..

So a guy offers some advice. Simple advice at that. Download the latest XP driver, and install it using Windows Vista compatibility mode. Driver and Intel Graphics Media Accelerator ..configuration software...whatever works fine! Resolution and all. Apparently this works for all kinds of 8xx and 9xx chipsets, so try it out.

For reference, i'm using the public Release Candidate, latest updates, build 7100.

Sweeeet.

intelworking

Filed under: Hardware, Howto's 2 Comments
22Jun/090

Civilization 4 under Ubuntu 9.04 (with Wine)

After seeing the release of Alien Arena 2009 for Linux (and all other platforms), i started thinking about running my favorite game, Civilization 4 on Ubuntu 9.04. And so i did! But it took some tweaking to get it to work with wine, as do most games (Except Unreal Tournament, which works i think natively). I'll describe the steps taken here, for future reference, and if you don't wanna spend your time browsing different locations for instructions:

Setup is a 32-bit Ubuntu 9.04, with all latest updates. I run a Gigabyte GA-MA790X motherboard, with integrated sound, and an Nvidia 8800 GTS with the 180 propietary drivers installed, using Ubuntu's Restricted Drivers manager.

- Install wine with sudo apt-get install wine
- Take the game cd, put it in, and run wine /media/cdrom/setup.exe
- Cancel the Direct X prompt, as we can't install that through wine. Proceed with the installation, as you would with windows.
- Get the latest patch from for instance Softpedia.
- Install the patch using wine
- Open up the wine configuration tool from Applications -> Wine, and in the libraries tab, enter "msxml3" and press add. This adds compatibility for a certain dll that we need to make this work.
- From any windows xp installation, copy the following three files (they reside under $windowsfolder$\system32), msxml.dll, msxml3r.dll and d3d_d35.dll and copy them to your wine "windows installation". For me, this was ~/.wine/drive_c/windows/system32. If that doesn't work, copy them to your civilization 4 folder (For me, the default was ~/.wine/drive_c/Program Files/Firaxis Games/Sid Meier's Civilization 4/
- Get a nocd crack, since the copy protection just shits itself under wine. Crack the civilization4.exe file, and run it with wine path_to_the_exe_file. Or from Applications -> Wine -> Programs -> Firaxis Games.

If it complains about sound, open up Civilization4.ini, which resides under the wine my documents/my games/ folder. Edit the place that says EnableVoice and set it to = 0, add the line if necessary, but it'll be there if you've tried to start the game at least once.

I recommend running the game in windowed mode, so from the game options, uncheck the "fullscreen" box. If the game window if odd after that, go to the wine configuration tool again, and under Graphics, check the "Virtual Desktop" thingamajig, and set the resolution to something that suits you and your screen.

Happy camping.

Filed under: Howto's No Comments
17Jun/090

Ubuntu & Citrix XenApp 11.0

Problems installing Citrix ICA Client 11.0 (nowadays XenApps) on ubuntu?

Check out this page. Nuff said.

Basically, Download the client from the citrix site,

apt-get install libmotif3

unpack the client, run ./setupwfc, use defaults or customize. Make a symlink, sudo ln -s /usr/lib/libXm.so.3.0.2 /usr/lib/libXm.so.4. Also make links for the tools:

sudo ln -s /usr/lib/ICAClient/wfica /usr/local/bin/wfica
sudo ln -s /usr/lib/ICAClient/wfcmgr /usr/local/bin/wfcmgr

Run wfcmgr to configure options (such as local drive mapping).

In case you get an error 61 when you try to connect to a server, or start an application, download the Thawte Premium Server certificate, and put it in your installation /keystore/cacerts folder.

Filed under: Howto's No Comments