Blog.phpwnage
A blog by Kevin Lange, UIUC Class of 2013

You got your SOCKS in my DNS!

Here's an overview of how my SOCKS over DNS proxy system is going to work:

forum image


Fairly simple, right? Just a relay server, incoming SOCKS data is encoded in base-32, passed as an A request to the DNS hivemind, eventually gets to our server, where it's decoded, and passed on again as SOCKS data to a real SOCKS server. Data from that real SOCKS server is encoded by the DNS server in base-64, tossed into a few TXT packets, and thrown back down the line as a response to a different set of queries, where it eventually reaches the client and is decoded and converted back into regular SOCKS data and fished back to the application.


Discuss this news post here.
(No comments)

My New Bash Prompt

Last night, I set up a new bash prompt. It's a modified version of my old prompt with a bit more information added:
forum image

In a normal prompt, it's pretty much the same as my old one: user, host, date, time. I added a seconds display, moved the path into the brackets, and then added a new line. When in a git repo, I can see the current branch name, whether I have modified files lying around, and whether I have yet to push (if I'm ahead of the current branch). I'm thinking of expanding this to subversion and Bazaar, both of which I use quite a bit. When a program returns a value other than 0, I also display that after the current time, in bright red. If I'm root, the prompt symbol changes from a green $ to a red #.

The more interesting things to note are why I have so much information there by default. I ssh to a lot of different machines and sometimes into different users, so it's good to be able to identify what user I currently am (whether it be `klange` on my personal systems, `lange7` on a university system, or any of the random users I `sudo --` into on my server). For the same reason, I always need to know immediately what machine I'm connected to, but I don't need the full hostname (I know what machines are part of the ACM network and which are part of EWS, and which are mine, based on naming schemes). I use the clock because my panel is on auto-hide, so the quickest way to glance at the time is to look at the prompt, rather than having to move my mouse to show my panel. It's also good to see when a command ended.

Code:
function prompt_command {
    local RETURN_CODE="$?"
    local ASCII_RESET="\[\e[0m\]"
    local ASCII_BOLD="\[\e[1m\]"
    local USER_COLOR="\[\e[1;33m\]"
    local PROMPT_COLOR="\[\e[1;32m\]"
    if [[ ${EUID} == 0 ]] ; then
        PROMPT_COLOR="\[\e[1;31m\]"
    fi
    local HOST_COLOR="\[\e[1;32m\]"
    local DATE_COLOR="\[\e[1;31m\]"
    local TIME_COLOR="\[\e[1;34m\]"
    local DATE_STRING="\$(date +%m/%d)"
    local TIME_STRING="\$(date +%H:%M:%S)"
    local CYAN_COLOR="\[\e[1;36m\]"
    local PINK_COLOR="\[\e[1;35m\]"
    
    local PROMPT_PREFIX="$PROMPT_COLOR"
    if [[ $RETURN_CODE != 0 ]] ; then
        PROMPT_PREFIX="$DATE_COLOR$RETURN_CODE$ASCII_RESET " # do nothing
    fi
    local GIT_STATUS=`git status 2>/dev/null`
    if [[ $GIT_STATUS != "" ]] ; then
        local REFS=$(git symbolic-ref HEAD 2>/dev/null)
        REFS="${REFS#refs/heads/}"
        if [[ `echo $GIT_STATUS | grep "modified:"` != "" ]] ; then
            REFS="$REFS$ASCII_RESET ${PINK_COLOR}modified"
        fi
        if [[ `echo $GIT_STATUS | grep "ahead of"` != "" ]] ; then
            REFS="$REFS$ASCII_RESET ${CYAN_COLOR}not pushed"
        fi 
        PROMPT_PREFIX="$PROMPT_PREFIX$USER_COLOR$REFS$ASCII_RESET "
    fi
    
    
    PS1="$ASCII_BOLD[$USER_COLOR\u $HOST_COLOR\h $DATE_COLOR$DATE_STRING $TIME_COLOR$TIME_STRING $PROMPT_PREFIX$ASCII_RESET\w$ASCII_BOLD]$ASCII_RESET\n$PROMPT_COLOR\\\$$ASCII_RESET "
}
export PROMPT_COMMAND=prompt_command



Discuss this news post here.
(No comments)

JAPN199 Canceled

