Tuesday, July 03, 2012

LaTeX on Debian

I'm finishing up a BS degree this month by writing two papers for a capstone project. The papers need to be submitted in APA style, so I thought (gearing up for Grad school) that I should use LaTeX and BibTex.

I've used these tools before, but it was a few years ago on a laptop that has since passed on, and I forgot the quirks of setting up the LaTeX build environment. However, Debian has an *awesome* package manager, and I thought it would be one or two simple commands to get all the tools and components installed so I could jump in with vi or Geany.

This was almost, but not quite, the case.

For those who follow after, if you're trying to use APA formatting (manual or journal) for the body of the document and APA citation style for inline citations and the bibliography, you'll probably not be ready-to-go right out of the box after running installing texlive-kitchensink*. Unless you're on unstable or testing. Then you'll have all the software you could possibly want, as fresh as you probably want it, and everything will (mostly) just work.

I'm on Debian Stable, though, and eventually determined that the apa template and apacite style weren't available in the Stable repositories. Fortunately, switching from Stable to Testing is a simple matter of changing a line in /etc/apt/sources.list and running apt-get update.

After switching repositories to unstable, getting the requisite extensions really was a simple matter of running

apt-get install texlive texlive-latex-extra texlive-publishers texlive-bibtex-extra

And everything was installed. I love this system.

PS: Don't forget to switch your repositories back.
PPS: Yes, I use sudo. You should too, if you're on Linux or FreeBSD.
* Not an actual package.

Tuesday, April 27, 2010

Update MAC Address<-->Manufacturer Tables

If you've ever used nmap or arpwatch, you've probably experienced the forensic benefit of correlating a MAC broadcast address to the manufacturer of the broadcasting NIC. If you've even encountered a manufacturer labeled "Unknown" with either of the above sniffers, this post is for you.

We installed arpwatch on our network late last week and discovered that the MAC<->Manufacturer table was a few years out of date. We were able to convert nmap's table to arpwatch's format, but still ended up with a slightly-out-of-date table.

The following script gets the current data from IEEE and formats it for nmap and arpwatch:

# update_mac_addresses.sh
# This script downloads the currect mac address data from the IEEE and parses it for nmap and arpwatch.
# nmap-mac-prefixes is for nmap.
# ethercodes.dat is arpwatch.

# Download the current data

wget http://standards.ieee.org/regauth/oui/oui.txt

# Divide the data into Manufacturer and Address files
cat oui.txt | grep '(base 16)' | cut -f3 > mac.manufacturer
cat oui.txt | grep '(base 16)' | cut -f1 -d' ' > mac.address

# Paste them back together for nmap data

paste mac.address mac.manufacturer > nmap-mac-prefixes

# Parse the address data for arpwatch
cat mac.address | perl -pe 's/^(([^0].)|0(.))(([^0].)|0(.))(([^0].)|0(.))/\2\3:\5\6:\8\9/' > tmp.address
cat tmp.address | tr [A-Z] [a-z] > mac.address

# Paste the parsed data into the arpwatch file
paste mac.address mac.manufacturer > ethercodes.dat

# Clean up intermediary files
rm tmp.address
rm mac.address
rm mac.manufacturer
rm oui.txt

Credit to Jonathan C. for the perl regex.


If the resulting nmap file (nmap-mac-prefixes) is installed, nmap will not run successfully. If you've already copied the nmap data file, you'll have to roll back to the data file installed with nmap.

Sunday, June 14, 2009

Firewall Fun Fact

The internet filtering we experience here is sometimes odd and unpredictable. There are two primary filtering mechanisms: a "blacklist" of specifically prohibited sites (such as www.youtube.com, *.blogspot.com, *.wordpress.com, etc); and a "URL filter" - any web address that contains a prohibited term, such as (for the sake of illustration) "pen". The party in charge doesn't make either of their lists public, and both lists are subject to unannounced change. One recent change, for example, was the addition of *.blogspot.com to the blacklist.

