shooter.logo.3

Geek Speak

Friday,April,06,2007

San Francisco Police Department Radio Code Cheat Sheet

All the 10-codes, 11-codes, and other cryptic shit the SFPD uses in their radio communications

Here’s a PDF of the radio codes that the SFPD uses.

SFPD_Radio_Codes.pdf

Enjoy!

Feedback (0)
Posted by stevem on 04/06 at 10:02,PM • Category: Geek Speak
Permalink

Share this entry with a friend

Tuesday,April,05,2005

An easier way to search and replace in UNIX with perl

Why screw around with loops and sed for making changes in a bunch of files???

I'm an old school kind of UNIX admin. I like tools like sed and awk. But that's not to say that I don't appreciate the "easy" way of doing things. For example, I'm sure we're all familiar with this sort of thing:
for each file in *.text
do
sed 's/search/replace/g' <$file >$file.tempfile
mv $file.tempfile $file
done
sed, the stream editor, can't write it's output directly to the file that it's operating on, so you use a tempfile to get around that limitation. However, there is an easier way using our friend Perl:
perl -pi -e 's/search/replace/g' *.text
Here's a breakdown of how that command works:
-p Assumes an input loop around the script. It reads each line of the file
  and outputs it after processing
-i Activates in place editing of files
-e Indicates a single lines script
's/search/replace/g' is the script or command. In this case
                              it's a search and replace regex
*.text the filename(s) to operate on
With a little effort you can create all kinds of custom commands to execute against files on your unix box. Custom grep-like commands allow flexibility you can't get from any flavor of grep. For those unfamiliar with UNIX classics like sed and awk, perl offers you all the functionality (and more) with a tool you may already be somewhat familiar with. Any sysadmin worth her bytes should have at least a minimal amount of experience with Perl. See http://www.perl.org/ and/or the perl manpage for further information...

Feedback (1)
Posted by stevem on 04/05 at 09:47,AM • Category: Geek Speak
Permalink

Share this entry with a friend

Sunday,January,23,2005

“Your Propeller is Showing”

That was what my friend Kurt said when I told him…

My DVD Collection is now online!

Using Movie Collector Pro software, I’ve created an online catalog of my DVD collection. It’s not that I’m really all that much of a geek… Well, maybe I am.... But it makes perfect sense for me to use some sort of DVD Cataloging software since I’ve removed all my DVD from their bulky cases, and now store them in sleeves. What would take up an entire shelf unit previously, now fits in a couple of drawers.... And I can sort by Director, Title or Genre…

It’s a good thing!

Feedback (0)
Posted by stevem on 01/23 at 01:51,AM • Category: Blah Blah Blah
Category: Geek Speak
Permalink

Share this entry with a friend

Thursday,November,11,2004

Geek Nightmare

The dreaded rm -rf / command happily zipping along

image

Feedback (2)
Posted by stevem on 11/11 at 11:25,PM • Category: Geek Speak
Category: Random Photos
Permalink

Share this entry with a friend

Sunday,August,29,2004

Bulk importing weblog entries into Expression Engine

A commented version of my Perl script that I used to bulk import 3,000 weblog entries into my Expression Engine weblog/CMS tool.

I’m using a weblog to hold more than 3k photos that I’m offering for sale to participants in a rodeo that I shot. There was no way I was going to manually add thousands of entries. So like any good geek, I scripted it.  I’ve posted my script along with copious comments. Please keep in mind that this script worked for me. I’m sure there is a better way to do this. USE THIS SCRIPT AT YOUR OWN RISK. I’m posting it as an example and tutorial rather than a “run it as is” tool.

insert.pl

