Left Brain
Sphider: a FOSS search engine
by Seth Keiper on Jul.27, 2009, under Coding and Programming, Left Brain, MySQL, Overall, PHP
Of course, you could just write your own spider/search engine. Not overly complex nor deeply involved. But what if you need it *now*?
Enter in Sphider. Sphider is a lightweight web spider and search engine written in PHP, using MySQL as its back end database. Also the html is templatable. And kicker: it is free and open source under the GPL license.
How to set this screaming application up? Very simple instructions for GNU/Linux:
- wget http://www.sphider.eu/sphider-1.3.4.zip
- unzip sphider-1.3.4.zip
- mv sphider-1.3.4/ search/
- edit the file: search/settings/database.php to use your database credentials and in mysql console, run: CREATE DATABASE `sphider`;
- So the config file is writable: chmod 666 search/settings/conf.php
- As a personal touch, I like to do: ln -s search/search.php search/index.php
- You will need to edit the username and password defaults in search/admin/auth.php on lines 3 and 4, respectively.
- Then in your favorite web browser, point to: http://yoursite.com/search/admin/install.php. This creates the SQL tables for the sphider database.
- Follow the link to: http://yoursite.com/search/admin/admin.php.
- Log in with your credentials.
- Select the Settings tab.
-
Some of the key items to change on this are:
- Administrator e-mail address
- Temporary directory (this will need to be writable if you are not running under the www-data user)
-
Indexing settings:
-
PDF:
- Check the Index PDF files
- Input /usr/bin/pdftotext for Full executable path to PDF converter (check if you have this by doing: which pdftotext
-
Microsoft DOC:
- Check the Index DOC files
- Input /usr/bin/catdoc for Full executable path to catdoc converter (check if you have this by doing: which catdoc
-
XLS:
- Check the Index XLS files
- Input /usr/bin/xls2csv for Full executable path to XLS converter (check if you have this by doing: which xls2csv
-
PPT:
- Check the Index PPT files
- Input /usr/bin/catppt for Full executable path to PPT converter (check if you have this by doing: which catppt
-
PDF:
- Change the User agent string to your own desired setting. Most of the time, I set this to the domain name or landing URL for people who see your search engine in their logs.
- Do not forget to select the Save settings submit button
- Select the Index tab
- Input your site's domain name. Remember, www.yoursite.com is not the same as subdomain.yoursite.com. Both have to be indexed separately.
- Full indices seem to be the best, so I use that, personally.
- Start Indexing!
- Now you have a search engine that you can templatize. Take the search form and put it anywhere on your site or include it through php's include() for ever page.
- More information is available for sphider in their documentation.
Nine hundred billion dollars.
by Seth Keiper on Feb.06, 2009, under Overall, Rantings
Nine hundred billion dollars. This is the rough amount for this year's (2009) stimulus bill. To put this into perspective, imagine since the beginning of the Common Era (not counting leap years), that there was one million USD spent for every day of those years, 365 days a year, until 2009. That would be roughly 733,285 days. Now, multiply that by one million USD and you would get: $733,285,000,000 (USD). A lot of money to hand out, especially when there are programs it would be funding that reek of pork:
- $246 million tax break for Hollywood movie producers to buy motion picture film.
- $650 million for the digital television converter box coupon program.
- $2.5 million in hard-earned taxpayer money for a "Waterfront Duck Pond Park" in Hercules, California.
- $200,000 for a dog park in Hercules, California.
- $2 billion earmark to re-start FutureGen, a near-zero emissions coal power plant in Illinois that the Department of Energy defunded last year because it said the project was inefficient.
- $88 million for the Coast Guard to design a new polar icebreaker (arctic ship).
- $448 million for constructing the Department of Homeland Security headquarters.
- $248 million for furniture at the new Homeland Security headquarters.
- $600 million to buy hybrid vehicles for federal employees.
- $400 million for the Centers for Disease Control to screen and prevent STD's.
- $1.4 billion for rural waste disposal programs.
- $125 million for the Washington sewer system.
- $150 million for Smithsonian museum facilities.
- $1 billion for the 2010 Census, which has a projected cost overrun of $3 billion.
- $75 million for "smoking cessation activities."
- $200 million for public computer centers at community colleges.
- $75 million for salaries of employees at the FBI.
- $25 million for tribal alcohol and substance abuse reduction.
- $10 million to inspect canals in urban areas.
- $6 billion to turn federal buildings into "green" buildings.
- $500 million for state and local fire stations.
- $650 million for wildland fire management on forest service lands.
- $1.2 billion for "youth activities," including youth summer job programs.
- $88 million for renovating the headquarters of the Public Health Service.
- $412 million for CDC buildings and property.
- $500 million for building and repairing National Institutes of Health facilities in Bethesda, Maryland.
- $160 million for "paid volunteers" at the Corporation for National and Community Service.
- $5.5 million for "energy efficiency initiatives" at the Department of Veterans Affairs National Cemetery Administration.
- $850 million for Amtrak.
- $100 million for reducing the hazard of lead-based paint.
- $75 million to construct a "security training" facility for State Department Security officers when they can be trained at existing facilities of other agencies.
- $110 million to the Farm Service Agency to upgrade computer systems.
- $200 million in funding for the lease of alternative energy vehicles for use on military installations
- $15 million for the Midway Park Family Life Center in Euless, Texas, which, you'll be glad to note, includes both a senior center and aquatic facility.
- $9.5 million for a new sports complex is "needed" by Natchez, Mississippi "which would allow our city to host major regional and national sports tournaments."
- $20 million to help "develop a 60 acre multi-use sports field complex" in Henderson, Nevada
- $15 million for a sports park in Brigham City, Utah.
- $4 million to expand its tennis center in Arlington, Texas.
- $15 million for a "Moore Park Community Center, Tennis Center and Day Care" facility in Miami, Florida.
- $3.6 million to build a covered basketball court and a new tennis court at Robert King High Park, Miami, Florida.
- $94 million for the Orange Bowl parking garage, Miami, Florida.
- $7.6 million for a "Life Style Center" in La Porte, Texas.
- $1 million for Fruitvale Latino Cultural and Performing Arts Center in Oakland, California.
Some of these projects make sense in a stable, growing economy. But,... in these times of economic troubles (with more news of 598,000 jobs being cut in January 2009), are any of these purposed projects sane? Did they really just request $246 million tax break for Hollywood movie producers to buy motion picture films? Does US taxpayers need to be spending their taxes on these items? We are officially in a recession and not sure where all of these projects fit in. All in all... most (not all) is pork.
In the words of Bill Hicks
by Seth Keiper on Feb.02, 2009, under Ethics, Left Brain, Overall, Rantings
The world is like a ride at an amusement park. And when you choose to go on it, you think that it's real because that's how powerful our minds are. And the ride goes up and down and round and round. It has thrills and chills, and it's very brightly coloured, and it's very loud and it's fun, for a while. Some people have been on the ride for a long time, and they begin to question - is this real, or is this just a ride? And other people have remembered, and they come back to us. They say 'Hey! Don't worry, don't be afraid, ever, because, this is just a ride.' And we...kill those people. Ha ha ha. 'Shut him up! We have a lot invested in this ride. SHUT HIM UP! Look at my furrows of worry. Look at my big bank account and family. This just has to be real.' It's just a ride. But we always kill those good guys who try and tell us that, you ever notice that? And let the demons run amok. But it doesn't matter because: it's just a ride. And we can change it anytime we want. It's only a choice. No effort, no work, no job, no savings, and money. A choice, right now, between fear and love. The eyes of fear want you to put bigger locks on your doors, buy guns, close yourselves off. The eyes of love, instead, see all of us as one. Here's what you can do to change the world, right now, to a better ride. Take all that money that we spend on weapons and defence each year, and instead spend it feeding, clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, for ever, in peace.
VirtualBox Port Forwarding with Windows Host
by Seth Keiper on Aug.17, 2008, under VirtualBox, Virtualization
The first of many ways to handle VirtualBox's virtualization is to Port Forward. Make sure you have the latest of VirtualBox. This allows a person to connect to the virtual machine directly through SSH or view the web server through a browser. Basically, we have the host machine (your actual computer's Operating System) and your guest machine (your virtual machine). This is the Microsoft Windows how to. Here is the GNU/Linux version.
First, you need to go to start menu > run > type in cmd.exe
Then type in the windows host's terminal application:
cd C:\"Program Files"\Sun\"xVM VirtualBox"\
And hit the enter key.
In your windows host's terminal application, run the following commands:
VBoxManage.exe setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage.exe setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage.exe setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
Before running those commands, replace the following with your personal settings:
- Replace "name of vm" with your virtual machine
- Replace ssh with the preferred name you want. This is _required_ to be unique among the three commands.
- Replace 2222, 22, TCP respectively with your desired host port, guest port, and protocol.
I use port 2222 for the host in this example so it will not conflict on most configurations. This can be replaced with any port setup you desire:
- Apache (port 80)
- MYSQL (port 3306 [Update: requires both TCP and UDP])
- Any many more possibilities
One important note is to make sure you restart all VirtualBox applications (ie. the virtual machine, VirtualBox GUI, all of it). This allows the settings to be used properly.
Once this is done and your virtual machine is restarted, run these commands to verify:
VBoxManage.exe getextradata "name of vm" enumerate
And/or
ssh -l user_name -p 2222 localhost
If you want to clear the virtual machine settings, run this ( Only use this command if you want to clear the settings for this! ):
VBoxManage.exe setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort"
VBoxManage.exe setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort"
VBoxManage.exe setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol"
Enjoy
Standards Based Flash for XHTML or HTML
by Seth Keiper on Mar.08, 2008, under (x)HTML
After wondering about this for a few days, I have seen places on the web attempt this. Surely, it must be possible to do and at the same be cross-browser compatible. Well, the following method works in both IE, FF, Opera, and Safari. Also, this method is valid in HTML 4.01 Strict and valid in all the XHTML doctypes (even XHTML 1.1). If you report otherwise, please inform me with your operating system, browser and version. Here is the workable method:
XHTML:
<object type="application/x-shockwave-flash" data="http://yourwebsite.com/and/flash/file/or/youtube/or/something/" width="425" height="355">
<param name="movie" value="http://yourwebsite.com/and/flash/file/or/youtube/or/something/" />
</object>
HTML:
<object type="application/x-shockwave-flash" data="http://yourwebsite.com/and/flash/file/or/youtube/or/something/" width="425" height="355">
<param name="movie" value="http://yourwebsite.com/and/flash/file/or/youtube/or/something/">
</object>
Again, please inform me if this does not work in your browser!
VirtualBox Port Forwarding with Linux Host
by Seth Keiper on Jan.05, 2008, under VirtualBox, Virtualization
The first of many ways to handle VirtualBox's virtualization is to Port Forward. Make sure you have the latest of VirtualBox. This allows a person to connect to the virtual machine directly through SSH or view the web server through a browser. Basically, we have the host machine (your actual computer's Operating System) and your guest machine (your virtual machine). So far, this is only for GNU/Linux host how to. Later the windows host how to will be added. Here is the Microsoft Windows how to.
In your GNU/Linux host's terminal application, run the following commands (Warning: make sure the quotes are proper quotes due to this CMS' protection from quotes Update: this quotation issue has been fixed the quotes you see should work):
VBoxManage setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
Before running those commands, replace the following with your personal settings:
- Replace "name of vm" with your virtual machine
- Replace ssh with the preferred name you want. This is _required_ to be unique among the three commands.
- Replace 2222, 22, TCP respectively with your desired host port, guest port, and protocol.
I use port 2222 for the host in this example so it will not conflict on most configurations. This can be replaced with any port setup you desire:
- Apache (port 80)
- MYSQL (port 3306 [Update: requires both TCP and UDP])
- Any many more possibilities
One important note is to make sure you restart all VirtualBox applications (ie. the virtual machine, VirtualBox GUI, all of it). This allows the settings to be used properly.
Once this is done and your virtual machine is restarted, run these commands to verify:
VBoxManage getextradata "name of vm" enumerate
And/or
ssh -l user_name -p 2222 localhost
If you want to clear the virtual machine settings, run this ( Only use this command if you want to clear the settings for this! ):
VBoxManage setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort"
VBoxManage setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort"
VBoxManage setextradata "name of vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol"
Enjoy
And then… a slap in the face…
by Seth Keiper on Mar.23, 2007, under Ethics, Military, Rantings
Our nation's top military officer, a veteran decorated with no less than forty-eight military awards and a very distinguished career, made a startling revelation this week: He has moral conviction. The world gasps, hurls insults, and demands an apology. How dare one of the top leaders of our land have a moral belief and share it when questioned!
But that's exactly what happened this week when the Chairman of the Joint Chiefs of Staff - the first Marine general ever to hold that position - General Peter Pace, commented in a wide-ranging interview with the Chicago Tribune, "My upbringing is such that I believe that there are certain things, certain types of conduct that are immoral. I believe that military members who sleep with other military members' wives are immoral in their conduct, and that we should not tolerate that."
But then Pace went on to tell the Tribune, "I believe that homosexual acts between individuals are immoral and that we should not condone immoral acts."
Well, stop the presses.
[...]
While the world should be applauding a man who proposes that one of the most important institutions in our country should have moral integrity, instead we hammer him for having a conviction.
But I believe this goes far beyond the whole question of homosexuals in the military and the "Don't Ask, Don't Tell" policy. This cuts to the core of the question of whether anyone in public office is free to speak his deepest religious or moral convictions. The Constitution says there will be no religious test for office, and yet we are applying one. We are basically saying that if you are the Chairman of the Joint Chiefs of Staff, you are not allowed to express your moral or religious views - especially on matters of sexual preference and behavior.
This is another sign that we live in an age that no longer believes in objective truth or a moral order. Moral relativism is the rule, and personal preference trumps all. And government is there to ensure that no one place any restraint on the pursuit of our own desires.
I have long said that C.S. Lewis was prophetic when in 1943 he wrote about the irony of our education system, saying, "Such is the tragicomedy of our situation - we continue to clamor for those very qualities we are rendering impossible... In a sort of ghastly simplicity we remove the organ and demand the function. We make men without chests and expect of them virtue and enterprise. We laugh at honor and are shocked to find traitors in our midst."
Ironic that today, the head of our Joint Chiefs of Staff argues that the military should have consistent policies of moral integrity, and the world demands an apology. Maybe it is time to lock him up: General Pace is guilty. He has committed the intolerable crime of our day: He has stated his conviction in a value-free society that respects only so-called "tolerance."
If there is not such a thing as freedom of speech, even in uniform or out of uniform, how can our service men and women uphold freedom of speech?
(x)HTML DocTypes
by Seth Keiper on Mar.16, 2007, under (x)HTML
HTML 4.01 Strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
XHTML 1.0 Transitional:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.1:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
XML Runaway
by Seth Keiper on Mar.16, 2007, under XML
<?xml version="1.0" encoding="utf-8"?> <root> <say>Hello</say> </root>
Time and Time Again
by Seth Keiper on Feb.22, 2007, under Rantings
At the start of the week, I found myself completely engulfed. Consumed by time and energy, everything just seems like a swift. Time for a challenge? Something perfect to take one out of a rut. Time to release energy. Time to burn energy. Take one's mind off things. A mental vacation. One with dreams fulfilled. But a dream is only an illusion that ends when you wake up or come out of your day dream while crossing a street. I do not find time for dreams. They only slow me down in my Prozeß. Cut through the outer shell and find a meaning. Cut through that meaning and find another. Under it, if you dig deep enough, you may find a third, a fourth. Who shall say how many teachings?