Archive for the ‘Hack’ Category

Installing VMware Server Console only on Ubuntu 8.04

Monday, May 26th, 2008

If you get error as:

/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server/bin/vmware-server-console: /usr/lib/vmware-server/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)

Copy over two libraries:

$ sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware-server-console/lib/libgcc_s.so.1/
$ sudo cp /usr/lib/libpng12.so.0 /usr/lib/vmware-server-console/lib/libpng12.so.0/

Record TV Shows from SlingBox using Open Source / Freeware

Wednesday, February 20th, 2008

Problem: I have been searching everywhere to look for something to record my TV shows off the SlingBox.

Solutions: The simples solution is to get At-Large Recorder (ALR) from Applian Technologie.  The good thing about ALR is that it works well, record in good quality, can present time and channels, etc.  I really have nothing against ALR.  However, if you want to save $49.95 and willing to suffer poorer quality recording as well as half working solution… read on…

  1. First of all some Warnings…  This solution only do 320 x 240 or 640 x 240 (Yes, you cannot do 640 x 480!)  and change channel does not work for me, some claim that it works.
  2. Now, if you are still interested, head over to SlingBox SDK on SourceForge and download the SlingBox VLC (I have not tried the Recorder, yeah I know I am lazy).
  3. I assume that you have VLC installed.  If not, get the VLC Media Player and install it.  Extract the SlingBox VLC and copy libaccess_slingbox_plugin.dll into “C:\Program Files\VideoLAN\VLC\plugins”.
  4. Start VLC and Open preferences panel (Settings–>Preferences).
  5. Navigate to “Input/Codecs”–>”Access Module”–>”Slingbox”.
  6. Check “Advanced options” (lower right corner of Preferences panel).
  7. Enter the address, port (default is 5001) and password of your slingbox and click on “Save” to save the settings.
  8. In menu select File–>Open Network stream.
  9. In “Advance options”, check “Stream/Save” and click on “Settings…”.
  10. In the “Outputs”, select “Play locally” and “File” then click on the “Browse…” button to give a filename.
  11. You can play around with the various Encapsulation methods and Transcoding options to find “the best”.
  12. Click on “Ok” then “Ok” again and enjoy your recording.

Thawing SSH Brute Force Attack

Thursday, October 11th, 2007

Problem: These day, one of the hosting server is under constant SSH brute force attack. The simplest way is of course to block off all SSH access and only give access to some fixed IP. However, some of our guys do not have a fixed IP, so I have to use the iptables to fence off the attacks.

Solution: A lot of people has already written on how to use iptables to stop SSH brute force attack. However, I would like to present it one more time, hopefully more complete and clear. This is the steps that I did:

  1. First, put in the failsafe so that you won’t locked yourself out. Add:
    */10 * * * * /sbin/iptables -F
    so that the iptables rules are flushed every 10 minutes. If you locked yourself out, you can get back after 10 minutes.
  2. You can then proceed to add rules using iptables. The commands I use are:
    # iptables -A INPUT -s xxx.xxx.xxx.xxx -p tcp -m tcp --dport 22 -j ACCEPT
    # iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH
    # iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 3 --rttl --name SSH -j DROP
  3. Take note that iptables command should be run using the root account.
  4. Try to login using SSH with 3 failed attempt and you will be locked out of the server.
  5. Once tested that the rulesets work well, save the rules (I am on CentOS, so I can do “/etc/init.d/iptables save“) and remove the crontab entry.
  6. Now, some administration stuffs:
    1. To see what are the IPs banned, do:
      # cat /proc/net/ipt_recent/SSH
    2. To clear all the banned IPs do:
      # echo 'clear' > /proc/net/ipt_recent/SSH
    3. To add a known bad IP do:
      # echo '+xxx.xxx.xxx.xxx' > /proc/net/ipt_recent/SSH
    4. To unban an IP do:
      # echo '-xxx.xxx.xxx.xxx' > /proc/net/ipt_recent/SSH

2Wire HomePortal 2700HG (SingNet 2Wire) with Mac OS X Wireless

Saturday, September 8th, 2007

The Problem: I have been quite a fan of Mac. The problem is that SingNet provides a 2Wire ADSL Modem + Wireless router which is not compatible from the box with Mac.

The Solution: The 2Wire HomePortal 2700HG is set to use 64-bits WEP encryption. However, Mac OS X only supports 40-bits or 128-bits WEP. So, the only way is to set the 2Wire HomePortal 2700HG to 128-bits WEP. Here’s the steps:

  1. Connect the machine using ethernet cable to the 2Wire (or use any existing connected computer).
  2. Go to http://homeportal/xslt?PAGE=C05 or http://192.168.1.254/xslt?PAGE=C05
  3. Skip Network name
  4. You can set either SSID broadcast ON or OFF
  5. Under Wireless Security, make sure that the box is ticked
  6. Authentication: Set to WEP-SHARED
  7. Use customized WEP key (encryption key) with 26 numbers (for 128-bits) (I suggest you use the original WEP key 2 times + 6 first digit as in the 2Wire box information provided in SingTel’s site, for the rest of the world using 2Wire, just use any 26 numbers)
  8. Leave the rest of settings as default, click Save to update your current setting.
  9. Now go to your Mac, airport and connect to your 2Wire and surf!!

** You may always want to make sure that Airport is your prioritized connectivity as shown in Apple’s KB.

How to Change MAC Address on a Mac?

Tuesday, June 19th, 2007

The Problem: How do one change the MAC Address on a Mac OS X?

I have decided that my blog posting is too litte, thus, I would put some of those hacks that I found interesting up. Hope that you will enjoy it.

The Solution:

  1. If you are on Mac OS X 10.4.x (Tiger), you are in luck. To change the MAC address:
    • You might want to record down your original MAC address by doing:
      $ ifconfig en0
    • To change the MAC address:
      $ sudo ifconfig en0 lladdr xx:xx:xx:xx:xx:xx:xx:xx
    • Check that your MAC address is changed:
      $ arp -a | grep xx:xx:xx:xx:xx:xx:xx:xx
  2. Now, what if you have Mac OS 10.0.x - 10.3.x…? Peter Bartoli has put up a page on showing you how to patch your OS X Kernel here with the appropriate patch to change your MAC address.