insert.pl


   1 #!/usr/local/bin/perl -w
   2 #
   3 #
   4 #	 MODFY AND USE THIS SCRIPT AT YOUR OWN RISK!!!
   5 #
   6 #
   7 #	Author: 	Steve Malik
   8 #			Shooter.net
   9 #
  10 #
  11 #	This script is used for bulk importing weblog entries into Expression Engine 
  12 #	Content Management/Blogging system. How to structure your EE templates to
  13 #	use data that is imported via the script is beyond the scope of the documentation
  14 #	for this script. If you aren't familiar enough with Perl and Mysql and EE to 
  15 #	FULLY understand this script, you are likely taking a very large risk with 
  16 #	your database, and should not proceed without qualified assistance.
  17 #
  18 #	I don't do any error checking or data validation in this script,
  19 #	which is very dangerous.
  20 #
  21 #	This entire script steps through a line at a time from my datafile. For each line it
  22 #	parses the line, caluculates dates, and adds the appropriate data to three tables in
  23 #	the mysql database.
  24 #	
  25 #	I'm sure there is a much better way to do this, but this worked for me...
  26 #
  27 # 	Here is a sample of the data file:
  28 #
  29 #	_A011940.JPG    Default 8/21/04 5:22:42 PM      Bay Area Chapter IGRA 2004 Rodeo        Assorted, Pole Bending
  30 #	_A011941.JPG    Default 8/21/04 5:22:48 PM      Bay Area Chapter IGRA 2004 Rodeo        Assorted, Pole Bending
  31 #	_A011942.JPG    Default 8/21/04 5:22:50 PM      Bay Area Chapter IGRA 2004 Rodeo        Assorted, Pole Bending
  32 #	_A012236.JPG    Default 8/22/04 11:26:49 AM     Bay Area Chapter IGRA 2004 Rodeo        Assorted, Mounted Breakaway Roping
  33 #	_A012551.JPG    Default 8/22/04 1:13:13 PM      Bay Area Chapter IGRA 2004 Rodeo        Assorted, Grand Entrance
  34 #	_A012552.JPG    Default 8/22/04 1:13:21 PM      Bay Area Chapter IGRA 2004 Rodeo        Assorted, Grand Entrance
  35 #	_A010706.JPG    Default 8/21/04 9:11:26 AM      Bay Area Chapter IGRA 2004 Rodeo        Assorted
  36 #	_A010707.JPG    Default 8/21/04 9:11:27 AM      Bay Area Chapter IGRA 2004 Rodeo        Assorted
  37 #	_A010708.JPG    Default 8/21/04 9:34:55 AM      Bay Area Chapter IGRA 2004 Rodeo        Assorted
  38 #	_A010709.JPG    Default 8/21/04 9:35:39 AM      Bay Area Chapter IGRA 2004 Rodeo        Assorted
  39 #	_A010710.JPG    Default 8/21/04 9:36:12 AM      Bay Area Chapter IGRA 2004 Rodeo        Assorted
  40 #	_A010711.JPG    Default 8/21/04 9:36:21 AM      Bay Area Chapter IGRA 2004 Rodeo        Assorted
  41 #	_A010715.JPG    Default 8/21/04 9:46:59 AM      Bay Area Chapter IGRA 2004 Rodeo        Calf Roping On Foot
  42 #
  43 # 	FWIW, I exported this text file from iView MediaPro, my asset management program, which is where
  44 #	I sorted and categorized the photos.
  45 #
  46 #	Note: this is a tab delimited file (even if it doesn't show up that way here), and the last field
  47 #	may contain one or more items separated by commas.
  48 #	
  49 #	I perform no data checking, as I know the data file contains all the required fields or placholders. 
  50 #	Problems with the data file will cause the script to crash, trash your database, and impregnate your
  51 #	dog with the spawn of space aliens. You've been warned.
  52 # 	
  53 #	This script requires a Perl module called sdb.pm
  54 #
  55 
  56 #
  57 #Here's what's in the perl module:
  58 #
  59 
  60 #package sdb;
  61 #
  62 #use strict;
  63 #use DBI;
  64 #
  65 #sub connect {
  66 #my $db_name = "dbname";
  67 #my $host_name = "dbhost";
  68 #my $user_name = "dbuser
  69 #my $password = "dbpasswrd";
  70 #my $dsn = "DBI:mysql:host=$host_name;database=$db_name";
  71 #
  72 #return (DBI->connect ($dsn, $user_name, $password, { PrintError => 1, RaiseError => 0}));
  73 #}
  74 #
  75 #1;      # return true
  76 #
  77 
  78 ## END OF sdb.pm
  79 
  80 
  81 #	Now, we're on to the insert.pl script!
  82 ####################################################################################################
  83 
  84 #
  85 # Call a few pragmas and modules
  86 #
  87 
  88 use strict;
  89 use sdb;
  90 use locale;
  91 use Time::localtime;
  92 use Time::Local;
  93 
  94 #
  95 # Define some variable we'll be using
  96 #
  97 
  98 use vars qw(
  99 @thenames $shit $filename $orientation $date_time @date_time $event @categories $cat
 100 $month $day $year $hour $minutes $seconds $ampm $date $time @fields $entry_id
 101 );
 102 
 103 # 
 104 # Open up our connection to the database (using sdb.pm module)
 105 #
 106 
 107 my $dbh = sdb::connect();
 108 
 109 #
 110 # open up our file for reading
 111 #
 112 
 113 open (INFILE,"<rodeo.2004.txt") or die "can't open text.table.from.iview.txt\n";
 114 
 115 #
 116 # Step through each line in the file
 117 #
 118 
 119 while (<INFILE>){
 120 chomp;
 121 
 122 # debugging print of each line from our input file
 123 #print "$_\n";
 124 
 125 
 126 #
 127 # split it out into field. The fields
 128 # are tab delimited. We know the order of the fields, so we assign them
 129 # names that make sense.
 130 #
 131 
 132 @fields=split("\t",$_);
 133 
 134 #
 135 # grab our first field, it's the filename
 136 #
 137 
 138 $filename="$fields[0]";
 139 
 140 #
 141 # the second field is the orientation of the image
 142 #
 143 
 144 $orientation="$fields[1]";
 145 
 146 
 147 #
 148 # grab the date information which is field 3 (remember, the first field is $fields[0]
 149 #
 150 
 151 $date_time="$fields[2]";
 152 
 153 # split out month day year HH MM SS
 154 ($date,$time,$ampm)=split(' ',$fields[2]);
 155 ($hour,$minutes,$seconds)=split(':',$time);
 156 
 157 # deal with the AM PM issues by converting to 24 hour time
 158 
 159 #
 160 # Deal with PM first
 161 #
 162 
 163 if ($ampm =~ "PM" && $hour < 12){
 164 $hour=($hour+'12');
 165 }
 166 
 167 #
 168 # Then deal with AM
 169 #
 170 
 171 if ($ampm =~ "AM" && $hour == 12){
 172 $hour=($hour-'12');
 173 }
 174 
 175 #
 176 # Next we need to convert our local time from our data file into epoch time
 177 #
 178 
 179 my ($month,$day,$year)=split ('/',$date);
 180 
 181 #
 182 # In timelocal module, months are an array, hence januray is month 0 
 183 # So we subtract one from the month value
 184 #
 185 
 186 $month=$month-1;
 187 
 188 #
 189 # We had a two digit year in our data file, let's make that a four digit year by add a "20" prefix
 190 #
 191 
 192 $year="20".$year;
 193 
 194 # 
 195 # Now we get the epoch time (google it if you don't know what it is)
 196 #
 197 
 198 my $TIME = timelocal($seconds, $minutes, $hour, $day, $month,$year);
 199 
 200 #
 201 # Account for the time zone difference by adding 8 hours. Epoch time is in seconds, hence the math.
 202 #
 203 
 204 $TIME = $TIME+(60*60*8);
 205 
 206 #
 207 # grabbing the event that is stored in field 4 in our data file.
 208 #
 209 
 210 $event="$fields[3]";
 211 
 212 #
 213 # The categories field can have multiple values separated by commas. So we
 214 # split that field out into an array
 215 #
 216 @categories=split(',', "$fields[4]");
 217 
 218 #
 219 # when testing and debugging, I print out all the fields that I've pulled outta the
 220 # data file to make sure there are not mistakes. Uncomment these for testing.
 221 #
 222 
 223 #print "Filename is: $filename\n";
 224 #print "Orientation is: $orientation\n";
 225 #print "Date is: $date\n";
 226 #print "Time is: $hour $minutes $seconds\n";
 227 #print "AMPM is: $ampm\n";
 228 #print "EPOCH TIME IS: $TIME\n";
 229 #print "Event is: $event\n";
 230 
 231 # Insert the entry into the exp_weblog_titles table in my database:
 232 
 233 #
 234 # uncoment this for debugging purposes
 235 #
 236 
 237 #print "insert into exp_weblog_titles (
 238 #weblog_id, author_id, pentry_id, ip_address, title, url_title, status, allow_comments, allow_trackbacks,
 239 #sticky, entry_date, year, month, day, expiration_date, edit_date, recent_comment_date, comment_total,
 240 #trackback_total, sent_trackbacks, recent_trackback_date)
 241 #VALUES 
 242 #( 5, 1, 0, \"64.171.182.90\", \"Image id: $filename\", \"$filename\", \"open\", \"n\", \"n\", \"n\",
 243 #\"$TIME\", \"$year\", \"$month\", \"$day\", \"0\", \"$year$month$day$hour$minutes$seconds\", 0, 0, 0, 0, 0)\n";
 244 
 245 # 
 246 # Here's the meat of the script.
 247 #
 248 # A couple of things to note. I'm hardcoding several values here: weblog_id, author_id, pentry_id, IP address etc.
 249 #
 250 # the entry_id field is auto_increment, so I don't have to provide that value. I just
 251 # let mysql provide it.
 252 
 253 
 254 my $count = $dbh->do ("insert into exp_weblog_titles (
 255 weblog_id, author_id, pentry_id, ip_address, title, url_title, status, allow_comments, allow_trackbacks,
 256 sticky, entry_date, year, month, day, expiration_date, edit_date, recent_comment_date, comment_total,
 257 trackback_total, sent_trackbacks, recent_trackback_date)
 258 
 259 VALUES 
 260 
 261 ( 5, 1, 0, \"64.171.182.90\", \"$filename\", \"$filename\", \"open\", \"n\", \"n\", \"n\",
 262 \"$TIME\", \"$year\", \"$month\", \"$day\", \"0\", \"$year$month$day$hour$minutes$seconds\", 0, 0, 0, 0, 0) ");
 263 if ($count)
 264 {
 265        $count +=0;
 266 
 267        #
 268        # this is kinda cool. mysql_isertid will provide me with the entry_id of the last
 269        # entry that I added (meaning this one) to the database. I need the entry_id for
 270        # populating fields and linking categories to weblog entries.
 271        #
 272 
 273        $entry_id=$dbh->{mysql_insertid};
 274        print "$count rows were updated with an entry of of $entry_id\n";
 275 }
 276 
 277 #
 278 # now let's create the field entries. This is where we populate the fields for 
 279 # the weblog entry. Note that we're not using field names, but rather identifying 
 280 # the fields by the field_id. Also note that we're setting the formatting for 
 281 # field id 2 to be "none"
 282 #
 283 # Note that I'm hard coding in the weblog_id, as all these are weblog_id = 5
 284 #
 285 # Note that I'm using the $entry_id that I grabbed above.
 286 #
 287 
 288 my $count = $dbh->do (" insert into exp_weblog_data (
 289 entry_id, weblog_id,field_id_1,field_id_2,field_ft_2) 
 290 VALUES (
 291 $entry_id,5,\"$filename\",\"$filename\", \"none\"wink ");
 292 
 293 # Now I need to create the categories that I'm using. Some of these categories may already exist, and
 294 # some will have been created by previous entries in our data file. I don't want to create duplicate
 295 # field entries as this will break things in EE. So... I modified the exp_categories table to add
 296 # a unique index on three columns. Then I use an insert ignore to add the new category. If it already
 297 # exists for the category group that I'm using, mysql does not insert it, but rather ignores the command.
 298 # Kinda nifty huh?
 299 #
 300 
 301 #
 302 # Step through each category
 303 #
 304 
 305 foreach $cat (@categories){
 306 
 307 #
 308 # Get rid of leading and trailing spaces
 309 #
 310 	$cat =~ s/^\s+//;
 311 	$cat =~ s/\s+$//;
 312 
 313 #
 314 # Another debugging placeholder that prints the entire line including category
 315 #
 316 
 317 #print "$filename $date_time $orientation $event $cat\n";
 318 
 319 # print each category
 320 
 321 #
 322 # attempt to insert into exp_categories field, in case it isn't already there.
 323 # Note that I've hardcoded in the group_id and parent_id.
 324 #
 325 
 326 my $count = $dbh->do ("insert ignore into exp_categories (group_id, parent_id, cat_name) VALUES (3,0,\"$cat\"wink");
 327 if ($count)
 328 {
 329 $count +=0;
 330 
 331 #
 332 # Another debuggin placeholder
 333 #
 334 
 335 #print "$count categories were inserted with an entry of of $seq\n";
 336 
 337 }
 338 
 339 #
 340 # Whether we just added it or it was already in the exp_categories table, our category should
 341 # now be in the database. Let's find out what the category_id is
 342 #
 343 
 344 my $cat_id = $dbh->selectrow_array ("select cat_id from exp_categories where cat_name like \"$cat\" and group_id = 3");
 345 if ($cat_id) {
 346 
 347 #
 348 # Another debugging placeholder
 349 #
 350 
 351 #print "cat_id is $cat_id\n";
 352 
 353 #
 354 # Now that we've got the category_id and we know the entry_id from above, let's link the new entry to the
 355 # category.
 356 #
 357 
 358 my $count = $dbh->do ("insert ignore into exp_category_posts (entry_id, cat_id) VALUES ($entry_id,$cat_id)");
 359 }else{
 360 print "problem with inserting category: $cat $cat_id for entry_id $entry_id\n";
 361 }
 362 
 363 #print "$cat\n";
 364 
 365 }
 366 #print "\n";
 367 }
 368 close INFILE;
 369 
 370 #
 371 # Now we're done
 372 #
 373 
 374 #
 375 # These were a couple of little tests to try to resolve a problem that I had with the epoch
 376 # Timing of entries. I'm just leaving them in here for kicks.
 377 #
 378 
 379 #my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime('1092548948');
 380 #print "$seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst\n";
 381 
 382 #my $tm = localtime('1093339068');
 383 #printf("Dateline: %02d:%02d:%02d-%04d/%02d/%02d\n",
 384 #$tm->hour, $tm->min, $tm->sec, $tm->year+1900,
 385 #$tm->mon+1, $tm->mday);
 386 
 387 #my $tm = localtime('1093136085');
 388 #printf("Dateline: %02d:%02d:%02d-%04d/%02d/%02d\n",
 389 #$tm->hour, $tm->min, $tm->sec, $tm->year+1900,
 390 #$tm->mon+1, $tm->mday);

