2008-08-01

[Java Sparrow]

My favorite bird of Hawaii. These little guys are populous and have a fun personality. They gather in small groups of 5-20 birds and feed on the ground in the grass or at feeders. They have big white patches on their cheeks and they make a "chippering" sounds as they communicate with each other. They are very social and competitive, arguing fiercely over food if it is found in a feeder. When feeding in the wild on grasses, they are cooperative and will not fight over their food.

They are more trusting of humans than Myna birds, but not very much. I had a feeder and they would allow me to view them from a few feet away.

[Red Crested Cardinal]

These birds look like they are wearing a red hood. They are social birds that can be seen in pairs almost anywhere in Hawaii. They move quickly, darting like road runners across the ground looking for food. In the morning and in the evening, their song is a four-part song: chirp, chireeirp (or cheeryup), churp, choo. It is relaxing and pleasing to hear like the Zebra Dove. During the day, they use only one or two of the song parts in general.

These birds are more aggressive than the Zebra Dove, and they will swoop in and grab food that is very close to a person but I have not seen them eat out of a person's hand. When their colors are strong, they are very beautiful birds, and their heads look like flames leaping out of the grass.
[Myna]

Myna birds are populous in Hawaii. There are literally thousands and thousands of them, and most people consider them a pest, but I love them. They are very gregarious, and they make noise from sunrise to sunset. They can be found in pairs or small groups, hopping around scavenging for food almost everywhere.

They are very funny birds to watch because of their mannerisms. I have found that they do not pay humans much attention unless the human attends to them. People can walk past them and they will just continue on their business, but if you stop to look at them, they will get nervous, give a small squeak and fly off. They are loud, calling to each other almost continuously with a wide vocabulary. Some people have even taught them to speak in captivity.

They are not the most beautiful bird, but they are one of my favorites because they are so entertaining. In the evening, they will gather in small groups to talk about the day. During these "conversations" they will often fluff their head feathers up and nod their heads toward the ground as if in agreement about the day's events.

Mynas will never let you feed them. If a mixed group of birds are feeding on pretzels or something like that and a person is near, the mynas will maintain a wide radius, waiting for the person to leave. Once the person moves away, the mynas will swoop in and bully the other birds out of the way, flying off with the choice pieces, screeching at each other the entire time.

[Zebra Dove]
Zebra doves are also quite populous in Hawaii. They can be found singly or in small groups of up to 10. If fed, they will cluster and gather into large groups of possibly 50. They are gentle birds, and very trusting of people, often to their own detriment because they get smashed by cars quite frequently. They have a lovely cooing song that is very pleasing and relaxing to hear. It is what a bird would sound like if they could purr like a cat.

Because they are so trusting of people, it is easy to get very close to them. I have fed them from my hand on several occasions. They are not aggressive, although they will have small competitions for food.

[Golden Plover (Kolea)]

One of the few migratory birds of Hawaii, they are beautiful birds that arrive on the islands in September and stay until April, when they leave to migrate to Alaska. They are generally silent and solitary birds, only crying when they are startled by another bird or a person. Each bird stakes out a piece of ground and feeds on grubs and other insects. They return to nearly the same ground every year.

They are amazing fliers, as evidenced by their yearly migration, but they prefer to feed on the ground and will not generally fly about unless they are startled.

One of the most amazing things about these birds is the transformation the males make before their departure for Alaska. In the weeks prior to their flight, the mature males' feathers in front turn pure black, and they look as though they are wearing a tuxedo. It is very dramatic. Birds of each sex fatten up prior to their departure and when it is time to depart, they circle upward several thousand feet and fly north at up to 50kph. The flight, depending on the path taken, takes about 90 hours.

[Tern]
These beautiful birds are not as common as some of the other birds in Hawaii. They can be found in pairs, and their pure white plumage is blinding when viewed in direct sunlight. I do not have much experience with these birds, although one time when I was out for a run, a pair of them flew and circled near me, swooping to the side of me. It seemed like they were "running" with me for a few blocks, and then they moved on. One of them flew for a couple seconds right next to me, and I could see into its eyes, which were mirror black.

