Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Robert Simplicio, Simplicio Systems Inc., Professional Meditech NPR report writing, integration, and custom Magic & VMagic programming. http://www.simplicio.com

« Newer Snippets
Older Snippets »
15 total  XML / RSS feed 

Common Lighttpd rewrite requests

More than anything, this is for my own reference, but also for the benefit of jordanbrock...

This comes courtesy http://www.cyberciti.biz/tips/lighttpd-redirect-www-domaincom-to-domain-com.html

For various reason you might want to redirect all traffic coming to www.domain.com to domain.com or vise versa.

This is essential if you want to maintained good structure for search engines (SEO) or to generate accurate stats.

Open your /etc/lighttpd/lighttpd.conf file:
# vi /etc/lighttpd/lighttpd.conf

Find your virtual domain section.

h4. Add following configuration directive if you want to redirect www.domain.com to domain.com

$HTTP["host"] =~ "^www\.(.*)" { url.redirect = ( "^/(.*)" => "http://%1/$1" ) }


h4. Add following configuration directive if you want to redirect domain.com to www.domain.com

$HTTP["host"] =~ "^domain\.com$" { url.redirect = ( "^/(.*)" => "http://www.domain.com/$1" ) }


Close and save the file. Restart the lighttpd web server:
# /etc/init.d/lighttpd restart

My path to instiki startup

/usr/local/bin/ruby /home/rsimplicio/web/instiki/instiki.rb --daemon --port 8966 --storage /home/rsimplicio/web/instiki/storage/

Pinging/resolving to the Textdrive IP's

    _______________________________________
________| |_________
\ | davie.textdrive.com | /
\ | | /
\ | "kinda like a little brother" | /
/ |_______________________________________| \
/___________) (___________\



rsimplicio@davie$ ping simplicio.com
PING simplicio.com (207.7.108.101): 56 data bytes
64 bytes from 207.7.108.101: icmp_seq=0 ttl=64 time=0.033 ms
64 bytes from 207.7.108.101: icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from 207.7.108.101: icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from 207.7.108.101: icmp_seq=3 ttl=64 time=0.029 ms

My Typo Lighttpd host conditional

$HTTP["host"] =~ "(typo|blog)\.simplicio\.(com|net|org)" {
server.document-root = "/home/rsimplicio/web/public/typo/"

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "dispatch.fcgi")

fastcgi.server = ( ".fcgi" =>
( "Simplicio-typo" =>
(
"socket" => "/home/rsimplicio/web/lighttpd-typo-fcgi.socket",
"bin-path" => "/home/rsimplicio/web/public/typo/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "production" ),
"max-load-per-proc" => 25,
"min-procs" => 1,
"max-procs" => 1,
"idle-timeout" => 60
)
)
)
}

Tipping Point

TippingPoint's Intrusion Prevention Systems provide Application Protection, Performance Protection and Infrastructure Protection at gigabit speeds through total packet inspection. Application Protection capabilities provide fast, accurate, reliable protection from internal and external cyber attacks. Through its Infrastructure Protection capabilities, the TippingPoint IPS protects VoIP infrastructure, routers, switches, DNS and other critical infrastructure from targeted attacks and traffic anomalies. TippingPoint's Performance Protection capabilities enable customers to throttle non-mission critical applications that hijack valuable bandwidth and IT resources, thereby aligning network resources and business-critical application performance.

The system is built upon TippingPoint's Threat Suppression Engine (TSE) - a highly specialized hardware-based intrusion prevention platform consisting of state-of-the-art network processor technology and TippingPoint's own set of custom ASICs. The TippingPoint ASIC-based Threat Suppression Engine is the underlying technology that has revolutionized network protection. Through a combination of pipelined and massively parallel processing hardware, the TSE is able to perform thousands of checks on each packet flow simultaneously. The TSE architecture utilizes custom ASICs, a 20 Gbps backplane and high-performance network processors to perform total packet flow inspection at Layers 2-7. Parallel processing ensures that packet flows continue to move through the IPS with a latency of less than 215 microseconds, independent of the number of filters that are applied.

The TippingPoint TSE architecture also enables traffic classification and rate shaping. Sophisticated algorithms baseline "normal" traffic allowing for automatic thresholds and throttling so that mission critical applications are given a higher priority on the network.