Feedback (0)
Posted by stevem on 08/29 at 11:12,PM • Category: Geek Speak
Permalink

Share this entry with a friend

Thursday,July,15,2004

Tips and Examples for how to use your .htaccess file

.htaccess file explained with examples for eliminating referrer spam and deep linking

Someone recently asked how to block a particular IP address from their
web site. the .htaccess file is a good way to do this. I’m assuming
that you can google for information about where to put your .htaccess
file, and am only going to address some ways to populate your .htaccess
file to accomplish some routine access control and URL rewriting.

For more information on URL rewriting do a google search for:
+mod_rewrite +documentation
or
+mod_rewrite +examples

Topics covered are:


  • A brief introduction to Regular Expressions
  • Denying access based on IP address of browser
  • Denying access based on HTTP_REFERER
  • Denying linking or deep linking of images on your site
  • Sending naughty users to “good” content elsewhere on the web
  • Rewriting URLs in order to remedy an incorrect URL posting to email lists

The statements or directives that are used in my .htaccess file are what are known as "regular expressions". This site seems to be comprehensive, and was at the top of the google search for "regular expressions".

Here are a couple of quick explanations for what's being done in my .htaccess file.

  • ^ refers to the beginning of a string. So any regex that has ^ in it means "starts with"
  • $ refers to the end of the string. So any regex that ends with $ means "ends with" the previous character
  • ! is negation. Anywhere you see a ! (aka "bang"), it means not. so !string, matches everything except string
  • . means any single character
  • * means one of more of the preceding character. Hence .* is like the UNIX or DOS * wildcard
  • | is a logical OR. I explain more about it below.
  • \ escapes the "special characters" just described. So if I wanted to match a . I would write the regex \.

