Monthly Archive for January, 2008

There Ain’t No Strings on Me

I just bought a Dell 355 Bluetooth chip for my D420 since I make the rookie mistake of not ordering it installed originally.

About four hours later, I’ve successfully connected my Ubuntu 7.10 machine to the interwebs via GPRS/EDGE on my Sony Ericsson W810i issued to me by US AT&T. But, I bought the phone back when they were Cingular, so my settings remain from the good ol’ orange days.

First things first : $ sudo aptitude install bluez-utils blues-pin ppp

There are lots of instructions available to pair your phone with the PC. Make sure to put the phone in discoverable mode, then try to discover it and connect:

$ hcitool scan
Scanning ...
        00:11:22:33:44:55       icarus (W810i)
$ sudo hidd --connect 00:11:22:33:44:55

Now that we’ve got the initial pairing done, we’re going to write some connection settings.

We need to find the dial-out device channel.

$ sdptool browse 00:11:22:33:44:55 | grep "Dial-up" -A10
Service Name: Dial-up Networking
Service RecHandle: 0x10002
Service Class ID List:
  "Dialup Networking" (0x1103)
  "Generic Networking" (0x1201)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Profile Descriptor List:
  "Dialup Networking" (0x1103)

Now, we set this number in the bluetooth radio-frequency config.

$ cat /etc/bluetooth/rfcomm.conf
# bluetooth config for phone
rfcomm0 {
    bind yes;
    # Bluetooth address of the device
    device 00:11:22:33:44:55;
    # RFCOMM channel for the dialup connection
        channel 2;
    # Description of the connection
    comment "w810i -- icarus";
}

In order to make this change “stick,” reinit the rfcomm0 connection.

$ sudo rfcomm release 0; sudo rfcomm bind 0;

Also, lets go ahead and configure the PIN settings for bluetooth:

$ cat /etc/bluetooth/pin
1234

$ cat /etc/bluetooth/pin_helper
#!/bin/sh
echo "PIN:"`cat /etc/bluetooth/pin`

Now that we have the configuration for the connection set, we configure the p-p-p-peer at /etc/ppp/peers/<nameofpeer>. This defines a ppp (modem) connection via rfcomm0. I called my peer gprs. You can name it whatever you want. You will use this filename as the alias for the call command we’ll issue at the end.

$ cat /etc/ppp/peers/gprs
/dev/rfcomm0
115200        # speed
defaultroute  # use the cellular network for the default route
usepeerdns    # use the DNS servers from the remote network
nodetach      # keep pppd in the foreground
crtscts       # hardware flow control
lock          # lock the serial port
noauth        # don't expect the modem to authenticate itself
local         # don't use Carrier Detect or Data Terminal Ready
debug         # show debugging information in plog
noccp         # compression
noipdefault
asyncmap 0xa0000 #make server happy
0.0.0.0:0.0.0.0  #default nopid

user "WAP@CINGULARGPRS.COM"  #Cingular Orange
remotename cingular
ipparam cingular

# Use the next two lines if you receive the dreaded messages:
#
#    No response to n echo-requests
#    Serial link appears to be disconnected.
#    Connection terminated.
#
lcp-echo-failure 10000
lcp-echo-interval 1000

connect '/usr/sbin/chat -s -v -f /etc/chatscripts/gprs'
#no disconnect script necessary

Additionally, the CHAP authentication scheme that Cingular wants with the username is configured in /etc/ppp/chap-secrets.

$ sudo cat /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
"WAP@CINGULARGPRS.COM" * "cingular1"

When we use the dialer to make the above link to the phone’s modem via bluetooth, the modem has to know what conversation (chat) to have with the server. (Note the file location on the second-to-last line above.)

$ cat /etc/chatscripts/gprs
#
TIMEOUT 10
ABORT   'BUSY'
ABORT   'NO ANSWER'
ABORT   'ERROR'
SAY     'Starting GPRS connect script\n'

# Get the modem's attention and reset it.
SAY	'ATTN Modem\n'
""      ATZ

# MAGIC Sony Ericsson Init Codes
#SAY	'Sending SONY Codes\n'
OK 	'ATV1E1S0=0&D2&C1'
OK 	'AT+CMEE=1'