This play behavior I have also noticed in other pairs. I have seen them riding the drafts between the tall buildings in Honolulu.

[Common Waxbill]

This tiny bird congregates in groups of 20-40 birds on the grass during the day. They are very tiny, one could fit in a shot glass. Their song is very high pitched squeaking which is funny to hear when they all fly off at once due to some fright. They are pretty to look at and sometimes have very bright red colors.

[White-Rumped Shama]

I have only seen this bird once when I heard a song I had not heard before and I waited to find the source. I saw this bird about 50 feet up in a tree, and it is the only time I have seen one.

[Japanese White-Eye (Mejiro)]

se tiny birds are sometimes difficult to find, but you can find them regularly if you know where to look. They can be found in small bushes near buildings and near the base of trees when they think no one is looking. The Mejiro is known as a nuisance bird in Japan, because they steal rice from the farmers there. They are small and skittish, hopping from branch to branch in search of food.

2008-03-02

iptables firewall

What firewall software do you use? I like to use iptables for my packet filtering needs. I maintain a list of ip addresses that have either earned their way onto that list by scanning me or by finding good blockable ip address lists online. I found such a list from a Phrack article the other day and I set about adding those addresses to my list.

My firewall consists of a bash script that adds the ip addresses to my drop list. The format for the rule is:

/sbin/iptables -I INPUT -s $IPADDRESS -j DROP

What this accomplishes is that if a packet originates from the source (-s) ip address destined for my computer, it will be dropped, no questions asked. This rule is only invoked if the outside computer attempts to initiate a connection with me. If I establish a connection with them, I am allowed to do it.

The ip addresses in the article are not summarized, that is, they are not in an easy notation for adding to my iptables file. For example, our friends over at the Defense Intelligence Agency have ip addresses in the range of 144.236.0.0 through 144.242.255.255. This equates to 144.236.0.0/14, 144.240.0.0/15, and 144.242.0.0/16.

I maintain my banned ip address list as a list of ip addresses, arranged as 1 ip address per line. I like to convert the list of ip addresses into a portable shell script that I can give to my friends so they can block the bad guys as well. This can be done on one line (depending on the size of window for your terminal) as shown here:

$ cat ip.lst | while read line; do echo "/sbin/iptables -I INPUT -s ${line} -j DROP"; done > out.sh

To make out.sh executable:

$ chmod a+x out.sh

and now the script can be run using root privileges. Enjoy.

2008-02-15

Cell Phones

I am offering you the ability to hold an electromagnetic transmitter to your head for 500 minutes per month. What? 500 minutes isn't enough?!1 You say you want to hold an electromagnetic transmitter to your head for UNLIMITED minutes each month? Heh heh. Be my guest, just make sure you pay me $100 per month for the privilege! Don't worry, the transmitter has flashy colors, just like you like them. There there, you go talk to your friends.

An article on Information Week today highlighted an increased risk of a type of cancer for frequent cell phone users. I am known as a bit of a crackpot when it comes to cell phones. I don't talk on one unless I absolutely have to as part of my job, and if I am on a call, I will minimize the time I am on as much as possible. If I am sitting at my desk and my cell phone rings, I may not answer if I can see the caller ID and immediately ring them back from my desk phone. If I do answer, I will find a land line phone nearby and try to end the call and call the person back. I aim for less than 1 minute at a time on the cell phone. If I am sitting down and I don't need to have my phone clipped to my waist, it goes on the other side of my desk or in a metal drawer so I don't get residual radiation. Crazy, right? I used to own a cell phone, then I quit, now I have one for my job as a government employee. When I am done with this job, I will not take a job that requires me to carry a cell phone, much less converse regularly on one. I don't need a study to tell me that cell phones are dangerous to your body, my reasons are based on science and common sense.