Good Eats Roast Turkey

Recipe courtesy Alton Brown
Show: Good Eats
Episode: Romancing the Bird (A Good Eats Thanksgiving)

1 (14 to 16 pound) frozen young turkey
For the brine:
1 cup kosher salt
1/2 cup light brown sugar
1 gallon vegetable stock
1 tablespoon black peppercorns
1/2 tablespoon allspice berries
1/2 tablespoon candied ginger
1 gallon iced water
For the aromatics:
1 red apple, sliced
1/2 onion, sliced
1 cinnamon stick
1 cup water
4 sprigs rosemary
6 leaves sage
Canola oil

Combine all brine ingredients, except ice water, in a stockpot, and bring to a boil. Stir to dissolve solids, then remove from heat, cool to room temperature, and refrigerate until thoroughly chilled.
Early on the day of cooking, (or late the night before) combine the brine and ice water in a clean 5-gallon bucket. Place thawed turkey breast side down in brine, cover, and refrigerate or set in cool area (like a basement) for 6 hours. Turn turkey over once, half way through brining.
A few minutes before roasting, heat oven to 500 degrees. Combine the apple, onion, cinnamon stick, and cup of water in a microwave safe dish and microwave on high for 5 minutes.
Remove bird from brine and rinse inside and out with cold water. Discard brine.
Place bird on roasting rack inside wide, low pan and pat dry with paper towels. Add steeped aromatics to cavity along with rosemary and sage. Tuck back wings and coat whole bird liberally with canola (or other neutral) oil.
Roast on lowest level of the oven at 500 degrees F. for 30 minutes. Remove from oven and cover breast with double layer of aluminum foil, insert probe thermometer into thickest part of the breast and return to oven, reducing temperature to 350 degrees F. Set thermometer alarm (if available) to 161 degrees. A 14 to 16 pound bird should require a total of 2 to 2 1/2 hours of roasting. Let turkey rest, loosely covered for 15 minutes before carving.

(c) Food Network, Alton Brown

Gingered Sweet Potato Puree

Recipe courtesy Sara Moulton

2 tablespoons butter
1 cup chopped onions
8 medium sweet potatoes
3/4 cup milk
4 tablespoons butter
1/4 cup candied ginger, chopped, or to taste

Saute onions in butter until translucent. Set aside. Peel potatoes and cut into 1-inch pieces. Place potatoes in saucepan with cold salted water to cover and boil, covered, until very tender, about 15 minutes. Drain in colander. In a food processor, puree potatoes, milk, butter and Sauteed onions until smooth. Season with salt and pepper. Sprinkle with chopped candied ginger.

(c) Food Network, Sara Moulton

Lighttpd conditional for subdomain

$HTTP["host"] =~ "(typo|blog)\.simplicio\.(com|net|org)" {
server.document-root = "/home/rsimplicio/web/public/typo/"

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
  server.error-handler-404 = "/dispatch.fcgi" 
server.indexfiles = ( "dispatch.fcgi")

 fastcgi.server = ( ".fcgi" =>
   ( "Simplicio-typo" =>
        (
          "socket"   => "/home/rsimplicio/web/lighttpd-typo-fcgi.socket",
          "bin-path" => "/home/rsimplicio/web/public/typo/dispatch.fcgi",
          "bin-environment" => ( "RAILS_ENV" => "production" ),
          "max-load-per-proc" => 25,
          "min-procs" => 1,
          "max-procs" => 1,
          "idle-timeout" => 60
        )
    )
  ) 
}

Fried mac 'n' cheese

Recipe Summary
Difficulty: Easy
Prep Time: 20 minutes
Cook Time: 5 minutes

Leftover baked macaroni and cheese, refrigerated for at least overnight
1 cup all-purpose flour
1 teaspoon salt
1 teaspoon pepper
1 teaspoon cayenne
1 egg beaten with 2 ounces water
1 cup panko bread crumbs
Oil for deep frying, preheated to 375 degrees

Cut refrigerated macaroni and cheese into slices or bite size pieces.
Season the flour with salt, pepper and cayenne. Dredge each piece through the flour and gently tap off excess. Dip in the egg wash and then coat with the bread crumbs. Allow them to rest for 5 minutes so the crust can set. Very carefully drop into the oil and fry until golden brown. Remove to a baking sheet fitted with a rack and rest for 2 minutes before serving.