# Cingular Orange (if you signed up before the merger)
OK      AT+CGDCONT=1,"IP","wap.cingular"

#SAY     'Dialing...\n'
OK      ATD*99#
CONNECT ""

Now, we have all the pieces in place to attempt to call. Fire it up. Remember to call the filename you used in /etc/ppp/peers/ if you changed it.

$ pppd call gprs

Now you should see lots of pretty text flying by and your phone should light up saying that it’s connected. If not, I’m sorry and your settings are either slightly different than mine or there’s some mundane detail that you need to complete in order to make your dialer behave like mine.

If your connection stays open without any errors, before you can use the connection with Firefox, you may need to add a default route. Use netstat to figure out what connection you currently have, and then use route to add that connection to the default route configuration.

$ netstat -nr
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.10.1.0       0.0.0.0         255.255.255.0   U         0 0          0 ppp0
$ sudo route add default ppp0

Bueno.

Upgrade: Google Syntax Highlighter

(This message is for all three of you that read this blog & the one who spams it already…)

I’m currently in the process of switching to google-syntax-highlighter. Please bear with me.

Hahackintosh

I have two Apple stickers lying around my apartment. Yesterday, I said to myself, “Well, I can’t use these unless I have something Apple-y to put them on…”

So, my Dell d420 is successfully running Kalyway Mac OS 10.5.1 Leopard on an external Seagate HD. Hacked vanilla kernel, SSE3 and GUID. The “big” animations (exposé, widget layer) don’t really show up on my crappy Intel 950 and there’re some occasional cursor artifacts, but everything is pretty smooth. Not good enough to put the sticker on I suppose, but still; what blasphemy to run OSX on a Dell.

I think I’ll keep Ubuntu 7.10. If only Nautilus had that NeXT-inspired column view that Finder seems to have a monopoly on at present. And I need a sticker

Escher-ward Scissorhands

Dutch artist Peter Callesen has everything on Burton’s incisive inception. If only topiaries provided for such beautiful use of both positive and negative space. Favorites include Closet, 2006 and Looking back, 2006. Check out the entire collection.

justsayhi Quizzes

There are some useless quizzes out there to kill time.

  • You could take on 20 five year old kids in a fight.
  • You are 71% Geek!
  • You Have a 36% Chance of Survival in a Zombie Apocalypse.
  • Approximately 141,703 people died worldwide on February xx, 19xx.
  • Congratulations, your dead body is worth $3590!
  • Congratulations! Your body is 47% effective as a human shield.
  • Number of colors I can name in 5 minutes : 34
  • There is a 57% chance your brain matter contains grade-A synesthesia!

Is it bad when I saw thought “The Geek Quiz : Ever lose your car keys and wish life had ctrl+f?” I thought, no I lose my keys and wish life had ‘/’…

War! Hua! What is it Good Fo’?

Hackers exist. They even do some pretty nefarious (or idiotic) things. Most of it we don’t hear about because if bigwigs knew how insecure most systems really are, they’d lose it. If Wachovia or Bank of America’s website was consistently down, would you leave them for another bank? Maybe. Since servers have finite bandwidth, there’s a vulnerability waiting to be exploited.

A few days after the now infamous Tom Cruise video was released and subsequently recalled, a group of people called Anonymous (some subset of whom are (cr|h)ackers) openly declared war on The Church of Scientology. When I saw their video, I laughed a little and thought of Angelina Jolie in that see-through top in Hackers. I miss those good ol’ days,” when worms were in 3D…

Anyway, today it happened. Distributed Denial of Service (DDoS) attacks were apparently successful in bringing down many of the Scientology websites targeted. For up-to-the-minute Scientology faceplants, fans of the movement have created a nifty status page.

What’s interesting about this attack is that it’s public, it’s not for money, and it’s not against a business, insofar as the Church of Scientology cannot be called a business. It’s against a group of individuals who share a common faith in alien souls inhabiting human bodies. Sure that belief may be weird and you have to pay money to advance and learn its tenets, but seriously, what happened to the Hacker Manifesto? “We exist without skin color, without nationality, without religious bias…” — The Mentor, 1986. Anonymous is attempting to digitally purge the Internet of a belief system they find objectionable. Why not Nazis? Why not Elvis impersonators? Why not hackers? The whole idea of the Internet is that it’s free and for everyone.