Cell phones are an electromagnetic transmitter. They radiate information via an omnidirectional antenna which means that when you talk on one, your brain is directly in the path of that radiation. Three variables govern the effect of radiation on living organisms, they are: time, distance, and shielding. The goal is to maximize distance and shielding, while minimizing time. Shielding counts when an object that does not permit electromagnetic radiation (i.e. lead) from passing through is placed between you and the transmitter. Unless you wear a lead hat, much of that radiation is passing right through your skull and into your brain. Distance speaks to the space between the source of radiation and the living organism. Talking on a cell phone places the transmitter and receiver is places as close as it can get to the most critical body organ you have, your brain. Time refers to the duration of exposure to radiation. Judging by the people I know who use cell phones, time is generally maximized whenever practicable. Cell phones, therefore, maximize time, and minimize distance and shielding.

Even when the cell phone is not actively being used for a call, it is still radiating, maintaining contact with the cell phone towers to ensure constant connectivity. While it is doing so, it is usually located next to another highly critical portion of the body, the waist area, if you catch my meaning. If you don't think cell phones emit much radiation, you are correct, the level is relatively low, but it is the cumulative effect of all of that radiation on your cells that is debilitating. Once cigarette won't kill you either, but smoke a pack a day for a few years and see how you are doing. If you like, put your cell phone near your computer speakers your radio and you can hear the radiation when you make or receive a call as interference on your speakers.

Overexposure to radiation of any type is dangerous and cell phones are no exception to this rule. Radiation has a distinctly negative effect on the human body, but because you cannot taste, see, hear, or even feel it, its effects often ignored and are not noticeable until it is too late. Overzealous sunbathers can feel the short-term effects of overexposure in the form of a sunburn, and in the long term, as an increased risk of skin cancer. Nuclear workers can find themselves at increased risk for cancer if their exposure to nuclear radiation in the form of radioactive decay is not strictly regulated. Cell phone radiation different in terms of the frequencies involved, but it is included in electromagnetic spectrum just like sunlight and radioactive nuclear decay.

As a staunch libertarian, I will not tell you that you cannot use your cell phone all you want, nor should legislation be passed to restrict their use in any way. I won't use one, and if you think about it, neither should you, not unless you have to.

2008-02-05

One way to save youtube videos.

[MOTIVATION]

There are some very cool videos on youtube such as some of the old Mystery Science Theater 3000 (MST3K) videos. Long videos like these are broken up into manageable slices, sometimes as much as 10 parts. It would be nice to save not just the parts of these videos, but to put them back together into one playable movie.

[ASSUMPTIONS]

For this project, as with most of my projects, I will assume a Ubuntu- or Debian-based Linux distribution and that you are familiar with the command line.

[REQUIREMENTS]

For this project, you will need to obtain the following software:


  • ffmpeg

  • youtube-dl

  • cat

  • Python



To get ffmpeg, run the following command:

 $ sudo apt-get install ffmpeg 


The cat command should be installed already on your system. To verify, try this:

 $ which cat 


If you see output that looks something like: /bin/cat then you are all set.

The youtube video downloader is a Python script that takes as input a link to a youtube video. Get the script here. The youtube video downloader depends on Python, so make sure you install the Python language.

 $ sudo apt-get install python 


[METHOD]

First, head over to youtube and do a search for Santa Claus Conquers the Martians. This video was broken into 10 parts, and it is one hilarious movie, a true MST3K classic. Find the link to part 1, and right-click to copy the link location. Next, go to the directory where the youtube-dl script is located. First, ensure that the script is executable:

 $ chmod a+x youtube-dl 


Next, execute the following command to begin the download:

 $ ./youtube-dl <videoLink> 


To paste in a link on your terminal (I use gnome-terminal), there are a couple methods you can use. First, you can try doing CTRL+SHIFT+V to paste in the previously copied link. You can also use your mouse. Clicking both the left and right mouse buttons simultaneously will paste whatever you had copied into the terminal. Alternatively, pressing down on the scroll wheel of your mouse will usuall work.