(c) Food Network, Alton Brown

The Chewy

Recipe Summary
Prep Time: 20 minutes
Cook Time: 15 minutes
Yield: 2 1/2 dozen cookies

2 sticks unsalted butter
2 1/4 cups bread flour
1 teaspoon kosher salt
1 teaspoon baking soda
1/4 cup sugar
1 1/4 cups brown sugar
1 egg
1 egg yolk
2 tablespoons milk
1 1/2 teaspoons vanilla extract
2 cups semisweet chocolate chips
Hardware:
Ice cream scooper (#20 disher, to be exact)
Parchment paper
Baking sheets
Mixer


Heat oven to 375 degrees F.
Melt the butter in a heavy-bottom medium saucepan over low heat. Sift together the flour, salt, and baking soda and set aside.

Pour the melted butter in the mixer's work bowl. Add the sugar and brown sugar. Cream the butter and sugars on medium speed. Add the egg, yolk, 2 tablespoons milk and vanilla extract and mix until well combined. Slowly incorporate the flour mixture until thoroughly combined. Stir in the chocolate chips.

Chill the dough, then scoop onto parchment-lined baking sheets, 6 cookies per sheet. Bake for 14 minutes or until golden brown, checking the cookies after 5 minutes. Rotate the baking sheet for even browning. Cool completely and store in an airtight container.

(c) Food Network, Alton Brown

DiG for gtcaz3

dig @dns1.textdrive.com alexandracheshire.com

; <<>> DiG 9.3.1 <<>> @dns1.textdrive.com alexandracheshire.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10904
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;alexandracheshire.com. IN A

;; ANSWER SECTION:
alexandracheshire.com. 2400 IN A 207.7.108.242

;; Query time: 33 msec
;; SERVER: 67.19.231.130#53(67.19.231.130)
;; WHEN: Wed Sep 7 19:59:38 2005
;; MSG SIZE rcvd: 55

DiG for gtcaz2

dig @dns1.textdrive.com cheshirelaw.textdriven.com

; <<>> DiG 9.3.1 <<>> @dns1.textdrive.com cheshirelaw.textdriven.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12577
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;cheshirelaw.textdriven.com. IN A

;; ANSWER SECTION:
cheshirelaw.textdriven.com. 2400 IN A 207.7.108.242

;; Query time: 39 msec
;; SERVER: 67.19.231.130#53(67.19.231.130)
;; WHEN: Wed Sep 7 19:55:01 2005
;; MSG SIZE rcvd: 60

DiG for Simplicio.com

dig @dns1.textdrive.com simplicio.com

; <<>> DiG 9.3.1 <<>> @dns1.textdrive.com simplicio.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45365
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;simplicio.com. IN A

;; ANSWER SECTION:
simplicio.com. 1200 IN A 207.7.108.101

;; Query time: 40 msec
;; SERVER: 67.19.231.130#53(67.19.231.130)
;; WHEN: Wed Sep 7 19:37:33 2005
;; MSG SIZE rcvd: 47

DiG for gtcaz

dig @dns1.textdrive.com cheshirelaw.com

; <<>> DiG 9.3.1 <<>> @dns1.textdrive.com cheshirelaw.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 57856
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;cheshirelaw.com. IN A

;; Query time: 38 msec
;; SERVER: 67.19.231.130#53(67.19.231.130)
;; WHEN: Wed Sep 7 19:51:25 2005
;; MSG SIZE rcvd: 33

Typo current error

NoMethodError in Admin/content#new 
undefined method `text_filter=' for #
app/controllers/admin/content_controller.rb:24:in `new'
Show framework trace 
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:1200:in `method_missing'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'
/home/rsimplicio/web/public/typo/dispatch.fcgi:20
/home/rsimplicio/web/public/typo/dispatch.fcgi:18:in `each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in `each'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in `each_cgi'
/home/rsimplicio/web/public/typo/dispatch.fcgi:18
    
Request
Parameters: None

Show session dump

--- 
:user: !ruby/object:User 
  attributes: 
    name: Robert
    id: "1"
    password: <snipped for security reasons>
    login: Robert
    email: 
:return_to: 
flash: !ruby/hash:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}
« Newer Snippets
Older Snippets »
15 total  XML / RSS feed