So to put a couple of these together:

  • ^$ refers to a string that starts and stops with nothing in between, also known as an empty string, as there's nothing in it.
  • ^stevem.* refers to a string that starts with stevem and then may contain any number of any characters.
  • ^shooter\.net$ refers to a string that contains only "shooter.net"

I describe how I've setup these regexs below using the characters described above...

Use Google for more info.

Another thing to note: In a couple of the directives in my .htaccess file I block some rather large chunks of the Internet from getting to my web site. I'm doing this because I want to be sure that I've blocked irritating (usually referrer spammers -- SCUM) from hitting my site and I've used a whois server to find out what the netblock boundaries are, and blocked the entire netblock. I also keep a close eye on my access log to see who is being denied access to my site. I strongly suggest that if you don't know what you're doing, don't take such extreme measures, and instead block complete single IP addresses instead of networks.

And most of all, be careful and make sure you understand what you are doing in your .htaccess file. Then TEST TEST TEST to make sure it's accomplishing what you want and that you haven't crippled your site.

.htaccess files are powerful tools for fine tuning access to your web site. To paraphrase a famouse comic book uncle, "With great power comes the ablity to really screw things up."

Here is a copy of my .htaccess file with inline comments attempting to describe what I'm doing.

## The next several statements set a variable, (BadAgent, BadReferer, BadAddy)
## if the condition is met. the three deny lines below cause the  
## 403 Denied to be issued