The download should begin, and it will download the video file as a .flv file. This file is not that useful, because it is a flash-formatted file, which can be played using the vlc player, but we want a more platform-indpendent format like .mpg for this project.

Assuming that your flash file is named Flash6xui2, use ffmpeg to convert this file into a .mpg file like this:

 $ ffmpeg -i Flash6xui2 -o part1.mpg 


This step may take a while (and most of your cpu resources) to complete, so be patient and you will be rewarded with a file called part1.mpg which is the mpeg encoded first part of the movie. In the meantime, you can move on to the next part of the movie using the steps described above. Paste the youtube link to part two of the movie into your terminal like you did for part one and so on until you have all of the flash-based videos downloaded. Be careful not to confuse yourself by downloading all the flash-based videos first before convering them. This is because the .flv files may have confusing names (something like FlashJWEse552xa), and you need to know the order of the files for the combining step. So, your pattern should be:


  1. Download flash-based movie part.

  2. Convert it to .mpg using a predictable naming convention so you know which part is which.

  3. Repeat until all parts are downloaded



When complete, you should have in your directory something like 10 movie parts. Perhaps your directory looks something like this:

 $ ls

part1.mpg part2.mpg part3.mpg part4.mpg part5.mpg part6.mpg part7.mpg part8.mpg part9.mpg part10.mpg


You may also have the original flash files in there, but they are not really needed at this point. Save them anyway, for now, and delete them once you are sure all is well so you do not have to download them again.

Finally, you have all the files you need to build your movie. The cat program is a wonderful little utility that has as one of its attributes the ability to combine files.

Implement the cat command as follows:

 $ cat part1.mpg part2.mpg part3.mpg part4.mpg part5.mpg part6.mpg part7.mpg part8.mpg part9.mpg part10.mpg >  movie.mpg 


This step will combine each of the smaller parts into one seamless movie. Now you can use mplayer, xine, or even put the movie on removable media for transport to a Windows machine.

[PROBLEMS?]
Let's say the youtube-dl script does not work for you, or you are too scared to use it for some reason. You're not too scared, are you? You can still accomplish this task, but it may be more confusing than what I have already described.

Go to youtube and start the video you would like to save. You can pause it once it starts playing and it will continue to buffer. On Linux systems, the flash file buffers in the /tmp directory. Change directories to the /tmp directory and list the files there.

 $ cd /tmp && ls 


You may see a file in there (you may see very many files in there, because the /tmp directory is the scratchpad of the file system) named something like Flash8xsk2IJWEE. It will be the video file in flash format. Wait until the file finishes buffering in your youtube window, then you can execute the ffmpeg steps as described above.

sBosell

2008-01-24

Using Google for File Sharing

Disclaimer: I am not responsible for how you use this information. I didn't even create this information, but it is there nonetheless.

2008-01-21

Screen Scraping With BeautifulSoup

This is an article on how to screen scrape the Astronomy Picture of the Day. The script is written in the Python programming language and depends on the BeautifulSoup module.

The Astronomy Picture of the Day is a nifty little service of NASA that publishes a nice space-related picture each day. They have something like 9 years worth of pictures that you can download, which I will discuss in a future post. Let's focus on scraping out one picture at a time, and automating that process so you can save your pointing and clicking for another place and time.

The site for the picture of the day is here. If you click the picture it will give you the full-sized version, which is the one we want. While you are on that page, make sure to view the source html of the page, because we will use it in this project. Shown below is a picture of the source html to be used for scraping.



The source code for the scraper is shown here:


#!/usr/bin/python
from BeautifulSoup import BeautifulSoup
import urllib2, os, re
from urlparse import urljoin

url='http://apod.nasa.gov/apod/astropix.html'

baseUrl='http://apod.nasa.gov/apod/'

html=urllib2.urlopen(url).read()
soup=BeautifulSoup(html)

image=soup.find('a', href=re.compile('^image'))
imageLink=urljoin(baseUrl, image['href'])

os.system("wget -P <dir>/apod/2008 --quiet -U Mozilla/5.0 " + imageLink)