From what I can tell, the affect of trying to visit site on the "blacklist" results in nothing more than the site failing to load.The effect of trying to visit a web address that contains a prohibited term, though, is that your internet access is suspended for one or two minutes. You can tell which filter you've run into by the affect it has on your browsing experience.

That's the background for this afternoon's google search.

When you type a term into the google search box and hit enter, google loads the "search results" page- which contains in its address the term searched for. The search results page (and www.google.com) is not on the "blacklist," but because of the way Google dynamically generates search results, any terms you search for will still be subject to the URL filter. Consequently, you can occasionally discern what hot-button terms you're not allowed to google for.

Today's secret word is "triangle."

Wednesday, June 10, 2009

Joke of the Day

Question: "What happens when a Chinese person turns around in circle many many times?"

Answer: "They become disoriented!"

Wally's Answer: "That's stupid."

Wally's great. He has a good sense of humor.

Sunday, June 07, 2009

Chinese Haircut

In many Asian countries, getting one's hair cut is more than just a trim with scissors or a clippers. It almost always begins with getting your hair washed, and frequently includes a head and neck massage, an arm massage, and sometimes also an upper-back massage and/or an ear cleaning.

I experienced this Saturday night. Shannon and I went out to a different part of the city (the Xia Li Pu district, for future travelers) for dinner and to look at shops, and we went to a typical Chinese hair care shop. It seems more similar to an American salon then to a traditional barbershop, probably because of the washing and styling equipment. Shannon had been there earlier in the week with some friends, so the staff recognized us when we walked in. Talking through a telephone translator, we told them that I wanted a hair cut with "the works."

I got my hair washed, a scalp/neck/arm/upper back massage, my ears cleaning, my hair cut, and my hair washed again. I think the whole process took about 45 minutes, for a total cost of 40 RMB.*

It's going to be hard to go back to SuperCuts.

* The current exchange rate is about 6.85 RMB per USD, so 40 RMB works out to about $5.84.

Wednesday, June 03, 2009

Quick Notes

1. My blog is blocked! Due to the significance of today's date in Chinese history, internet filtering has been increasing for the past week or so. Many sites have been added to the "blocked" category, primarily those sites which host user-gerenated content, such as youtube, wordpress, and blogspot. I usually post to this blog via email so I think this update will show up, but since I can't view it directly I won't know for sure.

2. Our water got fixed! In a recent post (The most recent one, I think) I mentioned that we were without water. It's back now. We don't really know why it was out.

3. It's been raining! The past three days have been very wet. I think it's seasonal.

4. Our time here is drawing to a close. We plan on leaving in just under two months.  :-(

5. The school and CTI China are both recruiting new teachers so if you're interested in teaching English, working with children, seeing a new culture, or getting first-hand information about life in China, let me know!

Friday, May 29, 2009

Our water is out!

Last night, as Shannon was leaving for work, we found out that the faucet in our bathroom sink wasn't giving us any water. And neither was the faucet in the Kitchen sink. And the toilet wasn't flushing.

This was a bit disconcerting.

Evidently, the column that our apartment is in is having problems with water supply. The maintenance man worked on it last night, but as of this morning it's still out.

We can't wash dishes until the water comes back*, so this means takeout for lunch!

* Depending on how long the water is out, we'll figure out a way to wash dishes.

Saturday, May 23, 2009

Wednesday, May 06, 2009


The school we're teaching at is actively recruiting English teachers for the 2009-2010 school year.

Wednesday, April 22, 2009

Spring in Wenzhou

Spring has come to Wenzhou!

Winter clothes are boxed up in preparation for shipping them home, long-sleeve shirts are on hangers in the back of the closet, and a sweatshirt (for emergencies) is hanging by the door. It's Springtime!

It's been getting steadily warmer for the past few weeks, with last week finally being consistently warm enough to feel "springy". It's nice.

Flowers are blooming, the trees are bright green, and we can frequently hear birds while we're out and about.

It's nice.