## This identifies a couple of irritating User-Agents
SetEnvIfNoCase User-Agent ".*(AdultGods|php/perl).*" BadAgent

## This identifies a couple irritating Referers
SetEnvIfNoCase Referer ".*(x-stories|plattendreher|pureteen|stormfront).*" BadReferer

## This blocks some IP addresses that I don't like this is a rather complex regular expression
## the () symbols contain a group of expressions separated by the pipe symbol |
## the | acts as a logical OR.
## so for example, we match a string that contains one or more of any character: .*
## that contains one of those three IP addresses listed in the ()s
## and then can be followed by one or more of any (or none at all) characaters.
## Do some searching on google if you really want to dig this deeply into regexs
##
SetEnvIfNoCase REMOTE_ADDR ".*(193.194.84.1|69.31.86.133|205.252.49.146).*" BadAddy

## This blocks an entire class B... It's all owned by one ISP, and the 
## referrer spam was coming from a dozen or more networks contained in this netblock
SetEnvIfNoCase REMOTE_ADDR "66.154.*" BadAddy

## This blocks two class B networks. Same story as above. However,
## the \. included below makes sure that we only block two networks
## 198.25.0.0 and 198.26.0.0  if we had left out the .\ we would have matched
## HUNDREDS of networks, like 198.251.0.0 and 198.268.0.0 etc... 
##
SetEnvIfNoCase REMOTE_ADDR "198.2(5|6)\..*" BadAddy