Anonymous are censors. Amusing, intelligent censors with whom in many respects I whole-heartedly agree. But censorship is a bad thing.

Question…

If abortion is made illegal, what should be the punishment for women who have illegal abortions?

Embedding has been disabled, but these people are fantastically sad. I guess you don’t need to think things through when the man upstairs calls you.

Prettify Brookstream

My CSS for use with Google Prettify available for download.
Inspired by the vi-colorscheme brookstream.
Incidently, Dean Lee’s WordPress plugin for Google Code Prettify doesn’t play nicely with Shutter Reloaded because it hogs the window.onload event. Here’s the patch to get around it using addLoadEvent.

function gcp_footer(){ ?>
  <script type="text/javascript">
  function addLoadEvent(func) {
    var oldonload = window.onload;
       if (typeof window.onload != 'function') {
            window.onload = func;
       } else {
            window.onload = function() {
               if (oldonload) {
                    oldonload();
               }
               func();
              }
         }
    }

    //prevent override other' onload
    //window.onload = function(){prettyPrint();};

    addLoadEvent(prettyPrint);
    </script>
<?php
}

Google’s Unwitting Adwords

If you’re at all versed in Google’s advanced search keywords, searching for mp3 files (or really anything that has a title) in the indexes of unprotected www directories provides a wonderful way to get highspeed downloads over http. Now, those who would profit from my using of Filesharing Product XYZ have capitalized on this by creating advertising honeypots for would-be music thieves.

My search for "Familjen" intitle:index.of mp3 -html yeilded a few results. One towards the bottom of the list looked like a hit, containing my search in the summary: … 2006-09-26 – Familjen – Familjen EP (2006) …. Excellent! I clicked it and lo and behold what do I find but

I downloaded all these files from – redacted
No Downloads Here! Get them from: redacted

Hi, I’m afraid none of the files here can be downloaded, this is just a big list of the files on my hard drive right now. Don’t believe me? Well, my files are a little disorganised but here is the size of just one of my MP3 directories:

Now doesn’t that just take the biscuit? Thousands & thousands of symlinks with enticing titles all pointing to copies of this same message. Ingenius!

This particular stalker of savvy searcher’s referral-id is aff_marse_29_1_100 and he probably makes a fair amount of cash for every visitor he refers. Google isn’t collecting adword revenue off this guy, but he’s using their service in mostly the same way. He makes a profit off of percentage points. I bet his clickthrough ratio isn’t that great though; it’s tough to trick the techies twice.

Simple HTTP Proxy Authentication for CLI

I have to work behind an authenticated proxy, so using cvs, subversion, or gem from the Cygwin command line can be tricky. Some programs recognize the HTTP_PROXY, HTTP_PROXY_USER, HTTP_PROXY_PASS properties, so I wrote this little script to export the environment variables for me so I didn’t have to hardcode my password anywhere. Yes, it’s in an environment variable so it’s still very insecure, but it’s better than having it sitting in a file somewhere.

This was also a great chance to test out how the Google Code Prettify and Code Markup plugins work together. The formatting works just fine, but the colors are misbehaving.

#!/bin/sh

if [ ! -n "$1" ]; then
  echo "Usage: proxy [on|off]";
  exit 5;
fi

function proxyon {
  if [ "x$HTTP_PROXY" != "x" ]; then
    echo -e "Proxy already on!";
  else
    proxyserver=THIS.IS.MY.PROXY:8080
    u=MY_USERNAME
    echo -n 'Password: '
    read -es p

    export HTTP_PROXY="http://$proxyserver/"
    export HTTP_PROXY_USER="$u"
    export HTTP_PROXY_PASS="$p"

    echo -e "\nProxy is now ON."
  fi
}

function proxyoff {
  export HTTP_PROXY=""
  export HTTP_PROXY_USER=""
  export HTTP_PROXY_PASS=""

  echo -e "\nProxy is now OFF."
}

if [ "$1" == "on" ]; then
  proxyon
else if [ "$1" == "off" ]; then
  proxyoff
else
  echo "Usage: proxy [on|off]";
  exit 5;
fi;fi;