January 29th, 2008
I code for a living. I need a lot of text on two screens at all times.
I need the best monitor possible so that my eyes will not burn out and I won’t be able to keep working.
If the company I work for did not buy me the hardware I need, I would go out and buy it myself.
I am a recent convert to lcd screens.
There are a couple of peculiarities about the ViewSonic VA903b that I have learned and want to share.
I have two of these, and for a little while I wanted to chuck them out with the bath water.
Two things that could be happening with the VA903b to give you a moire effect, a blurry image:
1) If you see ghosting of light letters on a dark background: check the cable on the back of the monitor, make sure it is plugged in properly.
Wiggle it a bit, and the ghosting dissappears. If the cable is too tight from being far from the computer, your image is bad.
2) Check the horizontal size of your screen. I noticed that the auto adjust does not automatically adjust the horizontonal size of the screen.
I also noticed that there is a sweet spot just under the total number of cells on the screen. This setting is *more* important then the “fine tune”
option on the “manual adjust” menu.
Having figured those two things out, I love my monitors way past my old CRTs. I don’t know that I could ever use a CRT again.
Posted in Uncategorized | No Comments »
January 29th, 2008
Ingredients: - Linux distro (Fedora Core 4)
- Camera USB (Kodak Easyshare LS743)
- gphoto2
So I get a camera, and take pictures.. now what? I got linux. I thought this may be complicated.. But guess what..
Step 1
Make sure gphoto2 is installed. If not.. open shell cli prompt (whatever) and become su, then # yum -y install gphoto2, wait for it to complete..
Step 2
Make your dir to receive photos, change to it.. then # gphoto2 -P
Step 3
All your photos are downloaded to your current working dir. Now, delete the photos.. # gphoto2 -DR .. All the photos are deleted from your camera.
Done. That's it. No mouse clicking. No stupid dialogues. Wow.
Posted in cool linux commands, posix | No Comments »
January 27th, 2008
So, I saw Marie Antoinette.
Turns out this movie is directed by Sofia Coppola.
I loved Lost in Translation.
The good thing about that movie, is that what is on the verge of happening throughout the whole thing never does happen. And you’re left with this beautiful sweet taste of a sin half way committed.
In the movie Marie Antoinette, you know what’s going to happen.
The main characters of the movie are all going to be killed.
The whole movie plays like a children’s show, very flowery.
So you think- this is good. Can’t wait to see where this ends up very witty- this must be showing the situation from their standpoint.. You’re just.. la dee da.. and look at the pretty flowers, and the sunlight and then - oh no, we’re dead! The End. Movie over.. aha! What a great movie.. but no. Sorry Sofia Coppola. You suck here.
You can’t use the same formula and get away with it, not here.
This screenplay had a chance to actually be witty, to leave some kind of an aftertaste in your eyeballs, nut nooOOOoooo… I’m Sofia Coppola, I’m going to make a joke without a punchline and you’re all going to laugh anyway.
Well, I ain’t laughing.
Nor is your father, Francis Ford Coppola. I know it. I know he’s shaking his head and thinking *tsk* *tsk* - and you’re like.. “Why daddy! Why! It *is* a good movie! It’s a fucking masterpiece! It’s a great movie, daddy!!! buahahhhahahahaah!”
And daddy don’t say nuthin’ does he?! Maybe he nods and says ‘yes honey, you made a movie.’
But, I wanna be like daddy!!!
Sorry, it takes more then a dick and balls to make Francis Ford Coppola, Sofia.
Ps. Gotta tell ya though, incredibly good score. The Strokes.. Joy Division. Almost made the movie good. Try it without the video next time, should be cheaper to make.
Posted in Uncategorized | No Comments »
January 24th, 2008
=== Location Widget ===
Contributors: leocharre
Tags: widget, location, google map
Requires at least: 2.2
Tested up to: 2.3.2
VERSION: $Revision: 1.1.1.1 $
Lets you insert widgets representing a location, an address. Includes a link to google maps,
generated from the address data.
== Description ==
This lets you insert an address widget, if enough data is available, then a link to google
maps is made visible.
Usage is similar to the text widget.
== Installation ==
To install the plugin follow these steps :
1. Download the location.zip file to your local machine.
1. Unzip the file.
1. Upload the “location-widget” folder to your “/wp-content/plugins/” directory.
1. Activate the plugin through the ‘Plugins’ menu in WordPress
== Screenshots ==
1. Select how many location widgets you want.

2. Enter whatever data you want, a title, address lines 1 through 3, city, state, zip, etc.

3. At the bottom right we see the location widgets as visitors see them. A link to google maps
is generated, provided we have enough data to suggest an address.