## Here's where we setup the denials if there were matches above
order deny,allow
deny from env=BadAgent
deny from env=BadReferer
deny from env=BadAddy


## This part of the .htaccess file is where I do some URL rewriting


## Gotta turn on the engine if we're going to get anywhere
RewriteEngine on

## These two rules cause requests for  atom and rss requests to the
## docroot of my site to be rewritten to use ExpressionEngine system
## so they are properly served
##
RewriteRule  .*atom.xml$ http://www.shooter.net/index.php/weblog/rss_atom/ [R] 
RewriteRule  .*rss.xml$ http://www.shooter.net/index.php/weblog/rss_2.0/ [R] 

## This commented out rule causes all requests for index.html to be
## rewritten to use ExpressionEngine. It was in place as I was migrating
## and I wanted everything directed into EE instead of using my old static pages.
##
#RewriteRule  /.*index.html$ http://www.shooter.net/index.php [R] 

## I posted an email to a mailing list announcing this article, but I 
## somehow managed to screw it up. This entry fixes it so I didn't
## have to post an "I'm a dummy" followup
## see if you can figure out the incorrect URL that I posted
##
RewriteRule  ^using-a-polarizer/  http://www.shooter.net/index.php/weblog/Item/using-a-polarizer/ [R] 


## This is how I prevent other sites from linking to my images, a practice
## also known as "deep linking". It pisses me off that in spite of my 
## copyright notice, forbidding this practice, some people think it's okay
## to steal my work, and steal my bandwidth too...
##
##
## This line says, only match if the HTTP_REFERER environment variable is
## not empty otherwise fall out of this series of conditionals. So if
## there is no HTTP_REFERER set, we drop out of this set of conditionals,
## which means that we don't execute the RewriteRule at the end of this
## block of conditionals.
##  
RewriteCond %{HTTP_REFERER} !^$ 

## This is a case insensitive (because of the [NC] flag) expression
## that causes any referrals from shooter.net to exits from this series
## of conditionals
##
RewriteCond %{HTTP_REFERER} !.*shooter.net.* [NC]

## dicelady.com is my mom's web site. Since we're sharing the installation
## of ExpressionEngine, I want to serve images for her... So if the
## HTTP_REFERER is not from her site we stay in this series of
## conditionals, if it is from her site, the request drops out of this
## series of conditionals,
##
RewriteCond %{HTTP_REFERER} !^http://www.dicelady.com/.*$ [NC]