Makes me sad [:(]. The Japanese department was unable to find a TA for the course, so it's been canceled. This shouldn't affect my study-abroad trip, but it does mean I'll have to resort to pure personal study ie., through Rosetta Stone and online tools. I was looking forward to the class...

Reddit AMA?

Going to try to get Sam and whoever else is still working to do an AMA on Reddit. Why? idunno, I'm a bit bored at the moment, not much to work on.

If we do, we'll be using the account IAmACompizDev.

Just an idea though.


Discuss this news post here.
(No comments)

Been a While - Yet More Compiz Headtracking

Okay, so there are still some issues with the old code in the repo, but that aside, I've gotten things running on my desktop now.



(If you are coming from the Compiz Planet, please click the Discuss link down below to see the videos)

Specs are in the video description.
I'm going to try to clean everything up and do a more professional video when I get it in top-notch shape, but the basics are working. I've also discovered that it looks terrible with two displays, so I've got some tweaking to do to fix that.

e: I see I've been reddit'd. Yes, I'm the `klange` posting in the comments. I guess a better explanation is in order!
All of the tracking seen here is done with a webcam video feed. OpenCV (Intel's computer vision library) detects the location of my face in the webcam feed using HAAR detection. This then gets run through some trig to get the final location of the head. The current code base does not detect distance to face, so it's not perfect (this is why I'm picking up the code again). The hardware I used isn't special in anyway. Any laptop with a webcam can do this - the original videos we have from a year ago were recorded on a Dell netbook with a 1.3MP camera. There is no head-attached tracking hardware, it just detects your face (specifically, your eyes).

e: And since someone always ends up asking, the code is right here. The update I just made recently removes depth-perception, primarily because it didn't work with the code I was using. I'll add it back in once it's working again.


Discuss this news post here.
(No comments)

Working on a new template

It's ugly and unrefined right now as I'm still working on it, but give me time and I'll get it worked out and finished up.

Forum Threads Out of Order

The forum threads are misordered because of a recent spam attack (also because of a flaw in the way I wrote the ordering system). Sorry about that. I cleared up the spam, but the forums won't be in the right order until people start posting in them (right, like that's going to happen, ha!).


Discuss this news post here.
(No comments)

Internet...

... The Final Frontier.
These are the voyages of the website Omegle.
Her ongoing mission: To explore strange new people.
To seek out new strangers and new conversations.
To boldly chat where no one has chatted before.

Look familiar?

forum image

e: Someone posted this on the Ubuntu Forums, and I finally found it and responded. Here's an excerpt from said reply that will hopefully shed a bit more light on what happened here:

Where do we begin... I guess I'll give an overview of the real story:
Back in December of 2007 I saw the famed Wii Remote head-tracking video by Johnny Lee. It was awesome, and I popped into #compiz-dev as I usually did back then and said "I'm porting this to Compiz". I didn't have a wii remote at the time, but SmSpillaz (Sam, a fellow Compiz developer, and now one of the head guys for community management two years later) did, so I wrote up the code, which took a few weeks of poking around with other plugins. This was my first functional plugin for Compiz. Eventually, we got it working and SmSpillaz recorded what is one of the worst video demos ever. This is all in January-February of 2008. A few months later, Apple files this patent. Two months after that, with the help of a forum-goer / programmer, we had it ported to a webcam with OpenCV using the OpenCV facetracking demo. It worked great, and we have videos of it in action, clearly doing its job. Eventually, I got a system with a webcam (yeah, finally, I can use my own plugin!) and recorded the last video we ever took of the thing, and that was it. It's been idle since February of this year. Eventually I moved to another (completely unrelated) community and my Compiz work was a good conversation piece. A few days / weeks before the patent went public, one of my friends on this community was rather obsessed with my work (...), and the day before this news release came out I took the time to get everything squared away to continue work and try and get my tutorials fixed up so they could actually use it. I did a git-pull that night. Now, like any other Internet denizen, I read a lot of Gizmodo / Engadget / what have you, and as with any other morning I made the rounds. And found this news article. And I got pissed. You see, I'm mildly bi-polar, and I'm a bit cranky in the morning to begin with, so this definitely isn't helpful. The blog post the OP linked was what resulted from an entire day of link hunting, after blowing off steam at a chemistry final (which I got a B on, and this probably didn't help that, but you won't see me contacting my college about it any time soon).


Well... That looks... oddly familiar. I could swear I've seen this before.

The patent was filed in June of 2008, while the last commits to our original prototype were made on "2008-02-11" (that's February 11th in this date scheme) ~ We have videos from the same year of the Wiimote prototype. The entire thing was working on a Wiimote in January of '08. I do believe I win for prior art (though the webcam-enabled version wasn't out until seven months later, two months after the patent). More specific window-stacking video from September of '08. And more importantly this video from February of '08 proves our prior art.

The article on MacRumours.

e: After reading and verifying, the way the patent describes the "sensing mechanism" leaves it open to the infrared camera and light setup of the Wii remote, so our original plugin should fully suffice, and we have video footage of it in action long before Apple filed the patent.


Discuss this news post here.
(No comments)

DNS Tunneling Stuff

Finally posting this, but here you can find my package of OzymanDNS, which includes the standard server and client, my personal client, as well as the startup script for the server and my "pytun" bash shortcut script.

To set it up, throw `dns` in /usr/lib/python2.5/site-packages/ on your client, through sshns into your home directory on the server and your client, put dnstunserv in your home on your server and pytun in your home on your client. Change sshns/droute.py so that the "extension" variable is set to your subdomain (with the sshns. included at that start) and change dnstunserv so that "tun.EXAMPLE.COM" is replaced with your domain, then run the server as root and run the client as a normal user.


Discuss this news post here.
(No comments)
Navigation
Home
Admin
Mobile
RSS
Forum
Image Gallery
Calendar
Upcoming Events:
Today:
Tomorrow:
Wednesday:
Thursday:
Friday:

Forums
Active Topics:
You got your SOCKS i...
in FLOSS
My New Bash Prompt
in Compiz
Reddit AMA?
in Compiz
Been a While - Yet M...
in Compiz
Forum Threads Out of...
in Uncategorized

Twitter
Recent Tweets:
mmm, dictionaries
about 2 hours ago from web

@sleepyyukari what graphics chipset you running?
about 4 hours ago from web

Yay: Out for Delivery or Available at PO Box, February 08, 2010, 8:23 am, URBANA, IL 61802
about 4 hours ago from web

I can't take the translation abuse any more... I'm going to bed.
about 18 hours ago from web

@sleepyyukari Ubuntu is the universal starting point.
1 day ago from web



(C) 2010 Kevin Lange
This page executed in 2.46200704575 seconds.