Thursday, September 1, 2011

Akregator Segmentation fault

If akregator is having problems starting up and gives a KDE crash dialog stating that there was a Segmentation fault, it could possibly be a corrupted mk4 file somewhere in ~/.kde/share/apps/akegrator/Archive. The easy solution is to delete the Archive but you lose all article flags. It's better if we could find which RSS feed is causing the problem and nuke that instead. To do that use the following command:
strace -f -e trace=open akregator
The last mk4 file in the Archive directory that was opened before the segmentation fault occured will be the culprit. Just rename or delete the file and try again. If it crashes again, repeat and see if it's another mk4 file. IF not, it's some other problem.

Tuesday, August 2, 2011

Fail2ban ssh root stats

My home server has been using fail2ban with the SSH root logging blocker. Being curious, I decide to extract some statistics to find out which country the logging attempts came from. I set up fail2ban to also send emails of blacklisting events. Using the following bash command:

# grep 'SSH: banned' /var/spool/mail/root | cut -d' ' -f5 | xargs --replace=xxx geoiplookup xxx | sort | uniq -c | sort -n

and here is the result:
1 GeoIP Country Edition: AE, United Arab Emirates
      1 GeoIP Country Edition: BE, Belgium
      1 GeoIP Country Edition: BH, Bahrain
      1 GeoIP Country Edition: DK, Denmark
      1 GeoIP Country Edition: GR, Greece
      1 GeoIP Country Edition: HU, Hungary
      1 GeoIP Country Edition: IR, Iran, Islamic Republic of
      1 GeoIP Country Edition: KW, Kuwait
      1 GeoIP Country Edition: KZ, Kazakhstan
      1 GeoIP Country Edition: LK, Sri Lanka
      1 GeoIP Country Edition: MN, Mongolia
      1 GeoIP Country Edition: PR, Puerto Rico
      1 GeoIP Country Edition: SN, Senegal
      1 GeoIP Country Edition: YE, Yemen
      2 GeoIP Country Edition: AR, Argentina
      2 GeoIP Country Edition: CR, Costa Rica
      2 GeoIP Country Edition: EC, Ecuador
      2 GeoIP Country Edition: LT, Lithuania
      2 GeoIP Country Edition: OM, Oman
      2 GeoIP Country Edition: PA, Panama
      2 GeoIP Country Edition: PH, Philippines
      2 GeoIP Country Edition: PT, Portugal
      3 GeoIP Country Edition: ID, Indonesia
      3 GeoIP Country Edition: NL, Netherlands
      4 GeoIP Country Edition: AU, Australia
      4 GeoIP Country Edition: BG, Bulgaria
      4 GeoIP Country Edition: CZ, Czech Republic
      4 GeoIP Country Edition: DE, Germany
      4 GeoIP Country Edition: MA, Morocco
      4 GeoIP Country Edition: PK, Pakistan
      4 GeoIP Country Edition: UA, Ukraine
      5 GeoIP Country Edition: CL, Chile
      5 GeoIP Country Edition: MX, Mexico
      5 GeoIP Country Edition: PL, Poland
      6 GeoIP Country Edition: CA, Canada
      8 GeoIP Country Edition: ES, Spain
      9 GeoIP Country Edition: BR, Brazil
      9 GeoIP Country Edition: HK, Hong Kong
      9 GeoIP Country Edition: JP, Japan
      9 GeoIP Country Edition: NZ, New Zealand
     10 GeoIP Country Edition: TW, Taiwan
     11 GeoIP Country Edition: GB, United Kingdom
     12 GeoIP Country Edition: TH, Thailand
     12 GeoIP Country Edition: TR, Turkey
     13 GeoIP Country Edition: RU, Russian Federation
     17 GeoIP Country Edition: IT, Italy
     18 GeoIP Country Edition: VN, Vietnam
     19 GeoIP Country Edition: CO, Colombia
     19 GeoIP Country Edition: EG, Egypt
     20 GeoIP Country Edition: FR, France
     38 GeoIP Country Edition: IN, India
     40 GeoIP Country Edition: KR, Korea, Republic of
     53 GeoIP Country Edition: US, United States
     72 GeoIP Country Edition: IP Address not found
     74 GeoIP Country Edition: PE, Peru
    211 GeoIP Country Edition: CN, China
It's no surprise who does the most break-in attempts. For me, the second one in the list is a bit surpising. Peru is either a haven for hackers or it has a lot of insecure computers that are the jumping points for other hackers in other countries. I don't know much about Peru.

Tuesday, July 19, 2011

sc_trace for enumerated types in SystemC

I been struggling for awhile now with getting sc_trace overloading to work for enumerated types in SystemC. After finding this post and reading how sc_trace work, I worked out a solution and tested it. It works! So hopefully, this post will help others:

Here's a cut down custom object type with a working sc_trace with an enumerated type:

typedef enum { IDLE = 0, BUSY } state_t;

class MyType {
 unsigned info;
 state_t  flag;
 ...
 inline friend void sc_trace(
  sc_trace_file *tf, 
  const MyType & v,
  const std::string & NAME ) {
  int* iflag = (int*) &(v.flag);
  sc_trace(tf, v.info, NAME + ".info");
  sc_trace(tf, *iflag, NAME + ".flag");
 };
};

Thursday, April 7, 2011

Getting Half-Life 2 on Steam in Linux

After getting a brand new beast of a laptop (G73SW) and installing it with Fedora 14 x86_64, I wanted to play a game of two using my Steam account. After all, I you have a gaming laptop, what good is it if you don't game.After checking to see if Half-Life 2 works on Wine using WineHQ AppDB. I set out to get it working.

After two nights of messing around with wine, I finally got it two work. Here are some of my notes and observation.

Wine x86_64 isn't mature enough to run games from Steam. Firstly, audio doesn't work. Half Life 2 doesn't seem to start if audio isn't working.

So you need to uninstall all wine x86_64 packages. Then install i686 version of wine:

yum install wine-small-fonts wine-jack.i686 wine-system-fonts \
wine-ldap.i686 wine.i686 wine-common wine-marlett-fonts \
wine-pulseaudio.i686 wine-fonts wine-cms.i686 wine-wow.i686 \
wine-symbol-fonts wine-openal.i686 wine-devel.i686 \
wine-core.i686 wine-desktop wine-oss.i686 wine-courier-fonts \
wine-twain.i686 wine-esd.i686 wine-tahoma-fonts wine-capi.i686 \
wine-alsa.i686 wine-ms-sans-serif-fonts


Next download the infinitely useful winetricks script and use it to install Steam, DirectX 9, corefonts, flash, vcrun2005.

The biggest thing got me stumped awhile was trying to get OpenGL to run since DirectX uses it. I finally got it to work once I discover that you need to install the 32-bit libGL.so for the NVidia Xorg drivers:

yum install xorg-x11-drv-nvidia-libs.i686

Once that was done, Half-Life 2 finally started with audio right from the Steam Library Panel. I copied over all my save games from my Windows partition, fiddled with the game settings and finally loaded a saved game.

Next up... Try restoring some of my other Steam games.