## Here's the action item. If we have a referrer, and it's not from
## shooter.net or dicelady.com and the request ends in jpg, then no matter
## what image they requested, we're going to serve them up a gif file that
## is a reminder to not steal my images...
##
RewriteRule  .*\.jpg$ http://shooter.net/ah.ha.1.gif [R] 

## The website name has been changed to prevent the guilty
## from knowing how I did what I did... 
##
## This one is kinda fun. There is a website whose domain
## name contains "hatemongersite". They are a white supremecist
## website that was linking to my images of same-sex weddings.
## And saying derogatory ugly things about the people that I
## took pictures of... So, ANY request for ANYTHING from my
## site that originates from this website, gets redirected to
## a TOLERANCE site, and is served a nice pdf pamphlet about
## "promoting tolerance" The nice thing about sending them a 
## pdf is most web browsers will launch a help app, adobe acrobat
## to display the pdf... So they are browsing along, and suddenly they
## have a "promoting tolerance" pdf being displayed... 
##
RewriteCond %{HTTP_REFERER} ^http://.*hatemongersite.*$ [NC]
RewriteRule  .* http://www.tolerance.org/101_tools/101_tools.pdf [R] 

## This one is simple. Requests from a site the irritated me
## are rewritten to send them to a site with a very large pipe
## and an 8mb thermal image of tokyo!
##
RewriteCond %{HTTP_REFERER} ^http://.*popmiranda.*$ [NC]
RewriteRule  .* http://vvvvvvv.vv.vvv.vvv/gallery/images/tokyo.jpg [R] 

## Here's how you can redirect traffic from a certain address or range
## of addresses to another site... This was the network that included 
## several users from the hatemongersite (IP changed to protect the guilty)
## I point them at the "promoting tolerance" pdf.
##
RewriteCond %{REMOTE_ADDR} 192.168.10.*
RewriteRule  .*\.html$ http://www.tolerance.org/101_tools/101_tools.pdf [R] 

So that's about it... I hope you've enjoyed this little jaunt through my .htaccess file.

Feedback (5)
Posted by stevem on 07/15 at 12:14,AM • Category: Geek Speak
Permalink

Share this entry with a friend

Wednesday,March,31,2004

How to stay unemployed for more than 19 months

How not to manage your job search, or how to stay unemployed…

I follow several mailing lists. On one of these lists, a person that I’ll call XXXXX posted this message seeking help with his job search. I was touched by the fact that he had been unemployed for 19 months in spite of what appeared to a strong effort on his part to find work. His listing of skills that he lacked seemed to be counterproductive, so I was inspired to write to him. I wrote to him privately with a sincere offer of help. Keep in mind, I didn’t know this guy, but was willing to offer him any help I could give him.

His response? Nothing. Not so much as a “no thank you”. Nada.  Zip. Zilch.

So I was suprised to find yet another message from XXXXX on the mailing list asking for help. One of the responses to him pointed out that picking up a new skill may be helpful. Somone else pointed out that school was expensive… After a follow-up message from XXXXX saying that he “stood alone”, it was time to flame him!

I think it’s great the this person was asking for help. The problem was that he wanted something handed to him. My offer to help was generous, yet he ignored me. It just kills me to see someone ignore opportunity. I would hope that in 19 months of unemployment he would have used at least some of that time to improve his skill set, and make himself more employable.  I’m not saying that I’m God and I know what is best for everyone, but I do have a fair amount of tech industry experience and a good idea of what skills are in demand. I do participate in the screening and hiring process for my employer.

Everyone knows that the “best” jobs aren’t listed in the newspaper, but come from knowing someone that knows someone that is hiring. Even if XXXXX had declined my offer of help, a simple note indicating this would have encouraged me to keep my eyes peeled for a job opening that might fit him.  As it stands, I have no desire to help him in any way; I prefer to expend my time and energy trying to help those who are willing to try to help themselves.

Feedback (0)
Posted by stevem on 03/31 at 09:26,AM • Category: Blah Blah Blah
Category: Geek Speak
Permalink

Share this entry with a friend

Page 1 of 2 pages  1 2 >

<< Previous Page

Shooter.net Home