Posted in Uncategorized | 1 Comment »
January 20th, 2008
I tackled this problem via XMLRPC and perl.
I ended up packaging this under WordPress::Post on cpan.
Usage examples:
wppost -t 'title of the post' -c stuff,fruit,cake -i 'This is what I think of bla.'
You can also write a text file, the name of the text file is the title.
wppost -i ./path/to/title_of_the_post.txt
This program is in its infancy. But dammit, it works. It’s how I posted this content via the command like. Also, you can include images in your posts. Multiple images. Via the command line.
Anything not in the argument is considered posting content..
So what if your post if about a party you went to, and you have 5 pictures..
First write your halloween_party.txt file, then have your photos lined up somewhere.. then..
wppost -i halloween_party.txt ./images/halloween_photos_post/*jpg
Done. Linux rocks.
Posted in perl, posix | No Comments »
January 20th, 2008
mencoder -aoc copy -ovc copy ./file1.avi ./file1.avi -o ./out.avi
mencoder is part of mplayer, you can install via yum on fedora core packages..
yum -y install mencoder
I had a lot of these to join.. so..
I made a perl script that I can use use without so much fuss.. one that I don’t have to tell it what the output file is going to be.
I put it in ~/bin/avijoin
#!/usr/bin/perl
use strict;
my $outfile = outfile();
my @arg = (qw(mencoder -oac copy -ovc copy), @ARGV, '-o',$outfile);
system(@arg) == 0 or die($?);
print "Wrote:\n$outfile";
exit;
sub outfile {
@ARGV or die('missing args');
my $outfile = $ARGV[0];
$outfile=~s/([^\/]+)\.(\w{1,5})$// or die;
my ($filename,$ext) = (uc $1,$2);
my $x=0;
$filename=~s/\W//g;
my $_outfile;
for(1){
$_outfile="$outfile/$filename$x.$ext";
last unless -e $_outfile;
$x++;
}
return $_outfile;
}
Make sure to chmod 0755 ~/bin/avijoin
Posted in cool linux commands | 1 Comment »
January 16th, 2008
I want to go over linux rename command very quickly. It’s a simple command but I used to find it tricky and unintuitive.
The man rename output examples of foo and bar are freaking cryptic.
So I want to show some real world examples of rename
Let’s do a directory listing…
[leo@localhost rename_example_dir]$ ls -l
total 1872
-rw-rw-r-- 1 leo leo 845805 2008-01-16 20:36 P1010591.JPG
-rw-rw-r-- 1 leo leo 914240 2008-01-16 20:36 P1010624.JPG
-rw-rw-r-- 1 leo leo 38167 2008-01-16 20:35 Picture 11.jpg
-rw-rw-r-- 1 leo leo 29726 2008-01-16 20:35 Picture 16.jpg
-rw-rw-r-- 1 leo leo 25545 2008-01-16 20:35 Picture 21.jpg
-rw-rw-r-- 1 leo leo 23886 2008-01-16 20:35 Picture 22.jpg
-rw-rw-r-- 1 leo leo 14736 2008-01-16 20:35 Picture 3.jpg
Great. Now, let’s change those filenames..
[leo@localhost rename_example_dir]$ rename 'Picture ' 'PICTURE_' ./Pictu*
[leo@localhost rename_example_dir]$ ls -l
total 1872
-rw-rw-r-- 1 leo leo 845805 2008-01-16 20:36 P1010591.JPG
-rw-rw-r-- 1 leo leo 914240 2008-01-16 20:36 P1010624.JPG
-rw-rw-r-- 1 leo leo 38167 2008-01-16 20:35 PICTURE_11.jpg
-rw-rw-r-- 1 leo leo 29726 2008-01-16 20:35 PICTURE_16.jpg
-rw-rw-r-- 1 leo leo 25545 2008-01-16 20:35 PICTURE_21.jpg
-rw-rw-r-- 1 leo leo 23886 2008-01-16 20:35 PICTURE_22.jpg
-rw-rw-r-- 1 leo leo 14736 2008-01-16 20:35 PICTURE_3.jpg
Ok, how about we match up the file extensions too..
[leo@localhost rename_example_dir]$ rename JPG jpg ./*
[leo@localhost rename_example_dir]$ ls -l
total 1872
-rw-rw-r-- 1 leo leo 845805 2008-01-16 20:36 P1010591.jpg
-rw-rw-r-- 1 leo leo 914240 2008-01-16 20:36 P1010624.jpg
-rw-rw-r-- 1 leo leo 38167 2008-01-16 20:35 PICTURE_11.jpg
-rw-rw-r-- 1 leo leo 29726 2008-01-16 20:35 PICTURE_16.jpg
-rw-rw-r-- 1 leo leo 25545 2008-01-16 20:35 PICTURE_21.jpg
-rw-rw-r-- 1 leo leo 23886 2008-01-16 20:35 PICTURE_22.jpg
-rw-rw-r-- 1 leo leo 14736 2008-01-16 20:35 PICTURE_3.jpg
Now let’s talk about what the heck happened.
The command is..
rename $takeout $putin $towhatfiles
First argument is what you do not want there, second argument is what you want to replace it with, third argument is a list of files, you can use wildcards and all the other freaky unix filematch operators.
Posted in cool linux commands | No Comments »
January 16th, 2008
Here’s an example of a cgi script running so that it is profiled..
script.cgi :
#!/usr/bin/perl -d
use Devel::DProf;
# do whatever .....
Afterwards, a tmon.out file resides alongside your script.cgi
# dprofpp -I ./tmon.out
Why the heck would you want to profile a cgi??
As I say over and over again to myself and to anyone that may happen to stand around me, I think a cgi is not a program. I think any web application is not supposed to be an application at all.
I think that a web application should be an INTERFACE to a an application.
A cgi may do things like manage authentication, take user input, and give feedback. That’s all. It should NOT do crazy things like perform OCR, make calculations, generate thumbnails, etc etc.
That kind of code should be developed and tested via the command line on a terminal emulator.
After that works, you can make your interface, or WUI, as I like to call them. Web User Interface.
Now, although your web interface may not do much but take input and spit feedback- what is going on behind the scenes may be very complicated.
Sometimes your application runs great, and you get users telling you “hey, it’s slow..”.
You have to perform all the things they do with their variables etc.. to see what’s going on.
Replicating a cgi environment with authentication, encryption, and god knows what else.. is a pain - in fact.. I’ve tried a couple of times and it sucked all my energy out. Screw that.
So this is the next best thing- profile a cgi run!!!
It’s wonderful- if you have a slow cgi app, this is really useful.
Posted in Uncategorized | No Comments »
January 15th, 2008
I have a digital cam. I take pictures.
I don’t like a million DSCIM or DSCF or whatever files.
It’s inconvenient with so damn many.
It would be nice to rename all the images according to the date, as recorded inside the image exif data, that is, the sate stamp put in by your camera.
I hacked together this script to do that..
Use at your own peril. This is a hack.
Eventually I will release a refined version on cpan.
This scrip requires modules Image::ExifTool, LEOCHARRE::CLI ..
#!/usr/bin/perl -w
use strict;
use File::Copy;
use Cwd;
use LEOCHARRE::CLI;
# requires Image::ExifTool
#
my $o = gopts('m');
#yn('rename all jpg files by date in '.cwd().'?') or exit;
my $files = argv_aspaths();
(defined $files and scalar @$files )or die("no file arguments provided");
if ($o->{m}){
-d './noout' or mkdir './noout';
}
for (@$files){
$_=~/(.+)\/([^\/]+)$/ or next;
my $abs = $1;
my $filename = $2;
$filename=~/\.jpg$/i or next;
print STDERR "$abs - $filename \n" if DEBUG;
if ($filename=~/\d{4}[_\: ]+\d{2}[_\: ]+\d{2}/){
print STDERR "file $filename already named?\n" if DEBUG;
next;
}
my $out = `exiftool -DateTimeOriginal '$abs/$filename'`;
chomp $out;
unless( $out ){
print STDERR " no out? $filename\n" if DEBUG;
if ($o->{m}){
File::Copy::move("$abs/$filename", "$abs/noout/$filename");
}
next;
}
$out=~s/^Date\/Time Original[\:\s]*//i;
$out=~s/:| /_/g;
unless( $out=~/^[\d_]+$/ ){
print STDERR "dont like [$out]\n" if DEBUG;
next;
}
print STDERR "$filename : [$out]\n" if DEBUG;;
rename("$abs/$filename", "$abs/$out\_$filename");
print STDERR "moved to $abs/$out\_$filename\n" if DEBUG;
}
=head1 OPTION FLAGS
-m move to noout dir if cant get date
Posted in perl, posix | No Comments »
January 15th, 2008
I love coffee.
Coffee should be hot.
The temperature, should be hot.
You should drink coffee when it’s almost too hit for you.
If the cofee were hotter, it would hurt you.
Perhaps it hurts a little as you drink it.
Coffee should be strong.
Coffee should not be drank in large ammounts.
Coffee should be strong, and hot.
You should not need to drink large volumes of coffee.
Good coffee does not need to be drank in large ammounts.
Drinking large ammounts of good hot coffee should make even a veteran coffee drinker feel slightly uncomfortable.
Drink and smoke.
There are three drinks that go with smoking.
Coffee, acohol, and Pepsi.
I learned this long ago, when I yet was not a smoker.
Coffee should be drank black, like a woman’s heart.
One should not put creamer or sugar in coffee.
It is permissible to do so rarely. For taste.
Use heavy cream and sugar.
Do not put non fat creamer or fake sweateners in cofee.
This is coffee. This is not about long life, this is about quality of life.
If you want to put ’shit’ in your coffee, get your coffee at McDonalds or 7Eleven.
How to Brew Coffee.
As of late my very loved method is the French Press…
To be continued.
Posted in near life experience | No Comments »
|
|