* Free Open Source Bitcoin Software #VooDooSphere: Doubleclick the voodoo-stabbed needle point tips piercing the world:

** PinColorKey: SteelGreyPins=BitcoinSites, OrangePins=ReasonsToUseBitcoins, OtherPins=BitcoinHistoryAndOutliers



Java needs to be toggled on to use the Globe Applet.

* Free Open Source Digital Currency Software, Secure Privacy Software and Favorite Links: AllAboutBitcoin AustralianExchange BitAddressOrg BitcoinAnalytics BitcoinAPI BitcoinArmory BitcoinBulkSales BitcoinBuying BitcoinCharity BitcoinClojure BitcoinExperts BitcoinExchangeTrust BitcoinFAQ BitcoinsForJobs BitcoinFoundation BitcoinPaperMoneyDropOffSpots BitcoinMuseum BitcoinNodes BitcoinOrg BitcoinNewsAggregator BitcoinOnlineGoodsAndServicesLinks BitcoinPaperWallet BitcoinQuickStart BitInstant BitMessaging BitMit BitPay BitPapa BitcoinThruEmail BitcoinThruSMS BitcoinThruTwitter BitcoinStuffExists BitcoinSoftware BitcoinTalk BitcoinTradingPlatformCoinsetter BitcoinTravel BitVoucher BitcoinWallets BlockChainInfo BoardGamesForBitcoin BTCrow BTC-e BTCChina BTCGlobalExperts CanBitcoinBeStopped? ChronoBit CoffeeForBitcoin Coinapult CoinBase CoinDeskNews CoinDownLoad CoinLab CopyrightProofForBitcoin CyprusBitcoinForum DataFileIntegrityProofForBitcoin DataFileTimestampProofForBitcoin DevCoinDevTome DomainNamesForBitcoin ElBitCoinOrg Electrum ElectronicFreedomFoundation EmailReceivingToBitcoinAddress EthosWorld FinancialArmageddonBlog FoodForBitcoin FoodlerLocalRestaurantsThatDeliverForBitcoin FreeBitcoinBankingBlog FreeBitcoinValorisationReport FreeBitcoinsForWatchingVideos FreeFileVerificationBitcoinSoftware FreeGovernmentSoftwareByPublicResourceOrg FreeGnuOrgModeGTD FreeNodeNetworkTorIRC FreeOpenSourceCoin FreeSoftwareFoundation FreeTalkLive FreeEncryptedTorChatIRC GermanBitcoinMarket GnuOrg GoldForBitcoin GoldSilverPlatinumForBitcon GovernmentTransparencyActivism GyftCardsForBitcoins GoldMiningPollution HowToBuyBitcoinsInAnyCountry HumbleBundleCharityForBitcoin Instawallet.orgFrozeMyBitcoinWalletPaymiumHelpedMeGetAllOfMyBitcoinBack ItcoinForum LamassuAfricanATM LibBitCoin LindseyWilliamsLatestWarningsUpdate ListenToBitcoin MyBitcoin.comStoleHalfMyBitcoins NamecoinProvableVotingAndMuchMore NotaryPublicProofForBitcoin OpenSourceEnterpriseSoftware Paymium PikaPayBitcoinThruTwitter PrismFreeSoftware PublicResourceOrg Pyramining.comRequiresReferralSponsorStayAway SatoshiNakamoto? StrongCoin.comCharges1%ToSendBitcoinsStayAwayRipOff TimestampProofForBitcoin TempSendFreeAndSafeFileSharing TradeHill TwitterFreeBitcoin TorPrivateBrowsing UnoCoin Vircurex VirtualWorldCurrencyExchange WeiDaiFreeCryptoSoftwarePioneer WhyDoesBitcoinHaveValue? WineForBitcoin WebMoney ZipBit

* Photo Cube:

* Add your own needles to the Bitcoin GeoSphere: Email: BrianGPowellMS@Yahoo.com

* .........: ..................................

* Favorite quotes:

"Bitcoin is a digital currency, a protocol, and [it is software that is a] free, open-source project released under the MIT license."--Bitcoin Foundation, owners of "Bitcoin.org"

"[Vires Numeris:] If enough people support Bitcoin there is no stopping it either by technical or legal means." --BitcoinQuickStart.com

"Creating encrypted and unbreachable Bitcoin wallets can be as simple as these (4) steps, with or without owning a networked computer:

1. Access an Internet networked computer and browse "https://www.bitaddress.org" or if you own a computer you can do something like this instead: "apt-get install bitcoind ; bitcoind & ; bitcoind getnewaddress ; bitcoind dumpprivkey {mybitcoinaddress}

2. Write down on a piece of paper and conceal the public key and the private key, revealed in step (1) above; these numbers are also known as: the public "Bitcoin Address" and the private "Private Key", respectively.

3. Buy or mine Bitcoins and then send some Bitcoins to the public Bitcoin address and maybe monitor the influx of coins by going to "https://BlockChain.Info" and typing in the public Bitcoin address (only the public Bitcoin address should be typed into the website--do not type the private key or show it to anyone), type the public Bitcoin address into the "Search" box and click the "Search"--the Blockchain website will show the Bitcoin money on the website. All the transactions to the address will be instantly viewable by anyone, anywhere and at any time--its effectively a "public ledger".

4. When you want to "break open" the "Bitcoin Piggy Bank" you can put the funds on any computer and install any Bitcoin Client program (e.g. "bitcoind") by importing old funds into your new wallet (and new private number only you know about). To do this: Go to any online exchange and use the "redeem" feature to put them into a Bitcoin private client program installed on a computer like "bitcoind" (on a private computer you own) by typing something like: bitcoind importprivkey {myprivatekey}. This can be easily done since the blockchain database contains the data for every interaction of every Bitcoin client that is replicated and available to all computers worldwide; so, its easy to regenerate the whole database of all transactions on a new computer when a computer breaks or a computer is stolen--all transactions are stored in the Blockchain databases of all the other Bitcoin client computers.

Thats it, these 4 steps (maybe even just 2 steps), or something similar, are all one needs to do, you don't even need to own a computer to save Bitcoins, even if you do your computer can break down; but, if you have saved the Bitcoin address and the private key, just those two numbers, then you can still easily recover them into an online site by using the "Redeem" feature which is available on all Bitcoin exchanges and personal Bitcoin client programs which you can install later on a new computer--your transaction information and Bitcoins will always be available." --Brian G. Powell

"Wow! You can use Coinapult.com to send money through email!" --Brian G. Powell

"ColdPaperSeeThruBitcoinPiggyBank<=>Go to bitaddress.org=>Write down 2 numbers=>View/redeem at http://BlockChain.Info! That's All Folks!" --Tweeted by Brian G. Powell

"It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." --Albert Einstein

"[Everything should be made as simple as possible, but no simpler.]" --[Paraphrasing] Albert Einstein

"Bitcoin: Be your own bank." --Anonymous

"Bitcoin is the only hard currency that one can use to safely and freely send encrypted money very quickly to anyone in the world at any time." --Anonymous

"Bitcoin is a MOIP protocol: Bitcoin is a Money Over Internet Protocol." --Anonymous

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" --[In the Bitcoin network's transaction database, the original entry by] Satoshi Nakamoto

"[Currently Bitcoins can be traded or donated in denominations as low as 0.00000001 (Bitcoin) also known as 1 Satoshi.]" --Bitcoin.it/wiki/FAQ

"The last block that will generate coins will be block #6,929,999 which should be generated at or near the year 2140. The total number of coins in circulation will then remain static at 20,999,999.9769 BTC." --Bitcoin.it/wiki/FAQ

"The smallest value represented and captured in the Bitcoin databases is called "1 Satoshi", if by analogy it were a "Dollar", then ultimately there will be an ~2100000000000000 "Dollar" ceiling, so, there will be a total of ~2.1 quadrillion Bitcoin "Dollars" so to speak, that would be representable in the Bitcoin economy. The money supply of the world is ~$46.513 trillion dollars; so, the entire world money supply could easily be represented entirely in Bitcoins." --Brian G. Powell

"Bitcoin is a "public ledger", and Bitcoin is not so much a "currency" as an "emergent phenomenon". It makes things possible that have nothing to do with money." --Robert Graham

"You can't counterfeit or reverse a Bitcoin transaction. No one can. The network that verifies and secures Bitcoin transactions is several times more powerful than the top 500 most powerful computers in the world combined." --WhyIsntBitcoinWorthless.com

"[Bitcoin can be used] without relying on middle men, like payment processors, and avoid all the fees and hassles associated with them." --WhyIsntBitcoinWorthless.com

"[Bitcoin can be used] as a token to represent something else, such as a share of stock, and then issue, sell, transmit, and trade it using the Bitcoin protocol, without a need for investment banks or brokerages." --BitcoinX.org

"You can use it for triple-entry accounting, which has the potential to change finance as much as the invention of double-entry accounting has." --Ian Grigg

"You can insert a hash of a document into a Bitcoin blockchain, creating a permanent notarized signature for the document, which proves when it was created and that it hasn't been tampered with." --ProofOfExistence.com

"Bitcoin may be the TCP/IP of money." --Paul Buchheit

"First post-apocalyptic law: Slavery in all forms is now illegal--including debt slavery. #BITCOIN" --Roseanne Barr

"From the Atlantic to the Pacific our country has been ravaged and laid waste by the evil practices of the the Federal Reserve banks and the interests which control them." --Former bank president and soon to be assassinated Congressman McFadden

"The Federal Reserve Act is the worst legislative crime of the ages." --Congressman Charles Lindbergh, Sr., father of the famous aviator.

"If you are still using #FiatCurrencies like #USD #USDollar, then you support #DebtSlavery,#Bitcoin is #DebtFreeMoney; #GetchaSomeBitcoin!" --Tweeted by Brian G. Powell

"In the same way that Bitcoin is a decentralised currency that cannot be shut down; Namecoin is the basis for a decentralised domain name system (DNS), i.e. web URLs, which could put a stop to Internet censorship." --CoinDesk.com

"There are plenty of possible uses [for Namecoin], such as DNS, Alias/Identity (storage of email, name, gpg key, BTC-address), Timestamping of documents (a document hash of name, hash, owner, etc), Broadcasting / Messaging, a web of trust, issuance and tracking of bonds & shares, secure and provable voting." --Namecoin.org

"[Namecoin facilitates secure registration and transfer of] arbitrary names (keys), no possible censorship!" --Namecoin.info

"The American democratic political system is degenerate, corrupt and ineffective. Our presidents sold us out. This is a two-headed, one party system. Stay Home, Don't Vote! Restore the Bill Of Rights. Stop supporting corrupt systems. Now is the time for the Second Revolution of the United States Of America. [I've bought and restored some of the capital of New York State, burned down in Kingston, New York in 1777. Founding fathers warned us about the moneychangers. Come to Kingston, and we can work to restore America.]" --Gerald Celente

"http://prism-break.org is a great Internet site to visit to begin to reclaim your #BillOfRights from the #NSA. Other simple security measure: Use EncFS to encrypt whole disk drives. Lastly, here is a simple example of an encryption and then a decryption of a file that has been tested on a Linux machine: openssl enc -aes-256-cbc -salt -in j.j -out k.j -pass pass:blah && openssl enc -aes-256-cbc -salt -in k.j -out j.j -pass pass:blah -d " --Brian G. Powell

"Whether it's the Constitution or a building code, the law is part of the public domain." --EFF Intellectual Property Director Corynne McSherry.

"It's about time Standards Development Organizations recognized that if a technical standard has been incorporated into federal law, the public has a right to read it, speak it and copy it freely." --Public.Resource.Org founder and Government Transparency Activist Carl Malamud.

* Free Bitcoin KML Embed Map Links at BitcoinMap.com:

* Today is 2022/12/04. Tomorrow is 2022/12/05. Seconds since zero hour: 1670130214. Seconds since zero hour to 9/11: 1000000000.
1
One

;*LEAVE AT TOP OF FILE!!
(load "/root/n/n/lib/elisp/tempo")
(load "/root/n/n/lib/elisp/template")
;*LEAVE AT TOP OF FILE!!--and yes, the below is the "meta-tempo-template"
(tempo-define-template
 "elisp-bgp_tempo-template-meta-tempo-template" ; template name
 '("\(tempo-define-template
 \"tttblahcomputerlanguage-bgp_tttblah-example-program-name\" \; template name
 \'\(\"#*Blah ttt documentation.
tttPut template/example blah-programming-language source here.

\"\) \; definition
\"s-jj\" \; abbreviation
\"Inserts an tttBLAHCOMPUTERLANGUAGE program\"\) \; documentation

") ; definition
"s-jj" ; abbreviation
"Inserts an ELISP tempo-template.") ; documentation



(tempo-define-template
 "orgmode-bgp_mashable-projects-stub" ; template name
 '("* MashableProjects: 
** Tasks/Plans/ToDoLists: [[shell:echo Plan A: 1. 2. 3.][/u/16x16_725_Julia_sets_408x408_too-dark-orange.png]]*[[shell:echo Plan B: 1. 2. 3.][/u/16x16_725_Julia_sets_408x408_too-dark-orange.png]]
** Makefiles/ConfigurationFiles:
** RecentPrograms/Source/Code:
** Prototypes/Ideas/Brainstorms: [[shell:echo ][/u/16x16_725_Julia_sets_408x408_too-dark-orange.png]] 
** RecentDocs/WhitePapers/URLs:
") ; definition
"s-jj" ; abbreviation
"Inserts a EMACS ORGMODE program stub") ; documentation


(tempo-define-template
 "xml-bgp_xml2csv" ; template name
 '("#*A .xml file can be changed to a .csv with the following files: 
#*To do the job: 

xalan -o blah.csv blah.xml blah.
m                                  
") ; definition
"s-jj" ; abbreviation
"Inserts a how-to hack to make a csv2xml conversion program which creates a .xml file.") ; documentation


(tempo-define-template
 "xml-bgp_csv2xml" ; template name
 '("#*A .csv file can be changed to a .xml with the following files: blah.csv, a blahProps.txt file (that contains the properties which you easily tweak) and of course the output file would be blah.xml

#*To do the job once all the files are ready/names decided on: java -jar /root/n/n/lib/CSVToXML/www.dpawson.co.uk/java/code/src/CSVtoXML.jar -p /root/n/n/lib/CSVToXML/resources/attsProps.txt /root/n/n/lib/CSVToXML/www.dpawson.co.uk/java/code/src/test.csv -o blah.xml

#**And here is an example blahProps.txt (again, feel free to tweak this to get a .xml file close to what is sought):

[head]
comment=Generated using CSVToXML
fielddelimiter=,x
rowdelimiter=\\n
rootname=doc 
recordname=entry
fields=4

[fields]
field0=attsID
field1=prodID
field2=att
field3=desc

") ; definition
"s-jj" ; abbreviation
"Inserts a how-to hack to make a csv2xml conversion program which creates a .xml file.") ; documentation





(tempo-define-template
 "bash-bgp_shell-error-handling-snippet" ; template name
 '("#*Shell programs should have error handling.
#**This example shows how to use the -p switch and the \"$?\" token (for stderr obviously).
#***The -p switch to mkdir will create all the directories in the $dimension string recursively and it will not complain if any or all directories already exist.
#****So the main reason for the error handling here is to flag problems with user permissions.
mkdir -p $dimension
if [ $? -ne 0 ]; then
  echo \"Error: Could not create directory $dimension\"
  return 1
fi
") ; definition
"s-jj" ; abbreviation
"Inserts a bash/ksh/sh error handling snippet example program") ; documentation


(tempo-define-template
 "bash-bgp_bash-global-variables-commonly-used-default-global-variables" ; template name
 '("#!/bin/bash

#*This file contains commonly used default global variables.
#**Test: Copy and paste this file or put this in the bash shell script:
# . /bash-global-variables.sh
#***Worked well in the /dp bash script
#**The global variables below should print out by doing: env

set +xue

export V_UNIQUE_ID=z$(date +%s)
export V_UNIQUE_ID_MICROSECONDS=$(/time-since-1970-in-microseconds.pl) 
export V_WATERMARK_DATE=$(date +%Y%m%d)
export EXCLAMATIONPOINT=!
export COLUMNS LINES
export USERNAME ENV PATH
export EDITOR=emacs
export CVSEDITOR=emacs


") ; definition
"s-jj" ; abbreviation
"Inserts often used bash global variables and/or settings.") ; documentation


(tempo-define-template
 "bash-bgp_shell-error-handling-snippet" ; template name
 '("#*Shell programs should have error handling.
#**This example shows how to use the -p switch and the \"$?\" token (for stderr obviously).
#***The -p switch to mkdir will create all the directories in the $dimension string recursively and it will not complain if any or all directories already exist.
#****So the main reason for the error handling here is to flag problems with user permissions.
mkdir -p $dimension
if [ $? -ne 0 ]; then
  echo \"Error: Could not create directory $dimension\"
  return 1
fi
") ; definition
"s-jj" ; abbreviation
"Inserts a bash/ksh/sh error handling snippet example program") ; documentation


(tempo-define-template
 "cvs-bgp_ckin-documentation" ; template name
 '("
CVS: -------------------------------------------------------------------
CVS: By checking in these files and flagging them Ready for Review, you
CVS: are certifying that the modifications have been thoroughly tested
CVS: by confirming that, at a minimum, the following have been completed:
CVS:    ensure changes identified in the requirement have been addressed
CVS:    execute software on the inside AND outside servers
CVS:    remove all debug messages
CVS:    test on appropriate platforms, Solaris and Linux
CVS:    test with all supported browsers
CVS:    examine error logs for warnings and errors
CVS:    verify the PACER billing function when appropriate
CVS:    utilize SET EXPLAIN ON with a 'big' database
CVS: -------------------------------------------------------------------

Issue: 
Task:
MR: 

Ready for review: y

Comments: None.

Installation requirements: None.

Configuration requirements: None.

 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts a CVS header") ; documentation


(tempo-define-template
 "sqlite-bgp_sqlite-command-line-interface" ; template name
 '("#*SQLITE command-line-interface session.  To use this tempo-template paste it into an eshell.
mv --backup=numbered /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/demodb.db /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/demodb_bak.db
sqlite3 /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/demodb.db
.echo on
.timeout 555
.headers on
.read /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/demodb.sql 
.read /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/sampledata.sql
.schema TIMESHEETS
.schema 
.indices TIMESHEETS
.mode list
.nullvalue .
.separator |
.tables t
.tables time
.mode html
SELECT * FROM TIMESHEETS;
.mode list
SELECT * FROM TIMESHEETS;
.dump
.dump timesheets
.explain
EXPLAIN SELECT * FROM TIMESHEETS;
.output blahoutputfile.j
.output stdout
.help
.mode list
.show
.exit
sqlite3 -init /root/n/n/lib/sqlite/.sqliterc -header -nullvalue . -list -separator '|' /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/demodb.db 'SELECT * FROM TIMESHEETS; SELECT * FROM EMPLOYEES;' 
sqlite3 -header -nullvalue . -list -separator '|' /root/n/n/lib/sqlite/sqlite-a-practical-quide_book_by_ChrisNewman/SQLite/02/demodb.db 'SELECT * FROM EMPLOYEES;' | sed -e 's/|/ /g' | awk '{printf \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\",$1,$2,$3,$4,$5}'

 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts a demo sample example database into an sqlite command-line-interface interactive session") ; documentation



(tempo-define-template
 "mysql-bgp_create-amarok-music-database" ; template name
 '("mysql -p -u root
CREATE DATABASE amarokdb;  
USE mysql;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES,
INDEX ON amarokdb.*
TO amarok@55.55.55.55
IDENTIFIED BY 'blahpassword';
FLUSH PRIVELEGES;

 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts a MYSQL program") ; documentation


(tempo-define-template
 "sqlite-bgp_transfer-sqlite-music-database-to-mysql-database" ; template name
 '("echo \"*Transfer SQLITE data to MYSQL database\" 
sqlite3 collection-of-music.db .dump | grep -v \"BEGIN TRANSACTION;\" | grep -v \"COMMIT;\" | perl -ne \"s/INSERT INTO \\\"\(.*\)\" VALUES/INSERT \\1 VALUES/; print\" | mysql -u root -p amarok

 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts an SQLITE program") ; documentation


;; (tempo-define-template
;;  "informix-bgp_user-group" ; template name
;;  '("--*To see all of the ROLETYPE table.
;; SELECT * FROM USER_GROUP
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation



;; (tempo-define-template
;;  "informix-bgp_document-type" ; template name
;;  '("--*To see all of the ROLETYPE table.
;; SELECT * FROM DOCUMENT_TYPE
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation

;; (tempo-define-template
;;  "informix-bgp_user-program" ; template name
;;  '("--*To see all of the ROLETYPE table.
;; SELECT * FROM USER_PROGRAM
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation

;; (tempo-define-template
;;  "informix-bgp_program-group" ; template name
;;  '("--*To see all of the ROLETYPE table.
;; SELECT * FROM PROGRAM_GROUP
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation


(tempo-define-template
 "email-bgp_weekly-activity-report" ; template name
 '("* Week Ending: 7/8/2005   (- 28 (+         (+ 0 0 0 0) (+ 0 0 0 0) (+ 0 0 0 0) (+ 0 0 0 0) (+ 0 0 0 0) (+ 0 0 0 0) (+ 0 0 0 0) (+ 0 0 0 0)    0             0))    
* Calculation Template:      Total weekly hrs: Task:   (1090)      (1325)      (1326)      (1327)      (1328)      (1329)      (1330)      (1354)  Team Meetings:  Fire Drill and/or Emergency:

** Worked on these tasks:

*** Task 1090: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1325: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1326: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1327: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1328: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1329: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1330: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Task 1354: Analysis: 0 Hour(s), Design: 0 Hour(s), Code: 0 Hour(s), Unit Test: 0 Hour(s)

*** Software Team Meeting(s): 0 Hour(s)

*** Fire Drill and/or Emergency: 0 Hour(s)

** Configuration and Testing Review Meetings or related software team meetings for these tasks : 1090, 1325, 1326, 1327, 1328, 1329, 1330, 1354                                     

** Reviewed the documentation and/or attended Software Review meetings for these tasks: 1090, 1326, 1327

*** Updated and uploaded the documentation to the repository machine for these tasks: 1090, 1326, 1327

*** The documentation for these tasks seem ready for initial joint application development reviews: 1326

 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts a weekly activity report program") ; documentation

;; (tempo-define-template
;;  "informix-bgp_qryIndividualSummary" ; template name
;;  '("--*To see all of the SITE table.
;; select
;; distinct
;; cs_caseid,
;; cause.co_translation cause,
;; cn_citation,
;; cn_cittext,
;; cn_offense_level,
;; cn_count,
;; int_code,
;; county.co_translation county,
;; cs_date_filed,
;; cs_date_reopen,
;; cs_date_term,
;; cs_jstype,
;; cs_office,
;; cs_reopen_code,
;; cs_restrict_view,
;; cs_type,
;; custody.co_translation custody_status,
;; disposition.co_translation disposition,
;; fee.co_translation fee_status,
;; j5_date_end,
;; j5_dollar_demand,
;; j5_nature_of_suit,
;; jurisdiction.co_translation jurisdiction,
;; jury.co_translation jury_demand,
;; office.co_translation office,
;; cn_sub_type
;; from
;; case,
;; outer (count,
;; outer cr_interval),
;; outer codes office,
;; outer codes fee,
;; outer codes county,
;; outer codes disposition,
;; outer codes jurisdiction,
;; outer (cr_location,
;; outer codes custody),
;; outer (js56,
;; outer codes jury,
;; outer codes cause)
;; where cs_caseid = '61136'
;; and cn_caseid = cs_caseid
;; and cn_caseid = '61136'
;; and cn_date_end is null
;; and int_caseid = cn_caseid
;; and int_caseid = '61136'
;; and int_cn_seqno = cn_seqno
;; and int_date_end is null
;; and office.co_type = 'office'
;; and office.co_code = cs_office
;; and fee.co_type = 'feetype'
;; and fee.co_code = cs_fee_status
;; and county.co_type = 'county'
;; and county.co_code = cs_county
;; and disposition.co_type = 'dispcv'
;; and disposition.co_code = cs_disp_method
;; and j5_caseid = cs_caseid
;; and j5_caseid = '61136'
;; and j5_date_end is null
;; and jurisdiction.co_type = 'jurisdic'
;; and jurisdiction.co_code = cs_juris
;; and jury.co_type = 'jurydema'
;; and jury.co_code = j5_jury_demand
;; and cause.co_type = 'cause'
;; and cause.co_code = j5_cause
;; and loc_caseid = cs_caseid
;; and loc_caseid = '61136'
;; and loc_date_end is null
;; and custody.co_type = 'crlocation'
;; and custody.co_code = loc_code
;; order by
;; cn_sub_type,
;; cn_count
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation

(tempo-define-template
 "texinfo-bgp_images-private" ; template name
 '("@ignore software changes
@page

@c@page

@c @group ... @end group --prevents a pagebreak/glues together a \"vertical group\"
@c @group
@c @end group


@c @group

@c@float Figure,fig:ex1
@c This is an example float.
@c@end float

@c@node List of Figures
@c@unnumbered List of Figures
@c@listoffloats Figure

@table @code

@item  @bullet{} @space @r{Figure 1: Snapshots of software changes for MRggg of Task aaa.}

@image{/root/n/n/etc/task-aaa-project/taskaaa_1,,7in}

@end table

@page

@table @code

@item  @bullet{} @space @r{Figure 2: Snapshots of software changes for MRggg of Task aaa.}

@image{/root/n/n/etc/task-aaa-project/taskaaa_2,,7in}

@end table

@page

@table @code

@item  @bullet{} @space @r{Figure 3: Snapshots of software changes for MR1145 of Task 1354.}

@image{/root/n/n/etc/task-aaa-project/taskaaa_3,,7in}

@end table

@page
@end ignore

 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts a TEXINFO program") ; documentation

;; (tempo-define-template
;;  "informix-bgp_site" ; template name
;;  '("--*To see all of the SITE table.
;; SELECT * FROM SITE
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation


;; (tempo-define-template
;;  "informix-bgp_group" ; template name
;;  '("--*To see all of the SITE table.
;; SELECT * FROM GROUP
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation


;; (tempo-define-template
;;  "informix-bgp_menu" ; template name
;;  '("--*To see all of the MENU table.
;; SELECT * FROM MENU
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation

;; (tempo-define-template
;;  "informix-bgp_user-group" ; template name
;;  '("--*To see all of the MENU table.
;; SELECT * FROM USER_GROUP
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation


(tempo-define-template
 "email-bgp_announce-task-completion" ; template name
 '("From: 	  	
Brian Powell/DCA/AO/USCOURTS
To: 	  	
Jamal Rafidi/DCA/AO/USCOURTS@USCOURTS
cc:	 	
bcc:	 	
Date: 	  	
Wednesday, July 13, 2005 09:31AM
Subject: 	  	
Task 1090 and Task 1327 

*Met with JF yesterday about these two tasks: We did some investigations and tests and reviewed the documentation.

**I pulled some tables (the SITE and MENU tables) out of the database to insure that the system was working with the changes JF made before.

*Task 1090 and Task 1327 seem to be ready for a joint application development meeting or teleconference and the documentation has been updated and delivered to the repository. 


 ") ; definition
 "s-jjj" ; abbreviation
 "Inserts a boilerplate email message") ; documentation

;; (tempo-define-template
;;  "email-bgp_announce-task-meeting-request" ; template name
;;  '("From: 	  	
;; Jamal Rafidi/DCA/AO/USCOURTS
;; To: 	  	
;; Brian Powell/DCA/AO/USCOURTS@USCOURTS
;; cc:	 	
;; Bruce Curran/DCA/AO/USCOURTS@USCOURTS, Jacob Davenport/DCA/AO/USCOURTS@USCOURTS
;; bcc:	 	
;; Date: 	  	
;; Monday, August 08, 2005 03:32PM
;; Subject: 	  	
;; Re: 1325, 1326, 1328 

;; *Jacob needs to edit the files related to these tasks: Are you available for a mtg today?
;; **Or can I just go ahead and \"ckin\" the files he wants?

;; \"I also need this file.  Please let me know when I can have it.

;; Thanks,
;; Jacob \"

;; -----Brian Powell/DCA/AO/USCOURTS wrote: -----

;; To: Brian Powell/DCA/AO/USCOURTS@USCOURTS
;; From: Brian Powell/DCA/AO/USCOURTS
;; Date: 08/08/2005 10:50AM
;; cc: Jamal Rafidi/DCA/AO/USCOURTS@USCOURTS
;; Subject: 1325, 1326, 1328

;; *Per our mtg this morning: I have checked out the software programs for the tasks 1325, 1326, 1328 as you requested and they are ready to be demonstrated to you and then checked in.
;; **When is a good time for us to meet for the demonstrations?  Any time is fine with me.  See you later.

;; Thanks Jamal.

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts a boilerplate email program") ; documentation


;; (tempo-define-template
;;  "informix-bgp_codes" ; template name
;;  '("--*To see all of the CODES table.
;; SELECT * FROM CODES
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation


;; (tempo-define-template
;;  "informix-bgp_judge" ; template name
;;  '("--*To see all of the JUDGE table.
;; SELECT * FROM JUDGE
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation


;; (tempo-define-template
;;  "informix-bgp_jdg-index" ; template name
;;  '("--*To see all of the JUDGE table.
;; SELECT * FROM JDG_INDEX
;; ;

;;  ") ; definition
;;  "s-jjj" ; abbreviation
;;  "Inserts an INFORMIX program") ; documentation





;*The following snippet is from the www.iodbc.org.html (the main page--the rest was wget -m -np'd!!) website: It caught my eye since it has a very clean and simple interface and a great web 2.0 interface--excellent example of PHP and XHTML and web site programmin'!
(tempo-define-template
 "php-bgp_www.iodbc.org.html" ; template name
 '("



  

    
    

    

    

    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    

    

    

    

    

    

    

    

    

    iODBC.org

    
    

  

  




[ \"XML\" ]

") ; definition "s-jj" ; abbreviation "Inserts a non-AJAX JavaScript program that uses PROTOTYPE library") ; documentation ;**The following is similar to the above but each headline appears as before but this time it is enumerated: ;*AJAX could have been more accurately named [AS]JAX--since the XMLHttpRequest object may make its HTTP request syncronously (forcing the browser to wait until the response has been completely received) be ;**An exciting reason to use AJAX/[AS]JAX is that the POST method (of the HTTP) can send arbitrarily long content to the server. (tempo-define-template "javascript-bgp_asjax-create-cross-platform-XMLHttpRequest-object" ; template name '("function getXMLHttpRequest () { try { return new ActiveXObject(\"Msxml2.XMLHTTP\"); } catch(e) {}; try { return new ActiveXObject(\"Microsoft.XMLHTTP\"); } catch(e) {} try { return new XMLHttpRequest(); } catch(e) {}; return null; } var xhr = getXMLHttpRequest(); ") ; definition "s-jjj" ; abbreviation "Inserts a function that give our application cross-platform compatibility and makes an XMLHttpRequest object and makes an application [AS]JAX-ready.") ; documentation ;**AJAX code like the code above can be done more simply if one uses PROTOTYPE--PROTOTYPE provides libraries that do the cross-platform game for you! The following 3 or 4 files will create AJAX/[AS]JAX--in a simpler and better way (depending on what the powers that be allow you to do--some may not allow PROTOTYPE (which will be the final piece of code below: ;**Can use ruby-on-rails and ajax-javascript-prototype library: (tempo-define-template "ruby-bgp_ruby-on-rails-using-ajax-javascript-prototype-library" ; template name '("#*Use a line like this to load a ruby-on-rails implementation of the PROTOTYPE javascript libraries <%= javascript_include_tag \'prototype\' %> ") ; definition "s-jj" ; abbreviation "Inserts a ruby program") ; documentation ;**Can use javascript and ajax-javascript-prototype library: (tempo-define-template "javascript-bgp_asjax-javascript-prototype-library-call" ; template name '("#*Use a line like this to load a javascript implementation of the PROTOTYPE javascript libraries ") ; definition "s-jj" ; abbreviation "Inserts a ruby program") ; documentation ;***Here is the latest prototype.js (WHICH I WILL COMMENT OUT SINCE I DON'T WANT TO LOAD IT INTO MEMORY EACH TIME BUT WANT IT HANDY EVERYWHERE I DEVELOP CODE) file from prototype.conio.net/dist put it in a file in your JavaScript dir in your website dir and then load it with a line like this

Simple form

Field1:

") ; definition "s-jj" ; abbreviation "Inserts a non-AJAX JavaScript program and XHTML markup text that changes the headline when text is entered into the text field.") ; documentation (tempo-define-template "javascript-bgp_xhtml-and-prototype-changes-headline-to-the-text-entered" ; template name '("#*Same as above but uses javascript PROTOTYPE library: This is Listing 2. simpletext-prototype.html (really its XHTML!) Title

Simple form

Field1:

") ; definition "s-jj" ; abbreviation "Inserts a non-AJAX JavaScript program that uses PROTOTYPE library") ; documentation ;**The following will set 2 headlines rather than just 1 (tempo-define-template "javascript-bgp_xhtml-and-prototype-changes-headline-to-the-text-entered" ; template name '("#*Same as above but uses javascript PROTOTYPE library: This is Listing 2 (with a tiny addition) simpletext-prototype.html (really its XHTML!) Title

Simple form

Field1:

") ; definition "s-jj" ; abbreviation "Inserts a non-AJAX JavaScript program that uses PROTOTYPE library") ; documentation ;**The following is similar to the above but each headline appears as before but this time it is enumerated: (tempo-define-template "javascript-bgp_xhtml-and-prototype-changes-headline-to-the-text-entered-and-enumerates-them" ; template name '("#*Same as above but uses javascript PROTOTYPE library and enumerates entered headlines: This is Listing 3. simpletext-each.html (really its XHTML!) Title

Simple form

Field1:

") ; definition "s-jj" ; abbreviation ;**Now on to using AJAX and the POST method rather than the GET method--POST is better for many reasons--this application/webpage uses Ajax to check whether a user name was already taken when an individual registers for a Web site "Inserts an AJAX JAVASCRIPT program that uses the POST method--see Listing 4. post-ajax-register.html of http://interactive.linuxjournal.com/article/9422 ") ; documentation (tempo-define-template "javascript-bgp_xhtml-and-asjax-and-no-prototype-webpage-checks-usernames-registered-on-website" ; template name '("#*checks-usernames-registered-on-website and uses the POST method--better for many reasons Register

Register

Username:

Password:

E-mail address:

") ; definition "s-jj" ; abbreviation "Inserts an tttBLAHCOMPUTERLANGUAGE program") ; documentation ;**Now on to more interesting things--JavaScript AND XHTML AND PROTOTYPE AND AJAX!! (tempo-define-template "javascript-bgp_xhtml-and-asjax-and-prototype-webpage-checks-usernames-registered-on-website" ; template name '("#*This is the best of show--altogether now: xhtml-and-asjax-and-prototype Listing 5. ajax-register-prototype.html of http://interactive.linuxjournal.com/article/9422 Register

Register

Username:

Password:

E-mail address:

") ; definition "s-jj" ; abbreviation "Inserts an tttBLAHCOMPUTERLANGUAGE program") ; documentation ;**Lastly, we need some PERL code to cover the back-end programs check-name-exists.pl and register.pl of course though (tempo-define-template "perl-bgp_check-name-exists.pl-and-register.pl-and-an-sql-table" ; template name '("#*These two programs are used by the javascript-ajax-prototype masterpiece example program above. Here are check-name-exists.pl and register.pl: #Listing 3. check-name-exists.pl http://interactive.linuxjournal.com/article/9295: #!/usr/local/bin/perl use strict; use diagnostics; use warnings; use CGI; use CGI::Carp; # Define the usernames that are taken # (Use a hash for lookup efficiency) my %usernames = ('abc' => 1, 'def' => 1, 'ghi' => 1, 'jkl' => 1); # ------------------------------------------------------------ my $query = new CGI; print $query->header(\"text/plain\"); # Get the POST data my $postdata = $query->param(\"POSTDATA\"); # Get the username my ($name, $value) = split /=/, $postdata; my $username = ''; if ($name eq 'username') { $username = $value; } # If this username is defined, say \"yes\"! if (exists $usernames{$username}) { print \"yes\"; } # Otherwise, say \"no\"! else { print \"no\"; } #Listing 2. register.pl see http://www.linuxjournal.com/article/9160 #!/usr/bin/perl use strict; use diagnostics; use warnings; use CGI; use DBI; # ------------------------------------------------------------ # # Connect to the database # ------------------------------------------------------------ # my $dbname = 'atf'; my $dbuser = 'reuven'; my $dbpassword = ''; my $dbh = DBI->connect(\"DBI:Pg:dbname=$dbname\", $dbuser, $dbpassword, { AutoCommit => 1, RaiseError => 1, PrintError => 1, ChopBlanks => 1}) || print \"

Error connecting: '$DBI::errstr'

\"; # ------------------------------------------------------------ # CGI startup # ------------------------------------------------------------ my $query = new CGI; print $query->header(\"text/html\"); print $query->start_html(-title => \"Site registration\"); my $username = $query->param(\"username\"); my $password = $query->param(\"password\"); my $email_address = $query->param(\"email_address\"); # ------------------------------------------------------------ # Check the parameters # ------------------------------------------------------------ my @missing_data = (); push @missing_data, \"The username\" unless $username; push @missing_data, \"A password\" unless $password; push @missing_data, \"The e-mail address\" unless $email_address; if (@missing_data) { foreach my $missing_field (@missing_data) { print \"

Sorry, but you are missing:

\n\"; print \"
    \n\"; print \"
  • $missing_field
  • \n\"; print \"
\n\"; print \"

Please back up and try again.

\n\"; exit; } } # ------------------------------------------------------------ # Try to register the user # ------------------------------------------------------------ my $select_sql = \"SELECT COUNT(*) FROM Users WHERE username = ?\"; my $select_sth = $dbh->prepare($select_sql); $select_sth->execute($username); my ($username_is_taken) = $select_sth->fetchrow_array(); # Is this username taken? If so, give an error if ($username_is_taken) { print \"

Sorry, but the username '$username' was already taken. Please back up and try again.

\n\"; } # Otherwise, insert the new trio into the database else { my $insert_sql = \"INSERT INTO Users (username, password, email_address) VALUES (?, ?, ?)\"; $dbh->do($insert_sql, {}, $username, $password, $email_address); print \"

Added the username '$username' to the system!

\n\"; } print $query->end_html; #*SQL table needed for database load of usernames and passwords (iff they are new and unique--tested by the perl and javascript programs above) see http://www.linuxjournal.com/article/9160 CREATE TABLE Users ( id SERIAL NOT NULL, username TEXT NOT NULL CHECK (username <> ''), password TEXT NOT NULL CHECK (password <> ''), email_address TEXT NOT NULL CHECK (email_address <> ''), PRIMARY KEY(id), UNIQUE(username) ); ") ; definition "s-jj" ; abbreviation "Inserts 2 Perl programs") ; documentation ;*TEMPLATES START HERE! (tempo-define-template "javascript-bgp_dates-calendars" ; template name '(" Today (Javascript)

Today's Date

") ; definition "s-jjj" ; abbreviation "Inserts a JavaScript program") ; documentation (tempo-define-template "javascript-bgp_schedule-and-appointments" ; template name '("
JS-X.com
") ; definition "s-jj" ; abbreviation "Inserts an JavaScript program") ; documentation (tempo-define-template "javascript-bgp_validate-javascript-program" ; template name '(" ") ; definition "s-jj" ; abbreviation "Checks and good practice checklists for a JavaScript program.") ; documentation (tempo-define-template "latex-bgp_enumerated-list" ; template name '("#*This is a template for an enumerated list of items, and the items are in bold-faced font. \\necommand{\\bi}{\\begin{itemize}} \\necommand{\\ei}{\\end{itemize}} \\necommand{\\be}{\\begin{enumerate}} \\necommand{\\ee}{\\end{enumerate}} \\necommand{\\bd}{\\begin{description}} \\necommand{\\ed}{\\end{description}} \\necommand{\\prbf}[1]{\\textbf{#1}} %*To print in bold. \\necommand{\\prit}[1]{\\textit{#1}} %*To print in italics. \\necommand{\\prmd}[1]{\\textmd{#1}} %*To print in medium. \\necommand{\\prno}[1]{\\textnormal{#1}} %*To print in default. \\necommand{\\prrm}[1]{\\textrm{#1}} %*To print in roman. \\necommand{\\prsc}[1]{\\textsc{#1}} %*To print in small cap. \\necommand{\\prsf}[1]{\\textsf{#1}} %*To print in sans serif. \\necommand{\\prsl}[1]{\\textsl{#1}} %*To print in slant. \\necommand{\\prtt}[1]{\\texttt{#1}} %*To print in typewriter. \\necommand{\\prup}[1]{\\textup{#1}} %*To print in straight up. \\be \\item \\prbf{jjj.} jjjText explaining 1st item in the item list. \\item \\prbf{jjj.} jjjText explaining 2nd item in the item list. \\ee ; ") ; definition "s-jjj" ; abbreviation "Inserts an LaTeX program") ; documentation (tempo-define-template "texinfo-bgp_requirements-design-testing-documentation" ; template name '(" \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename aaareq @comment See /root/n/n/etc/texinfo_mak.makefile and/or use it to create .ps/.pdf/.html/.xml/.etc files! @comment@titlepage @comment@title name-of-manual-when-printed @comment@subtitle subtitle-if-any @comment@subtitle second-subtitle @comment@author Brian Powell @comment@settitle Task Blah @comment@end titlepage @comment@page @ifnottex @comment *To turn this TeXinfo document into a navigable website: @comment @node Top, Index, , (dir) @comment top Blah-title-of-page-we-wanna-make-the-first/top-page @comment Uh,..., this is the example text for Blah-page-we-wanna-make-the-first/top-page...etc./eg/ie blah @comment ... @comment @node Index, Concept Index, Function Index, Top @comment node-name-of-this-node-or-webpage, next-node-or-webpage, previous-node-or-webpage, up-node-or-webpage @end ifnottex @comment@everyheading @emph{Requirements Rough Draft!} @| Version 3.14159: @today{} @| @thispage @everyfooting Task aaa - Requirements @| Revision Date: @today{} @| Page: @thispage @hskip 3pt of bbb Pages @center @strong{Task aaa - Part I - Requirements Definition} @table @code @item 1 @strong{Task Number and Title:} Task aaa ccc @item 2 @strong{Origination Date:} ddd @item 3 @strong{Applications:} _eee_ Civil _fff_ Criminal @item 4 @strong{Original Author:} @end table Brian Powell, Office of Court Administration, Technology Division, (202) 502-2574 @table @code @item 5 @strong{Changes Summary:} Date: None. zzz5/06/2005 Author: None. zzzBrian Powell Description of Change: None. zzzUpdated to reflect results of Requirement Committee teleconference of 1/11/05. Included version numbers to software. @end table @table @code @item 6 @strong{Alternate Points of Contact} @end table iii zzzDave Wilharm, Office of Court Administration, Technology Division, (202) 502-2741--Rajan Seshadri, Office of Court Administration, Technology Division, (202) 502-2383--Andy Sirotta, Office of Court Administration, Technology Division, (202) 502-2754--Jacob Davenport, Office of Court Administration, Technology Division, (202) 502-2572--J-F Bibeau, Office of Court Administration, Technology Division, (202) 502-2735 @table @code @item 7 @strong{AO Stakeholders} Article III Judges Division - Barbara Kimble District Court Administration Division - Dan Elsroad, David Scott Electronic Public Access Program Office - Mary Stickney Magistrate Judges Division - Doug Lee Statistics Division - Patty Collins Systems Deployment and Support Division - Kay Lullo, Lee Womack @end table @table @code @item 8 @strong{Included MR(s):} MRggg @end table @table @code @item 9 @strong{Overview of Business Process}: hhhNearly verbatim to the MR(s)--in fact, if there are multiple MRs then manager said to break it into \"MR555: Blah\" sections--ie per MR--In order to facilitate Court-internal and therefore Court-only-viewable events in CM, the product includes the SetPrivateEntry DPF. When included in a given event’s functional definition, the docketing records of that ‘private’ event are masked from public users. As noted in MRs 109 and 465, however, this function also prevents those events, and their associated records, from appearing as viable targets for selection in later docketing events that may satisfy, terminate, or otherwise refer back to them. All reports, other than the Calendar Events report, which conceal ‘private’ docket entries will remain unchanged. The Calendar Events report will be adjusted to show any ‘private’ schedule events, but will disable the link to the associated docket text (as per MR 109). All docket-processing events which currently conceal ‘private’ records will be modified to reveal those records.--. 1. Overview of Business Process: This task covers several MRs which are loosely connected through different connections to scheduling events in CM/ECF. Each will be addressed separately below. 1. MR 30 - If a court user needs to create, delete, or modify a schedule type in CM/ECF, the product provides this capability through the Deadlines Table function available through the Update System Tables link on the Utilities page. Once a user selects or enters a deadline name, the system displays, in editable form elements, the different values associated with that schedule. The Function input form box is currently a text field element, which does not completely display the full value of the field if that value is greater than 70 characters. MR 30 requires that this form field be replaced with a textbox field, similar to the Text field on the same form, that will show the entirety of the function value, up to the maximum 255 characters. 2. MR 458 - If an existing deadline or hearing record needs to be changed in the system, the only method currently available for making this change is through the Calendar - Monthly report. Alternately, a court user may terminate one schedule and create a new schedule in its place through docketing. Neither of these options are ideal for simple corrections. MR 458 requires the expansion of existing editor functionality to include the same schedule editing capabilities that are accessible through the Calendar - Monthly report. - Update: Upon Requirement Committee review, the editor capability will be contained within a new Edit Schedules utility, which will take a case number as input, then provide a list of all schedules set within that case for editing. This list will be organized according to the docket entry that a schedule references, which will also be shown for clarity. 3. MR 956 - When defining the functions for a given schedule type which will represent a hearing in the Deadlines Table function, several of the functions can be made mandatory if the function name is entered in all capitol letters. According to the Application Administrators Guide, Appendix D, the date(), time(), and location() functions should all have this capability. Currently the system does not obey this syntax for the location() function. MR 956 requires that this capability be extended to the location() function. 4. MR 640 - Answer deadlines, while not defined in the same manner as schedules, are shown on the Calendar - Monthly and Calendar - Daily reports along with regular hearings and deadlines. Currently, if the Calendar - Monthly report is run for a specific judge, and the specific calendar date link for a day where that judge has a deadline or hearing set is clicked, the resulting Daily Calendar report for that date will not only display those deadlines and hearings pertinent to that judge for that date, but will also show all answer deadlines for that date, no matter which judge is responsible for them. MR 640 requires that this behavior be corrected. 5 . MR 586 - This MR contains several distinct requests, all of which require one change or another to the behavior of the MultiSched DPF. A. When docketing a schedule using MultiSched, either the DPF call includes, or the user is prompted for, a specific ‘action’ that the system will execute on all previously entered schedules of the same type. This is necessary to protect case-wide schedules from multiple active entries, but does not allow for the possible need for multiple occurrence schedules. Such multiple occurrence schedules could be used when more than one hearing of a given type is set in advance, or to maintain response and/or reply deadlines for each motion filed. B. When MultiSched runs for a list of schedules, some of which contain the ‘:s’ operator attached to their definitions, the application is listing those schedules, which is counter to the intended silent capability of the ‘:s’ operator. C. If MultiSched is included in an event, when that event is run, there is no mechanism for bypassing the effects of MultiSched, other than encapsulating it within an If2 construct, which further complicates the docketing process. Even if no new schedules are indicated, the system will continue through the list of prompts to satisfy MultiSched’s requirements. MR 586 requests that, should the ‘Next’ button be clicked on the opening MultiSched page without any input from the user indicating a desire to create one of the listed schedules, MultiSched finish without any further input from the user, and without having any impact on previously entered schedules. @end table @table @code @item 10 @strong{Detailed Functional Description} @end table @table @code @item 10.1 @strong{Users and Roles:} Court Staff, Attorney Filers, Judges, Other Government, Public jjjUsers and Roles--The types of users that are involved in the processes related to the function being documented and their roles in performing the function.--Court staff, possibly Attorneys at Court’s option (based on DocType event definitions) @end table @table @code @item 10.2 @strong{Source Documents:} None. jjjSource Documents--A listing of documents that are used as sources for entering information into the system relative to this function. Examples might be pleadings or receipts for filing fees. @end table @table @code @item 10.3 @strong{Information Collected:} None. jjjInformation Collected--A description of the kinds of information pertaining to this function that should be captured in the system. Include definitions of terms, as necessary. @end table @table @code @item @space@space@space@space@space@space@space 10.3.1 @strong{Information Collected During Case Opening:} None. jjjInformation Collected During Case Opening-- @end table @table @code @item @space@space@space@space@space@space@space 10.3.2 @strong{Information Collected During Docketing:} None. jjjInformation Collected During Docketing--Docketing When docketing fee information in CM/ECF, the form field does not allow the entry of a fee greater than $9,999.99. Some courts have, on occasion, run into difficulty when circumstances require a fee greater than this value. MR 902 requires that this limit be raised to at least 10 numerals (with the last two digits representing cents) to allow for fees up to $99,999,999.99. Docket Report In a related vein to the docketing issue above, MR 1051 requires that the demand dollar value on docket sheets be properly formatted with commas for easier reading. Also on the docketing report, MR 964 requires a correction to the display of the designator between opposing parties in cases involving multiple claims, cross claims, counterclaims, and/or third-party complaints. The system correctly inserts this designator between the different parties in a given claim. However, currently the system inserts an additional designator in the space between the counter claimant/counter defendant pair and the cross claimant/cross defendant pair. In addition, MR 1180 notes that behind the scenes, the Docket Report is generating warning messages in the error_log even when it is successfully running. The error or warning state that is generating these issue will be corrected. These extra warning messages make use of the error_log for troubleshooting difficult. Finally, a defect exists in the Docket Report when it is run against a case with the year 00\" (MR 1182). The resulting docket sheet contains some information from a different case than the one requested. This behavior must be corrected to reflect the user’s criteria. @end table @table @code @item @space@space@space@space@space@space@space 10.3.3 @strong{Information That May Need to Be Modified By An Editor:} None. jjjInformation That May Need to Be Modified By An Editor-- @end table @table @code @item 10.4 @strong{Frequency of Performance of the Function:} Performed ad hoc, daily, weekly, monthly, when scheduled jjjFrequency of Performance of the Function--Describe how often the function is performed (ad hoc, daily, weekly, monthly, can it be scheduled, etc.) @end table @table @code @item 10.5 @strong{Reports, Queries, Forms, Notices, or Other Outputs} @end table @table @code @item @space@space@space@space@space@space@space 10.5.1 @strong{Search/Selection Criteria:} None. jjjSearch/Selection Criteria--(NamesCNot Database Fields) A description of the information that is used to select cases, case participants, schedules, or other items to be included on an output. @end table @table @code @item @space@space@space@space@space@space@space 10.5.2 @strong{Information Included:} None. jjjInformation Included--(NamesCNot Database Fields) A description of the kinds of information pertaining to this function that should be included on reports, queries, notices, etc. Include definitions of terms, as necessary. @end table @table @code @item @space@space@space@space@space@space@space 10.5.3 @strong{Sorting Options:} None. jjjSorting Options--Describe the various sorting orders for reports, queries, forms, and notices to be produced during the performance of the function. Be sure to include primary, and secondary sorting options. Examples include sorting by divisional office, case number, judge, schedule date, etc. @end table @table @code @item 11 @strong{Security: } None. jjjSecurity--Describe any security-related requirements. @end table @table @code @item 12 @strong{Constraints:} None. jjjConstraints--Description of any relevant assumptions, limitations, or constraints for this function, including constraints on timing, storage, or component state. @end table @comment *To get a Table of Contents: @comment@contents @page @comment@bye @comment\input texinfo @c -*-texinfo-*- @comment@c %**start of header @comment@setfilename task-aaades @comment @comment@comment@titlepage @comment@comment@title name-of-manual-when-printed @comment@comment@subtitle subtitle-if-any @comment@comment@subtitle second-subtitle @comment@comment@author Brian Powell @comment@comment@settitle Task blah @comment@comment@end titlepage @comment @comment@comment@page @ifnottex @comment *To turn this TeXinfo document into a navigable website: @comment @node Top, Index, , (dir) @comment top Blah-title-of-page-we-wanna-make-the-first/top-page @comment Uh,..., this is the example text for Blah-page-we-wanna-make-the-first/top-page...etc./eg/ie blah @comment ... @comment @node Index, Concept Index, Function Index, Top @comment node-name-of-this-node-or-webpage, next-node-or-webpage, previous-node-or-webpage, up-node-or-webpage @end ifnottex @comment@everyheading @emph{Rough Draft!} @| Version 0.01: @today{} @| @thispage @everyfooting Task aaa - Design @| Revision Date: @today{} @| Page: @thispage @hskip 3pt of bbb Pages @center @strong{Task aaa - Part II - Design Specification} @table @code @item 1 @strong{Task Number and Title:} Task aaa ccc @item 2 @strong{Origination Date:} ddd @item 3 @strong{Applications:} _eee_ Civil _fff_ Criminal @item 4 @strong{Original Author:} @end table Brian Powell, Office of Court Administration, Technology Division, (202) 502-2574 @table @code @item 5 @strong{Changes Summary:} Date: None. zzz5/06/2005 Author: None. zzzBrian Powell Description of Change: None. zzzUpdated to reflect results of Requirement Committee teleconference of 1/11/05. Included version numbers to software. @end table @table @code @item 6 @strong{Alternate Points of Contact} @end table iii zzzDave Wilharm, Office of Court Administration, Technology Division, (202) 502-2741--Rajan Seshadri, Office of Court Administration, Technology Division, (202) 502-2383--Andy Sirotta, Office of Court Administration, Technology Division, (202) 502-2754--Jacob Davenport, Office of Court Administration, Technology Division, (202) 502-2572--J-F Bibeau, Office of Court Administration, Technology Division, (202) 502-2735 @table @code @item 7 @strong{AO Stakeholders} Article III Judges Division - Barbara Kimble District Court Administration Division - Dan Elsroad, David Scott Electronic Public Access Program Office - Mary Stickney Magistrate Judges Division - Doug Lee Statistics Division - Patty Collins Systems Deployment and Support Division - Kay Lullo, Lee Womack @end table @table @code @item 8 @strong{Included MR(s):} MRggg @end table @table @code @item 9 @strong{Processing:} zzz--When events containing the SetPrivateEntry DPF are docketed, the dktentry field de_pubacc is given a value of ‘n’. Several reports and docketing functions use this field as a SQL restriction to conceal ‘private’ events and their associated records. For the docketing functions, these restrictions will be removed if the current user is a Court user. For non-Court users, only non-interactive functions will have the restrictions lifted (mainly the ability to silently satisfy/terminate a protected deadline). For the Calendar report, the restriction in the SQL for schedule events will be removed, but the docket text hyperlink will not be provided if the de_pubacc value for a given event is ‘n’. @item 9.1 @strong{System Configuration} @end table @table @code @item @space@space@space@space@space@space@space 9.1.1 @strong{System Tables} @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.1 @strong{Codes:} None. jjjCodes-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.2 @strong{Deadlines (schedules):} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.3 @strong{Dispatch (events):} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.4 @strong{Document Type (doctype):} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.5 @strong{DPF:} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.6 @strong{Forms:} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.7 @strong{Location:} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.8 @strong{Order Action:} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.9 @strong{Role Type:} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.10 @strong{Site:} None. jjj-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.1.11 @strong{Other Required Entries:} None. jjj-- @end table @page @table @code @item @space@space@space@space@space@space@space 9.1.2 @strong{Relational Edits:} None. jjjRelational Edits-- @end table @table @code @item @space@space@space@space@space@space@space 9.1.3 @strong{Database Accesses:} None. jjjDatabase Accesses-- @end table @table @code @item @space@space@space@space@space@space@space 9.1.4 @strong{Database Updates, Triggers, & Stored Procedures:} None. jjjDatabase Updates, Triggers, & Stored Procedures-- @end table @table @code @item @space@space@space@space@space@space@space 9.1.5 @strong{Access Control} None. jjjAccess Control-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.5.1 @strong{Menu:} None. jjjMenu--I think they mean the sequence of pulldown menus!? ie Blah->Blah->...Change prompt language in TermPty() DPF to read \"Select the party or parties for termination from this case.¡.--Change checkbox question language in rel() DPF to read Should the document you are filing link to another document in this case? . @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.1.5.1 @strong{Program Group:} None. jjjProgram Group-- @end table @table @code @item @space@space@space@space@space@space@space 9.1.6 @strong{Help Files:} None. jjjHelp Files--new help files will be created for the Written Opinions Report-- @end table @table @code @item @space@space@space@space@space@space@space 9.1.7 @strong{Other Configuration Changes:} None. jjjOther Configuration Changes-- @end table @table @code @item 9.2 @strong{Program Structure} @end table @table @code @item @space@space@space@space@space@space@space 9.2.1 @strong{Inputs:} None. jjjInputs-- @end table @table @code @item @space@space@space@space@space@space@space 9.2.2 @strong{Processing:} None. jjjProcessing--1. The code in rel() DPF which loads the appropriate library and calls the BuildName function will be adjusted to use the default name space where all other programs commonly run functions. This will prevent rel() from either being denied access or denying access to a later DPF. 2. The code in sched() DPF is more complex than that found in the rel() DPF. It calls another library, and that other library loads yet another library to run BuildName. The library called by sched() is also used by MultiSched, which, on its own, does not run in a new name space¡. To correct the misbehavior in sched(), the library inquestion will be loaded in the default name space. This will, in turn, load the library including BuildName in the dafault namespace, where other programs can access it, if necessary. 3. The low-level CM library that attempts to provide access in the above-mentioned rel() failure will also be modified to cease execution with an error message if it should ever be requested to load the same library for the same function twice in a row. This will prevent the possibility of another infinite-loop scenario, even if caused by another DPF that rel() or sched(). @end table @table @code @item @space@space@space@space@space@space@space 9.2.3 @strong{Outputs:} None. jjjOutputs-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.2.3.1 @strong{Reports and Queries:} None. jjjReports and Queries-- @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.2.3.2 @strong{Data Files:} None. jjjData Files-- @end table @table @code @item @space@space@space@space@space@space@space 9.2.4 @strong{Source File Configuration:} @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.2.4.1 @strong{Program Names:} None. jjjProgram Names--AutoLib.pl v 3.2--RelDPF.pl v 3.11--SchedDPF.pl v 3.4 @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.2.4.2 @strong{Function Names:} None. jjjFunction Names--function unicodify(InString) @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.2.4.3 @strong{Description of Parameters for Sub-routines:} None. jjjDescription of Parameters for Sub-routines--Calendar.pl - PreProcessEditCalendar() - Previously accepted a single parameter using GET method in source URL linkage and placed it in $Id. Now code attempts to split $Id on comma, and set $Var{EditSchedSource} to second parameter. $Var{EditSchedSource} checked by CloseCalEditWindow() to determine Close button or Edit Schedule link placement at end of edit process. MultiSchedDPF.pl - new 4th DPF parameter value of ‘noaction’. @end table @table @code @item @space@space@space@space@space@space@space @space@space@space@space@space@space@space 9.2.4.4 @strong{Support Software:} None. jjjSupport Software-- @end table @table @code @item 10 @strong{Constraints:} None. jjjConstraints-- @end table @comment *To get a Table of Contents: @comment@contents @page @comment@bye @comment @comment\input texinfo @c -*-texinfo-*- @comment@c %**start of header @comment@setfilename task-jjjdes @comment @comment@comment@titlepage @comment@comment@title name-of-manual-when-printed @comment@comment@subtitle subtitle-if-any @comment@comment@subtitle second-subtitle @comment@comment@author Brian Powell @comment@comment@settitle Task blah @comment@comment@end titlepage @comment @comment@comment@page @ifnottex @comment *To turn this TeXinfo document into a navigable website: @comment @node Top, Index, , (dir) @comment top Blah-title-of-page-we-wanna-make-the-first/top-page @comment Uh,..., this is the example text for Blah-page-we-wanna-make-the-first/top-page...etc./eg/ie blah @comment ... @comment @node Index, Concept Index, Function Index, Top @comment node-name-of-this-node-or-webpage, next-node-or-webpage, previous-node-or-webpage, up-node-or-webpage @end ifnottex @comment@everyheading @emph{Testing Rough Draft!} @| Version 2.7182818284: @today{} @| @thispage @everyfooting Task aaa - Testing @| Revision Date: @today{} @| Page: @thispage @hskip 3pt of bbb Pages @center @strong{Task aaa - Part III - Testing Overview} @table @code @item 1 @strong{Access Levels & Programs to be Tested:} None. jjjAccess Levels & Programs to be Tested:--List the menu names, e.g., Open Assigned Civil Case or the Motions report, of the programs to be tested. Include secondary effect (i.e. reporting) software that may act on results from the new or modified software.--Docketing.--The Written Opinions Report should be tested using both Court and PACER access.Testing should be done with both Maintain Your Account (Court & Attorney) and with Maintain User Accounts (Court only).]--I entered/\"guessed\" this into the rough draft I was asked to do: Charging Instruments and Pleas=>Indictment =>Counts (add count(s)), Dockets (view the resultant text)--TermParty() & rel() DPFs.--Docketing events using sched() and rel() in highly specific circumstances.--Court docketing access level. @end table @table @code @item 2 @strong{Required Pre-Existing Conditions:} None. jjjRequired Pre-Existing Conditions--Describe any DB values, docket entries, or non-configuration system states that need to exist in the system prior to testing the new or modified software. [Examples: Motion for Miscellaneous Relief required. Testing case must have Nature of Suit value of 810. Add new DPF to a test Document Type table record.] @end table @table @code @item 3 @strong{General Testing Procedure:} None. jjjGeneral Testing Procedure--Briefly describe how to test the new or modified software. Also briefly detail any secondary effects that the new or modified software may have on other software (i.e. reports).--For detailed testing instructions see related SDSD scope document.--Verify prompt language changes.[Examples: Docket event containing new event.Run the Written Opinions Report with a year-number case number value and at least one value selected in >Office= multi-select box.Verify the success or failure message from AssignDPF in the Transaction Report.--Since the package scoping issue being addressed by this Task is wrapped heavily in Perl minutiae, testing for for proper solution will necessitate very specific environments being created that would previously instigate the known failure in the code.--To test the fix for events using rel(): a. Docket a Motion for Extension of Time to Answer b. Docket an Order granting that Motion using the Order on Motion menu option c. In the previously-existing failure, when the docketing process reached the PickPartyServed screen, the display to the user would show an empty drop-down list, where the user would expect instead a list of party names to select. This drop-down list should now be properly populated with party names. To test the fix for events using sched(): a. No starter dictionary events exist that will create the failure for sched(). Use the following doctype function list to re-create the failure scenario: AutoAddDefendants;file;sched(mhrg) Note: any hearing can be substituted for mhrg, but the circumstances that created the failure will only be created if the schedule record that sched() tries to creat is a hearing. b. Docket the event so created c. In the failure situation, the Judge list for the hearing would be a blank drop-down list. This drop-down list should now properly contain the list of Judges to associate with the hearing being scheduled.--b. Docket an event which includes a rel() DPF call that would normally be able to target motions. For Court users, the altered motion just docketed should now appear in the list for rel() to target. Non-Court users should not see the motion in the select list.--Most of the changes in this task relate to behavior of the system when referring to an event already docketed that contained the SetPrivateEntry DPF, and the protections offered to schedules associated with that docket entry. In the starter dictionary, SetPrivateEntry is not used in any events which create schedules. Therefore: a. Create a motion event that also sets a schedule (preferably two schedules, one deadline, one hearing, for later testing of the Calendar Events report) c. Docket an event which includes MultiSched(‘set’,’{o or m}’,’{any schedule}’,’motion’,’{any value}’) For Court users, the altered motion just docketed should now appear in the list for MultiSched() to target. Non-Court users should not see the motion in the select list. d. Docket an event which includes MultiSched(‘set’,’‘,’{deadline set in altered motion}:s’,’‘,’term’) Once the docketing is completed, verify in the Deadlines/Hearings report that the deadline has been terminated. e. Run the Calendar Events report as both a Court user and as an Attorney. In the Court user instance, the report should display all information relating to the hearing set during the motion in (a) above. For the Attorney, the report should show the hearing date/time/hearing information, but no reference to the docket text. f. Finally, docket an Order on Motion, targeting the motion in (a). Previously, a Court user would not see the motion protected by SetPrivateEntry in the list of active motions that could be ordered on. @end table @table @code @item 4 @strong{Performance Test:} None. jjjPerformance Test--List any anticipated impact on performance to be tested.--Written Opinions Report response may be significantly impacted by large (beyond 30-day default) date ranges, due to the unique nature of its document-weighted SQL. @end table @table @code @item 5 @strong{Error Logs to be Reviewed:} None. jjjError Logs to be Reviewed--List any error logs to be reviewed.--If AUTOLOAD attempts, and fails, to load the same function library twice, the process will be aborted, and an error message written to error_log indicating the circumstances of the instance in the following format (...).] @end table @table @code @item 6 @strong{System Processes to be Tested:} None. jjjSystem Processes to be Tested--Only non-Application Processes here--they equate \"System\" with anything that is \"outside the application\"--which is a big mistake btw since we aren't using Java--List any error logs to be reviewed.--If AUTOLOAD attempts, and fails, to load the same function library twice, the process will be aborted, and an error message written to error_log indicating the circumstances of the instance in the following format (...).--If error state is recreated, AutoLib will now make a record in info_log. @end table @comment *To get a Table of Contents: @comment@contents @bye ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "javascript-bgp_unicode-character-case-checker" ; template name '(" ") ; definition "s-jjj" ; abbreviation "Inserts a JAVASCRIPT program command") ; documentation ;; (tempo-define-template ;; "hsgs-bgp_goto-subroutine-Label" ; template name ;; '("#ident \"rcsid=$Header: /usr/local/cvsroot/district/web/hsgs/EditMenu.hsgs,v 3.2 2003/10/08 15:17:07 jpd Exp $\" ;; Enable Security; ;; Global ($EventTitle=\"Edit menu table\";$EventName=\"Edit menu table\";); ;; # Get the menu type. Do not use \"EditScreen\" here because the user cannot create a new menu here. ;; Begin HTML(\"{SystemName} - {EventTitle}\"); ;; Set Button(\"Next\"); ;; Begin Form; ;; run BeginLogTrans(); ;; run Display(\"{EventName}
\"); ;; run ShowPage(\"SELECTMENU\"); ;; End Form; ;; End HTML; ;; Label Start; ;; Begin HTML(\"{SystemName} - {EventTitle}\"); ;; Begin Form; ;; Hide Buttons; ;; run BeginLogTrans(); ;; Perl (require '../support/MiscWidgits.pl';); ;; run EditScreen(\"$Var{mn_menu_name} menu item\",'mn_display_name','menu',\"where mn_menu_name='$Var{mn_menu_name}'\"); ;; End Form; ;; End HTML; ;; Perl (if ($Var{CreateEntry} and $Var{new_mn_display_name} eq '') {$Var{message}='Please give a name to the new menu item you want to create.'};); ;; if ($Var{message}) goto Start; ;; Perl (require '../support/QueryRoutines.pl';); ;; run load_record_into_var('menu'); ;; if (!$Var{DeleteEntry}) goto Edit; ;; Label ConfirmDelete; ;; Begin HTML(\"{SystemName} - {EventTitle}\"); ;; Begin Form; ;; Hide Buttons; ;; Perl (require '../support/MiscWidgits.pl';); ;; run DeleteConfirmation(\"$Var{mn_menu_name} menu item\", $Var{mn_display_name}); ;; End Form; ;; End HTML; ;; goto Save; ;; Label Edit; ;; Begin HTML(\"{SystemName} - {EventTitle}\"); ;; Begin Form; ;; run ShowPage('EditMenu.htm'); ;; End Form; ;; End HTML; ;; Label Save; ;; Begin HTML(\"{SystemName} - {EventTitle}\"); ;; Last Page; ;; Perl ($Var{new_mn_menu_name}=$Var{mn_menu_name};); ;; Perl (require '../support/QueryRoutines.pl';); ;; run update_record_from_var('menu'); ;; run ShowPage('DisplayMenu.htm'); ;; End HTML; ;; Start Html SELECTMENU; ;;
Edit Menu ;;

This function allows you to change the items which may appear on an ;; existing menu (what actually appears depends also on which of the items ;; the user is authorized to access).  Menus are defined by Codes table ;; entries with type "Menu". To set up a new menu, first add an ;; entry in the Codes table, then add items to it here. ;;

Select the menu to edit.
;; ;;

;; End Html; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an HSGS program command") ; documentation (tempo-define-template "javascript-bgp_external-javascript-source-file-call" ; template name '(" JavaScript Toolbox - Calendar Popup To Select Date
(View Source of this page to see the example code)
select filing date
") ; definition "s-jjj" ; abbreviation "Inserts a JAVASCRIPT program command") ; documentation ;; (tempo-define-template ;; "informix-bgp_like-cs_case_number-and-cs_short_title" ; template name ;; '("--*To test: echo ... | dbaccess district_dev ;; SELECT ;; * ;; FROM ;; CASE ;; WHERE (UPPER(CS_CASE_NUMBER) LIKE '6:97-CV-03%') ;; AND (UPPER(CS_SHORT_TITLE) LIKE 'JAMES%') ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation ;; (tempo-define-template ;; "informix-bgp_like-cn_citation-and-cn_cittext" ; template name ;; '("--*To test: echo ... | dbaccess district_dev ;; SELECT ;; * ;; FROM ;; COUNT ;; WHERE (UPPER(CN_CITATION) LIKE '18:23%') ;; AND (UPPER(CN_CITTEXT) LIKE '%SALE OR RECEIPT%') ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation ;; (tempo-define-template ;; "informix-bgp_criminal-attorney" ; template name ;; '("--*DOCUMENTATION-BLAH ;; --DROP VIEW CRIMINAL_ATTORNEY; ;; --CREATE VIEW \"INFORMIX\".CRIMINAL_ATTORNEY AS ;; SELECT ;; DISTINCT ;; AT_PARTY_SEQNO, ;; AT_SEQNO, ;; AT_ATPRID_PTR, ;; AT_ROLE, ;; AT_ATYTYPE, ;; AT_RETRIEVE_CODE, ;; AT_FIRST_NAME, ;; AT_MIDDLE_NAME, ;; AT_LAST_NAME, ;; AT_GENDER, ;; AT_TITLE, ;; AT_GENERATION, ;; AT_INITIALS, ;; AT_OFFICE, ;; AT_ADDRESS1, ;; AT_ADDRESS2, ;; AT_ADDRESS3, ;; AT_CITY, ;; AT_STATE, ;; AT_ZIP, ;; AT_COUNTRY, ;; AT_PHONENO, ;; AT_SEAL, ;; AT_START_DATE, ;; AT_END_DATE, ;; AT_LEAD, ;; AT_NOTICE, ;; AT_APPEAR, ;; AT_DESIGNATION, ;; AT_FAX_PHONE, ;; AT_E_MAIL, ;; AT_FRM_FIRMID, ;; AT_FRM_SEQNO, ;; AT_RESTRICT_VIEW, ;; AS_LEAD_CASEID, ;; AS_CASEID, ;; AS_SEQNO, ;; AS_TYPE, ;; AT_UNIT ;; FROM ;; ATTORNEY, ;; ASCCASE ;; WHERE AT_CASEID=AS_CASEID ;; AND AS_TYPE = \"cr\" ;; ; ;; --GRANT SELECT ON \"INFORMIX\".CRIMINAL_ATTORNEY TO PUBLIC ;; --; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation ;; (tempo-define-template ;; "informix-bgp_criminal-count" ; template name ;; '("--*DOCUMENTATION-BLAH ;; --DROP VIEW \"INFORMIX\".CRIMINAL_COUNT; ;; --CREATE OR REPLACE VIEW \"INFORMIX\".CRIMINAL_COUNT AS ;; --CREATE OR REPLACE VIEW BGP_CRIMINAL_COUNT AS ;; SELECT ;; DISTINCT ;; CN_SEQNO, ;; CN_DEF_PTR, ;; CN_TYPE, ;; CN_SUB_TYPE, ;; CN_COUNT, ;; CN_BEG_COUNT, ;; CN_END_COUNT, ;; CN_REDACT, ;; CN_CITATION, ;; CN_CITTEXT, ;; CN_OFFENSE_LEVEL, ;; CN_CIT_KEY, ;; CN_DATE_FILED, ;; CN_DATE_DISPOSED, ;; CN_CRSEQNO_PTR, ;; CN_PRTSEQ, ;; CN_TRSEQNO_PTR, ;; CN_SENDISP, ;; CN_PROCINT, ;; CN_COMPFLG, ;; CN_PRISCD, ;; CN_PRISON_TIME, ;; CN_PROBCD, ;; CN_PROB_TIME, ;; CN_FINE, ;; CN_SUPREL, ;; CN_SENT_TEXT, ;; CN_DATE_START, ;; CN_DATE_END, ;; CN_RESTRICT_VIEW, ;; AS_LEAD_CASEID, ;; AS_CASEID, ;; AS_SEQNO, ;; AS_TYPE ;; FROM ;; COUNT, ;; ASCCASE ;; WHERE CN_CASEID=AS_CASEID ;; AND (UPPER(AS_TYPE) LIKE 'CR%') ;; ; ;; --GRANT SELECT ON \"INFORMIX\".CRIMINAL_COUNT TO PUBLIC ;; --GRANT SELECT ON BGP_CRIMINAL_COUNT TO PUBLIC ;; --; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation ;; (tempo-define-template ;; "informix-bgp_count" ; template name ;; '("--*To see all cases ;; SELECT * FROM COUNT ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_indictment-information-complaint" ; template name ;; '("--*To see Indictment, Information, Complaint webpage data ;; SELECT ;; CN_CASEID, ;; CN_CITATION, ;; CN_COUNT, ;; CN_OFFENSE_LEVEL, ;; CN_CIT_KEY, ;; CN_CITTEXT ;; FROM ;; COUNT ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_attorney" ; template name ;; '("--*To see all cases ;; SELECT * FROM ATTORNEY ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; ;SELECT py_caseid, py_type, py_role, py_lower_role, py_caption_role FROM PARTY ;; ;SELECT PY_CASEID, PY_TYPE, PY_CAPTION_ROLE FROM PARTY ;; (tempo-define-template ;; "informix-bgp_party" ; template name ;; '("--*To see all PARTIES ;; SELECT * FROM PARTY ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_case-flags" ; template name ;; '("--*To see all cases ;; SELECT * FROM CASE_FLAGS ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_asccase" ; template name ;; '("--*To see all cases ;; SELECT * FROM ASCCASE ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_mail-notice" ; template name ;; '("--*To see all cases ;; SELECT * FROM MAIL_NOTICE ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_filing-fee" ; template name ;; '("--*To see all cases ;; SELECT * FROM FILING_FEE ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_js56" ; template name ;; '("--*To see all cases ;; SELECT * FROM JS56 ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_person" ; template name ;; '("--*To see all cases ;; SELECT * FROM PERSON ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_mail-case-list" ; template name ;; '("--*To see all cases ;; SELECT * FROM MAIL_CASE_LIST ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_jdg-index" ; template name ;; '("--*To see all cases ;; SELECT * FROM JDG_INDEX ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_jdg-index" ; template name ;; '("--*To see all cases ;; SELECT * FROM JDG_INDEX ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_rms-casefile" ; template name ;; '("--*To see all cases ;; SELECT * FROM RMS_CASEFILE ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_case" ; template name ;; '("--*To see all cases ;; SELECT * FROM CASE ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_all-columns" ; template name ;; '("--*To see all of the columns of the tables in the database ;; SELECT * FROM SYSCOLUMNS ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_all-tables" ; template name ;; '("--*To see all of the tables in the database ;; SELECT * FROM SYSTABLES ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_all-real-users" ; template name ;; '("--*To see all of the tables in the database ;; SELECT * FROM SYSUSERS ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_all-views" ; template name ;; '("--*To see all of the tables in the database ;; SELECT * FROM SYSVIEWS ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation ;; (tempo-define-template ;; "informix-bgp_users" ; template name ;; '("--*DOCUMENTATION-BLAH ;; SELECT * FROM USERS ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an INFORMIX program") ; documentation (tempo-define-template "perl-bgp_pod" ; template name '("#!/usr/bin/perl -w use strict; use warnings; use Getopt::Long qw(:config auto_version); use Pod::Usage; my $file; my $out = 'out.tsv'; my $help; my $man; our $VERSION = '0.1'; GetOptions ( 'in=s' => \$file, 'out=s' => \$out, 'man' => \$man, 'help|?' => \$help, ) or pod2usage(); pod2usage(-verbose => 2) if ($man); pod2usage(-verbose => 1) if ($help); pod2usage(-msg => 'Please supply a valid filename.') unless ($file && -s $file); __END__ =head1 NAME script.pl - my test script =head1 SYNOPSIS script.pl --in --out [--help] [--man] [--version] =cut ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program that uses Pod::Usage.") ; documentation;; (tempo-define-template "perl-bgp_english" ; template name '("#!/usr/bin/perl -w # File: english.pl # # Authors: Brian Powell (bpowell@kuul.com) # # Description: Example of PERL program using the English.pm # eval 'exec /iw/perl/current/bin/perl -s $0 ${1+\\\"$@\\\"}' if 0; # Limit the scope. use English; use diagnostics; use strict; use warnings; use vars qw($VERSION $RELEASE $HTML_OUTPUT); my($searchSpace)=\"TTTT BBBABBB DDDD\"; my($pattern)=\"B+AB+\"; $searchSpace =~ m/$pattern/; print(\"Search space: $searchSpace\\n\"); print(\"Pattern: /$pattern/\\n\"); print(\"Matched String: $English::MATCH\\n\"); # The English.pm variable print(\"Matched String: $&\\n\"); # The PERL variable #*To test, this program should display: #Search space: TTTT BBBABBB DDDD #Pattern: /B+AB+/ #Matched String: BBBABBB #Matched String: BBBABBB #*Keep require happy: #return 1; ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program.") ; documentation;; (tempo-define-template "perl-bgp_delete-last-line-of-each-argth-file" ; template name '("#!/bin/perl for (@ARGV) { open (FH, \"+< $_\") or die \"can't update $file: $!\"; while ( ) { $addr = tell(FH) unless eof(FH); } truncate(FH, $addr) or die \"can't truncate $file: $!\"; } 1; ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program.") ; documentation;; (tempo-define-template "perl-bgp_blahclass" ; template name '("#!/usr/bin/perl -w # File: BlahClass.pm # # Authors: Brian Powell (bpowell@kuul.com) # # Description: Example of PERL module and class creation. This example # # shows the absolute minimum bare essentials needed to create a class. # eval 'exec /iw/perl/current/bin/perl -s $0 ${1+\\\"$@\\\"}' if 0; # Limit the scope. use English; use diagnostics; use strict; use warnings; use vars qw($VERSION $RELEASE $HTML_OUTPUT); package BlahClass; $VERSION=1.01; sub new { my $self={}; # This creates an anonymous %ash, this could be a $calar or # you could make it an @rray, it will hold the objects' data. bless($self); return $self; } return 1; ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program.") ; documentation;; (tempo-define-template "makefile-bgp_really-make-a-lamp" ; template name '("#DOCUMENTATION-BLAH all: lamp lamp: stocking attach-top lamp-hw sand cracks toe-holes screw feet touch-up cord shade stocking: toe-holes touch-up @echo \"Hot-glue stocking to leg (leave holes at bottom for screws)\" drill-top: screw @echo \"Drill hole in top\" attach-top: drill-top lamp-hw toe-holes screw cord @echo \"Attach top to leg\" lamp-hw: drill-top cord @echo \"Attach lamp hardware to top\" sand: attach-top cracks @echo \"Sand and polish top (Dremel)\" cracks: attach-top @echo \"Fill in cracks at top\" toe-holes: feet @echo \"Drill holes for heel and toe screws\" screw: toe-holes feet cord @echo \"Screw leg to base\" feet: @echo \"Attach feet to base\" touch-up: @echo \"Touch up bad spots\" cord: @echo \"Thread power cord through shoe\" shade: lamp-hw sand @echo \"Attach lampshade\" ") ; definition "s-jjj" ; abbreviation "Inserts a Makefile") ; documentation;; ; ; ; ; ; ; ;; (tempo-define-template ; "perl-bgp_boilerplate" ; template name ; '("#!/usr/bin/perl -w ; ; # File: sample.pl # ; ; # Authors: Brian Powell (bpowell@kuul.com) # ; ; # Description: Extract data from parsed edgar documents and creates XML # ; # data. This is a test wrapper program for the metadata task 2 library. # ; ; eval 'exec /iw/perl/current/bin/perl -s $0 ${1+\"$@\"}' if 0; ; ; =pod ; ; =head1 NAME ; ; boilerplate.pl - Perl template program ; ; =head1 SYNOPSIS ; ; use Empeg; ; ; my $et = new Empeg::Emptool("emptool 10.0.0.201"); ; $et->chdir("artists"); ; $et->mklist("foo"); ; $et->chdir("foo"); ; $et->upload("bar.mp3"); ; ; $et->sync(); ; ; =head1 METHODS ; ; =cut ; ; # Limit the scope. ; package English; ; ; use diagnostics; ; use strict; ; use warnings; ; ; use vars qw($VERSION $RELEASE $HTML_OUTPUT); ; ; # Current module version: ; my $Id =<<'EoI'; ; # $Id: //depot/isms/skulker/edgar/1.3.0/bin/meta-data-task2.pl#1 $ ; EoI ; # ; ; ; my $RELEASE = sprintf(\"%d\", $Id =~ /^# \$Id: .*#(\d+)/); ; my $VERSION = sprintf(\"%s\", $Id =~ m|edgar/([^/]+)|); ; ; BEGIN ; { ; my $iw_root = ($ENV{IW}) ? $ENV{IW} : "/iw"; ; my $edgar_root = "$iw_root/skulker/edgar/current"; ; ; # The location of our local libraries is here: ; my($libdir) = "$edgar_root/lib"; ; ; if ( -d $libdir) ; { ; unshift(@INC, $libdir); ; } ; ; # Task 2 metadata library support is needed. ; require "$libdir/meta-data-task2-lib.pl"; ; } ; ; # The version of PERL required: ; require 5.004; ; ; # Find the name of this program. ; my $prog; ; ; ($prog = $0) =~ s#.*/##; ; ; # for processing command line options ; use Getopt::Std; ; ; # Process the command line options. ; my %opt; ; ; getopts('D:vhH', \%opt) || &EDGAR::metadata_task2::usage($prog); ; ; # Debug mode? ; my $debug = defined($opt{'D'}) ? $opt{'D'} : 0; ; ; # HTML mode? ; my $HTML_OUTPUT = defined($opt{'H'}) ? $opt{'H'} : 0; ; ; # Print the version. ; if ($opt{'v'}) ; { ; print &EDGAR::metadata_task2::version(), "\n"; ; ; exit; ; } ; ; # Print the usage ; &EDGAR::metadata_task2::usage($prog) if $opt{'h'}; ; ; # Debugging package: It should be in common/lib. ; use Logger; ; ; # set up stuff for run log and Debugging ; my $do_logging = 0; ; ; $do_logging = 1 if ($debug > 8); ; ; $logger::DEBUG = Logger->new(); ; $logger::DEBUG->setupLogger('-base-dir' => "/tmp", ; '-base-filename' => $prog, ; '-do-logging' => $do_logging); ; $logger::DEBUG->logDateTime(); ; ; my ($xp, $nodes, $node, $form_type, $text, $parsed_table); ; my (%attr, $co_name, $sales_ref, $year_ref, $table_id); ; ; # Main body of the program meta-data-task2.pl. ; print "\n" if ($HTML_OUTPUT); ; ; foreach my $file (@ARGV) ; { ; print "DEBUG file = $file\n" if ($debug); ; print "

file = $file



\n" ; if ($HTML_OUTPUT); ; ; $xp = XML::XPath->new(filename => $file); ; $nodes = $xp->find('/EDGAR/SUBMISSION/DOCUMENT/TYPE'); ; $form_type = (($nodes->get_nodelist)[0]->getChildNodes)[0]->toString; ; ; # Get the SUBJECT-COMPANY/COMPANY-`DATA/CONFORMED-NAME ; $nodes = $xp->find('/EDGAR/SUBMISSION/FILER/COMPANY-DATA/CONFORMED-NAME'); ; $co_name = (($nodes->get_nodelist)[0]->getChildNodes)[0]->toString; ; ; # Read item 6 and get its table id. ; $table_id = &EDGAR::metadata_task2::lookForItem6($file); ; ; # Get the parsed tables. ; $nodes = $xp->find('/EDGAR/parsed.edgar/parsed.document/parsed.table'); ; ; &EDGAR::metadata_task2::wrapXMLText($xp, $nodes, $form_type, $co_name, $table_id); ; ; $xp->cleanup(); ; } ; ; print "
\n" if ($HTML_OUTPUT); ; ; ; my $name = \"Pengu\"; ; foreach (1..20) { ; &shout($name); ; } ; sub shout { ; my $name = shift; ; print \"*** $name ***\\n\"; ; } ; ; # keep require happy ; 1; ; ; =head1 NAME ; ; sample.pl - EDGAR table routines ; ; =head1 PACKAGE ; ; EDGAR::Table ; ; =head1 SYNOPSIS ; ; require sample.pl; ; ; ; =head1 REQUIRES ; ; Perl, version 5.001 or higher. ; ; =head1 DESCRIPTION ; ; EDGAR table routines. ; ; =over 3 ; ; =head1 METHODS ; ; ; =head2 parse ; ; =item * ; ; parses an EDGAR table element. ; ; =item * ; ; A hash array of parsed table data is returned. ; ; =item example: ; ; my (%data) = &EDGAR::Table::parse($tableElement); ; ; ; ; =head2 preParse ; ; =item * ; ; pre-parse table data to extract header and footer data. The standard column ; width and types are found ; ; ; =item * ; ; the table data is modified to extract header and footer data. ; ; =item example: ; ; &EDGAR::Table::preParse(\\$tableElement, \\%results); ; ; ; =head2 parseTableData ; ; =item * ; ; parse and extract table the data in the table block ; ; =item * ; ; row data is parsed and extracted. ; ; =item example: ; ; &EDGAR::Table::parseTableData(\\$tableElement, \\%results); ; ; ; =head2 extract_section ; ; =item * ; ; extracts table section based on provided start and end text ; ; =item * ; ; the data within the begin and end tags is returned. ; ; =item example: ; ; my($sect) = &EDGAR::Table::extract_section("this is", "", ""); ; ; ; =head2 toXML ; ; =item * ; ; generate XML structure from table data ; ; =item * ; ; this routine the table data in XML format ; ; =item example: ; ; my(@row) = &EDGAR::Table::toXML(\%parsed, $doc, $seq, $desc); ; ; ; ; =head2 dump ; ; =item * ; ; dump parsed table data - used for debugging ; ; =item example: ; ; &EDGAR::Table::dump(\\%parsed); ; ; ; =back ; ; =head1 COPYRIGHT ; ; Copyright 2005 PEC, Inc. ; ; =head1 AUTHOR ; ; Blah::Blah was written by Brian Powell . ; ; =cut ; ; ") ; definition ; "perl-boilerplate" ; abbreviation ; "Inserts a PERL program command") ; documentation;; ;*###############1 Say you are planning to join 2 tables--well if they are both 1-to-1 after say adding a column to the key area--then you can stop putting things in the key area!--just join them now!!--since the output would of course be 1-to-1!--which is unique and therefore keys are made ;**But you may still be done (if the 2nd table isn't now 1-to-1 as well)--just go ahead and join them--then if 1-to-1 then again your done! ;*To list all tables or views or to show all views or to show all tables: ;select distinct OWNER||'.'||VIEW_name from all_VIEWS; ;select distinct OWNER||'.'||table_name from all_tables; ;**To only return your views or tables, add the following condition: WHERE OWNER = 'POWELLB' ;*############1 SHOCKING NEWS: The idiots at NASS have multiple OCCUPANTIDs for a single CIRENID (for a few cases--but just enough to make things "not add up" every once in a while!! ;**This means: Always output and join on OCCUPANTID when "given the opportunity"!! ;*"Always remember to link DAMAGELOCATOR.CDCID == VEHICLEDEFORMATION.DEFORMID" ;**See the sql-bgp_vehicledeformation-crushprofile-damagelocator template below--as the best model for a template--the "WHERE" clauses are in alphabetic order--and the joins are too--everything is in as much alphabetic order as possible--and the JOINs are done in a simple alphabetic-step-ladder form: ...C.CASEID=DL.CASEID(+) AND DL.CASEID=NCP.CASEID(+)AND NCP.CASEID=V.CASEID(+)...--and even the column names are in alphabetic order (and this alphabetic order works as the backbone for the entire WHERE clause--i.e. CASEID is joined first since it starts with a "C" and then DEFORMATIONLOCATION is joined second since it starts with a "D" etc. ;***The exception to the "alphabetic" rules above of course is the old: ...AND NOR.ORGID=C.CENTERID... and the: ...NASS.ORGANIZATION NOR... which both come at the end of their blocks--so the syntax is simpler--and qa can be done more easily and "it must be in every table!--John" ;*Key cardinalities: ;**Basically it all seems to make intuitive sense if one equates a CIRENID to a person and a CASEID to something like a file in a filing cabinet which covers a whole sequence of events and cars--an entire accident ;***Equivalent to the above (and below) is the following: A person which we collect data about is given a CIRENID and they are "always going to have" the same CASEID and CIRENNUMBER and VEHICLEID--but these latter ID numbers should only be used when necessary since they are not unique to one accident victim. ;**many-CIRENIDs-to-one-VEHICLEID-to-many-IMPACTIDs ;**one-CIRENNUMBER-to-one-CASEID--theory: CIRENNNUMBER is just a "better looking"/not-malformed-crappy "CASEID" 99-blah-blah crap ;**one-CASEID-to-many-VEHICLEIDs--and/or-many-VEHICLEIDs-to-one-CASEID ;***So, any-number-of-VEHICLEIDs-to-any-number-of-CASEID ;**many-CIRENIDs-to-one-CASEID/CIRENNUMBER ;**many-VEHICLEIDs-to-one-CASEID/CIRENNUMBER ;**one-EVENTID-to-one-CRUSH-to-one-MAXCRUSH(a.k.a AVGCRUSH/RESULTANT-CRUSH(e.g. "yes like in RESULTANT force from your physics 101 course"--John) ;**many-CIRENIDs-to-one-CASEID-to-many-VEHICLEIDs ;**one-VEHICLEID-to-many-IMPACTIDs-to-one-IMPACTNUMBER --maybe not true ;**one-CRUSHID-to-one-DEFORMID --this one we are very unsure about--I'll look into this ASAP. ;**one-IMPACTID-to-many-CRUSHIDs ;**one-IMPACTID-to-one-MAXCRUSH-to-one-PDOF-to-one-DELTAV ;*Other cardinalities (cardinalities that I've noticed without the help of say a good diagram from the database creator) ;** ;*Some key defintions: ;**CRUSH==deformation-on-the-exterior ;**INTRUSION==deformation-on-the-interior ;*DEFAULT "SEQUENCE"/priority for JOINs--base it on NASS.VEHICLEDEFORMATION ;1.CIRENID ;2.CASEID ;3.VEHICLEID ;4.DEFORMID ;5.EVENTSEQUENCEID ;6.EVENTSEQUENCENUMBER ;4.D.RANKING ;7.OCCUPANTID ;... ;NEXT-TO-LAST.CIRENNUMBER ;LAST.ORGANIZATION "must be in every table" ;*Similar/confusingly the same/almost indistinguishable tables/extracts ;**Say!!? NASS.VEHICLEDEFORMATION is very much like the IMPACT data "extract". ;**BGP_INJURY_CONTACT is very similar to BGP_INJURY_SOURCE--BGP_INJURY_CONTACT has particulars like "CONTACTID" (which might be interesting/crucial) and "EVIDENCE" (i.e. the reason the crash investigator is making his claim(s) that he believes such-and-such caused the blah injury--while the BGP_INJURY_SOURCE table contains the INJURIES, AISCODES, AIS_TEXT... ;Things to do/look into: ;*Need to recreate the code for these two tables: ;**CIREN_WH.C_IMPACT ;**CIREN_WH.MV_AIRBAGID ;**NASS.MV_MAXCRUSH ;**NASS.MV_STRIKING_STRUCK ;*What the hell is "...DEFORMATIONLOCATION=2" ;*Some notes on queries in Jerry's database--special notes from Jerry: ;* Remember - special joins ;* Always link to AISCODES.NASSCODE to retrieve the AIRS Description ;* DAMAGELOCATOR.CDCID == VEHICLEDEFORMATION.DEFORMID. ;*This one intends to get the essential/best-of of these two "BGP_" tables: BGP_VEHICLEDEFORMATION and BGP_CRUSHPROFILE and BGP_DAMAGELOCATOR ;**BGP_VEHICLEDEFORMATION: CASEID| VEHICLEID| DEFORMID|EVENTSEQUENCEID|DAMAGEDISTRIBUTION|DAMAGEEXTENT|DEFORMATIONLOCATION|DIRECTIONOFFORCE|LONGLATLOCATION|VERTLATLOCATION|LASTUPDATEID|LASTUPDAT|LONGDELTAV| LATDELTAV|IMPACTDELTAV|ENERGYDELTAV|BARRIERDELTAV|TOTALDELTAV|ESTIMATEDDELTAV| RANKING|CLOCK|PICKOVERRIDE|SHIFTINCREMENT|OTHEROVERRIDE ;**BGP_CRUSHPROFILE: CASEID| VEHICLEID| IMPACTID| CRUSHID|PLANEOFIMPACT| MAXCRUSH| CRUSH1| CRUSH2| CRUSH3| CRUSH4| CRUSH5| CRUSH6|DELTAVRATING|C|INACTIVEIND|LASTUPDATEID|LASTUPDAT|PLANECATEGORY|SPECIFYPLANECATEGORY |ORGANIZATION ;**BGP_DAMAGELOCATOR: CASEID| VEHICLEID| IMPACTID|IMPACTNUMBER|LOCATIONDIRECTDAMAGE |LOCATIONFIELDL |LOCATIONMAXCRUSH |DELTALVRATING|LASTUPDATEID|LASTUPDAT|ACCIDENTSEQUENCENO| SMASHL| FIELDL| D| WIDTHCDC| SMASHD|INACTIVEIND|PLANECATEGORY|SPECIFYPLANECATEGORY |I| CDCID ;*This one doesn't seem to work: ;; ;*Caveat from Jerry: "Always remember to link DAMAGELOCATOR.CDCID == VEHICLEDEFORMATION.DEFORMID" ;; (tempo-define-template ;; "sql-bgp_vehicledeformation-crushprofile-damagelocator" ; template name ;; '("--*This line seems to fail: SUBSTR(DECODE(NCP.CRUSHID,NULL,'BLANK','1','VERTICAL','2','LONGITUDINAL','3','LATERAL','4','CATASTROPHIC','5','UNKNOWN',NCP.CRUSHID),1,12) AS DIRECTDESC, ;; --CREATE OR REPLACE VIEW BGP_VEHICLEDEFORMATION_CRUSHPROFILE_DAMAGELOCATOR ;; SELECT ;; DISTINCT ;; /*+ ORDERED */ ;; C.CIRENID, ;; C.CASEID, ;; C.VEHICLEID, ;; NCP.IMPACTID, ;; DL.IMPACTNUMBER, ;; CL.DIRECTDESC CRUSHDIRECTION, ;; VD.DEFORMID, ;; VD.EVENTSEQUENCEID, ;; NCP.MAXCRUSH, ;; VD.DIRECTIONOFFORCE AS PDOF, ;; VD.TOTALDELTAV AS DELTAV, ;; VD.DAMAGEDISTRIBUTION, ;; VD.DAMAGEEXTENT, ;; VD.DEFORMATIONLOCATION, ;; VD.LONGLATLOCATION, ;; VD.VERTLATLOCATION, ;; VD.LONGDELTAV, ;; VD.LATDELTAV, ;; VD.IMPACTDELTAV, ;; VD.ENERGYDELTAV, ;; VD.BARRIERDELTAV, ;; VD.ESTIMATEDDELTAV, ;; VD.RANKING, ;; VD.CLOCKFORCE, ;; VD.PICKOVERRIDE, ;; VD.SHIFTINCREMENT, ;; VD.OTHEROVERRIDE, ;; VD.PICKDELTAVBASIS, ;; VD.SPECIFYDELTAVBASIS, ;; NCP.PLANEOFIMPACT, ;; NCP.CRUSH1, ;; NCP.CRUSH2, ;; NCP.CRUSH3, ;; NCP.CRUSH4, ;; NCP.CRUSH5, ;; NCP.CRUSH6, ;; NCP.DELTAVRATING, ;; NCP.CALCTYPE, ;; NCP.INACTIVEIND, ;; NCP.LASTUPDATEID, ;; NCP.LASTUPDATEDATE, ;; NCP.PLANECATEGORY, ;; NCP.SPECIFYPLANECATEGORY, ;; DL.LOCATIONDIRECTDAMAGE, ;; DL.LOCATIONFIELDL, ;; DL.LOCATIONMAXCRUSH, ;; DL.DELTALVRATING, ;; DL.LASTUPDATEID, ;; DL.LASTUPDATEDATE, ;; DL.ACCIDENTSEQUENCENO, ;; DL.SMASHL, ;; DL.FIELDL, ;; DL.D, ;; DL.WIDTHCDC, ;; DL.SMASHD, ;; DL.INACTIVEIND, ;; DL.PLANECATEGORY, ;; DL.SPECIFYPLANECATEGORY, ;; DL.IFENDSHIFT10CM, ;; SUBSTR(ORGTITLE,1,35) AS ORGANIZATION ;; FROM ;; NASS.VEHICLEDEFORMATION VD, ;; CIREN.CIREN_CASE C, ;; NASS.CDCLOOKUP C1, ;; NASS.CDCLOOKUP C2, ;; NASS.CRUSHDIRECTLOOKUP CL, ;; NASS.CRUSHPROFILE NCP, ;; NASS.DAMAGELOCATOR DL, ;; NASS.INTRUSION I, ;; NASS.VEHICLE V, ;; NASS.ORGANIZATION NOR ;; WHERE C.CASEID > 0 ;; AND C.CASEID=DL.CASEID(+) ;; AND DL.CASEID=I.CASEID(+) ;; AND I.CASEID=NCP.CASEID(+) ;; AND NCP.CASEID=V.CASEID(+) ;; AND V.CASEID=VD.CASEID(+) ;; AND VD.LONGLATLOCATION=C2.CDCID(+) ;; AND C.VEHICLEID=DL.VEHICLEID(+) ;; AND DL.VEHICLEID=I.VEHICLEID(+) ;; AND I.VEHICLEID=NCP.VEHICLEID(+) ;; AND NCP.VEHICLEID=V.VEHICLEID(+) ;; AND V.VEHICLEID=VD.VEHICLEID(+) ;; AND NOR.ORGID=C.CENTERID ;; and c.cirenid = '484026611' ;; and ncp.calctype like '=' ;; ; ;; --AND VD.DEFORMATIONLOCATION=C1.CDCID(+) ;; --AND VD.DEFORMID=DL.CDCID ;; --AND I.PICKINTRUDINGDIRECTION=CL.CRUSHID(+) ;; --AND DL.IMPACTID=NCP.IMPACTID ;; --NCP.CRUSHID, ;; --and c.cirenid = '484026611' ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation ;; From: Scarboro, Mark ;; Sent: Thursday, October 02, 2003 2:17 PM ;; To: Powell, Brian ;; Cc: Machey, John ;; Subject: FW: CIREN/NASS Data ;; Sensitivity: Private ;; -----Original Message----- ;; From: Scarboro, Mark ;; Sent: Thursday, October 02, 2003 12:52 PM ;; To: Radja, Greg ;; Subject: CIREN/NASS Data ;; Sensitivity: Private ;; Greg, ;; Help! ;; I have been pulling from the DB's and have discovered an issue I do not understand. ;; Quick and dirty here it is - ;; I link my CIREN population to NASS via CASEID in the NASS.CASE table then to the NASS.ACCIDENT table by CASEID. ;; Now comes the issue - I link my new dataset to NASS.EVENTS by CASEID - O.K. ;; Now if I check this dataset via VEHICLEID I will find that only one vehicleid is present per CASEID, even if the case has more than one vehicle involved. The majority of the time the VEHICLEID captured in the events table is the CIREN vehicle, but sometimes it is the principle other vehicle. To test I query the events table with just my CIREN vehicleid in the cases where I had received the POV vehicleid I will get 0 rows returned. ;; O.K. now if I take my dataset created after the link to NASS.EVENTS is done - and link that dataset to NASS.VEHICLEDEFORMATION by CASEID and EVENTSEQUENCEID I get a dataset that includes all vehicleid's coded in the case. The data originally sought from the EVENTS table is now populated for the few cases where the CIREN vehicleid was not in the events table. ;; I get the data I was after (I think) -but I do not understand why sometimes the EVENTS table contained data only on the POV. ;; Any thoughts? - ;; PS- Talked to Chip yesterday and it looks like you are good for Michigan later this month (agenda forthcoming). ;; Thanks, ;; Mark ;; -----Original Message----- ;; From: Radja, Greg ;; Sent: Thursday, October 02, 2003 1:46 PM ;; To: Scarboro, Mark ;; Cc: Toth, Adam; McDonald, Vanessa ;; Subject: RE: CIREN/NASS Data ;; Sensitivity: Private ;; Mark, ;; When we code events, we code them (basically) as V1 strikes V2. In this example, V1's VEHICLEID will be found in the EVENTS table. V2 is found in PICKOBJECTCONTACT. HOWEVER, V2 does not have its VEHICLEID stored in PICKOBJECTCONTACT. It has its VEHICLENUMBER stored there. ;; With this in mind, whenever I try to extract vehicle specific info which includes the EVENTS table I create 2 similar queries: One which references the first vehicle in an event (V1 above), and a second one which references the second vehicle in an event (V2 above). I then create a UNION between the two queries to get the output to come out together. ;; Here's an example of a query I've done which shows how I worked with this. The 1st query looks at VEHICLEID in EVENTS, while the 2nd query looks at PICKOBJECTCONTACT. Note the differences between the joins between the EVENTS and VEHICLE tables ... ;; From: Scarboro, Mark ;;;... ;; I called in the calvary on this one - Read my note to Greg concerning our Ted data problem and the VEHICLEID issue in the EVENTS table. ;; Greg has been kind enough to share his code when this type of query is requested - as we have been discussing it appears that some queries are going to require special code. Let me know if this resolves the major BLANKS in Table 2 for MaryPat and Ted. ;; Thanks ;;Does this answer your question? Let me know if I can be of anyother assistance. ;;--Greg (tempo-define-template "sql-bgp_radja" ; template name '("--*DOCUMENTATION-BLAH SELECT SUBSTR(NASSCASESTR,1,12) CASE, SUBSTR(V.VEHICLENUMBER,1,3) VEH, EV.EVENTSEQUENCENUMBER, COUNT(*) DUPS FROM NASS.V_NASSCASES N, NASS.VEHICLE V, NASS.EVENTS EV, NASS.VEHICLEDEFORMATION D, NASS.EDRDATA E WHERE N.CASEID=V.CASEID AND N.CASEID=EV.CASEID AND N.CASEID=D.CASEID AND D.CASEID=E.CASEID AND D.VEHICLEID=V.VEHICLEID AND D.VEHICLEID=E.VEHICLEID AND D.VEHICLEID=EV.VEHICLEID AND D.EVENTSEQUENCEID=EV.EVENTSEQUENCEID AND D.DEFORMID=E.CDCID GROUP BY N.NASSCASESTR, V.VEHICLENUMBER, EV.EVENTSEQUENCENUMBER HAVING COUNT(*) > 1 UNION SELECT SUBSTR(NASSCASESTR,1,12) CASE, SUBSTR(V.VEHICLENUMBER,1,3) VEH, EV.EVENTSEQUENCENUMBER EVENT, COUNT(*) DUPS FROM NASS.V_NASSCASES N, NASS.VEHICLE V, NASS.EVENTS EV, NASS.VEHICLEDEFORMATION D, NASS.EDRDATA E WHERE N.CASEID=V.CASEID AND N.CASEID=EV.CASEID AND N.CASEID=D.CASEID AND D.CASEID=E.CASEID AND D.VEHICLEID=V.VEHICLEID AND D.VEHICLEID=E.VEHICLEID AND V.VEHICLENUMBER=EV.PICKOBJECTCONTACT AND D.EVENTSEQUENCEID=EV.EVENTSEQUENCEID AND D.DEFORMID=E.CDCID GROUP BY N.NASSCASESTR, V.VEHICLENUMBER, EV.EVENTSEQUENCENUMBER HAVING COUNT(*) > 1 ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_oracle-sql*loader-.ctl-loads-.csv-comma-separated-values" ; template name '("#*Inserts an ORACLE example .ctl program that loads the metadata and data of a .csv ORACLE SQL table through SQL*LOADER. --Data file blah.csv 107,\"John Q. Employeedude\",01/02/1998,,45 108,\"Suzy Q. Employeetoo\",03/02/1994,11/15/1998,220 --SQL*LOADER file blah.ctl (or commands pumped into an eshell) to run the .ctl file and load the table into ORALCE SQL*LOADER do something like this: c:> SQLLDR90 briangpowell/blahsecretpassword CONTROL=blah.ctl LOG=blah.log LOAD DATA INFILE 'c:\\blah.csv' INTO TABLE EMPLOYEE ( EMPLOYEE_ID INTEGER EXTERNAL TERMINATED BY ',', EMPLOYEE_NAME CHAR TERMINATED BY ',' OPTIONALLY ENCLOSED BY `\"', EMPLOYEE_HIRE_DATE DATE \"MM/DD/YYYY\" TERMINATED BY ',', EMPLOYEE_TERMINATION_DATE DATE \"MM/DD/YYYY\" TERMINATED BY ',', EMPLOYEE_BILLING_RATE DECIMAL EXTERNAL TERMINATED BY ',' ) ") ; definition "s-jj" ; abbreviation "Inserts an ORACLE example .ctl program that loads the metadata and/or data of a .csv ORACLE SQL table through SQL*LOADER. ") ; documentation (tempo-define-template "sql-bgp_oracle-sql*loader-.ctl-loads-fixed-width-values" ; template name '("#*Inserts an ORACLE example .ctl program that loads the metadata and data of a fixed-width ORACLE SQL table through SQL*LOADER. --Data file blah.txt 00107 John Q. Employeedude 01/02/1998 +045.00 00108 Suzy Q. Employeetoo 03/02/1994 11/15/1998 +220.00 --SQL*LOADER file blah.ctl (or commands pumped into an eshell) to run the .ctl file and load the table into ORALCE SQL*LOADER do something like this: c:> SQLLDR90 briangpowell/blahsecretpassword CONTROL=blah.ctl LOG=blah.log LOAD DATA INFILE 'c:\\blah.txt' INTO TABLE EMPLOYEE ( EMPLOYEE_ID POSITION (1:6) INTEGER EXTERNAL, EMPLOYEE_NAME POSITION (8:28) CHAR, EMPLOYEE_HIRE_DATE POSITION (9:38) DATE \"MM/DD/YYYY\", EMPLOYEE_TERMINATION_DATE POSITION (40:49) DATE \"MM/DD/YYYY\" NULLIF EMPLOYEE_TERMINATION_DATE=BLANKS, EMPLOYEE_BILLING_RATE POSITION (51:57) DECIMAL EXTERNAL ) ") ; definition "s-jj" ; abbreviation "Inserts an ORACLE example .ctl program that loads the metadata and/or data of a .txt ORACLE SQL table through SQL*LOADER. ") ; documentation ;*1-to-many (tempo-define-template "sql-bgp_events" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_NUMBEROFEVENTS CREATE OR REPLACE VIEW BGP_NUMBEROFEVENTS AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, E.EVENTSEQUENCENUMBER AS NUMBEROFEVENTS, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.EVENTS E, NASS.ORGANIZATION NOR WHERE CCC.CIRENID > 0 AND CCC.CASEID > 0 AND CCC.CASEID=E.CASEID(+) AND CCC.VEHICLEID=E.VEHICLEID(+) AND NOR.ORGID=CCC.CENTERID AND ((E.EVENTSEQUENCENUMBER > '0') AND (E.EVENTSEQUENCENUMBER < '999')) ; --DROP VIEW BGP_MAXNUMBEROFEVENTS; CREATE OR REPLACE VIEW BGP_MAXNUMBEROFEVENTS AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(BGP_NUMBEROFEVENTS.NUMBEROFEVENTS) AS MAXNUMBEROFEVENTS FROM CIREN.CIREN_CASE C, NASS.EVENTS E, POWELLB.BGP_NUMBEROFEVENTS BGP_NUMBEROFEVENTS WHERE C.CIRENID > 0 AND C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.CIRENID=BGP_NUMBEROFEVENTS.CIRENID(+) AND ((BGP_NUMBEROFEVENTS.NUMBEROFEVENTS > '0') AND (BGP_NUMBEROFEVENTS.NUMBEROFEVENTS < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_EVENTS; --CREATE OR REPLACE VIEW BGP_EVENTS AS SELECT DISTINCT C.CIRENID, E.EVENTSEQUENCEID, E.EVENTSEQUENCENUMBER, C.VEHICLEID, E.VEHICLEID AS CIREN_CASE_VEHICLEID, DECODE(E.PICKOBJECTCONTACTCLASS,1,CSV2.VEHICLEID) AS STRUCK_VEHICLEID, BGP_MAXNUMBEROFEVENTS.MAXNUMBEROFEVENTS, CSV1.VEHICLENUMBER AS CIREN_CASE_VEHICLE_NO, STRIKEL.VEHICLECLASSID AS CIREN_VEHICLE_CLASS_ID, STRIKEL.DESCRIPTION AS CIREN_CASE_VEHICLE_CLASS, STRIKEG.GADID, STRIKEG.DESCRIPTION AS CIREN_CASE_GAD, STRUCKL.VEHICLECLASSID AS STRUCK_VEHICLE_CLASS_ID,, STRUCKL.DESCRIPTION AS STRUCK_VEHICLE_CLASS, E.PICKCONTACTVEHICLEDAMAGE, STRUCKG.DESCRIPTION AS STRUCK_VEHICLE_GAD, E.PICKOBJECTCONTACTCLASS, STRUCKOC.DESCRIPTION AS STRUCK_OBJECT_CLASS, E.PICKOBJECTCONTACT, STRUCKO.DESCRIPTION AS STRUCK_OBJECT, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, POWELLB.BGP_MAXNUMBEROFEVENTS BGP_MAXNUMBEROFEVENTS, NASS.EVENTS E, NASS.CASESTRUCTUREVEHICLES CSV1, NASS.CASESTRUCTUREVEHICLES CSV2, NASS.VEHICLE V, NASS.VEHICLECLASSLOOKUP STRIKEL, NASS.VEHICLECLASSLOOKUP STRUCKL, NASS.GADLOOKUP STRIKEG, NASS.GADLOOKUP STRUCKG, NASS.OBJECTCONTACTLOOKUP STRUCKO, NASS.OBJECTCONTACTCATLOOKUP STRUCKOC, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID AND (C.VEHICLEID=V.VEHICLEID OR C.VEHICLEID=CSV2.VEHICLEID) AND C.CIRENID=BGP_MAXNUMBEROFEVENTS.CIRENID(+) AND E.VEHICLEID=CSV1.VEHICLEID AND E.VEHICLEID=V.VEHICLEID AND V.PICKVEHICLECLASS=STRIKEL.VEHICLECLASSID(+) AND E.PICKAREAOFDAMAGE=STRIKEG.GADID(+) AND E.PICKOBJECTCONTACTCLASS=STRUCKOC.CONTACTCATID(+) AND E.PICKOBJECTCONTACT=STRUCKO.OBJECTCONTACTID(+) AND E.PICKCONTACTVEHICLECLASS=STRUCKL.VEHICLECLASSID(+) AND E.PICKCONTACTVEHICLEDAMAGE=STRUCKG.GADID(+) AND E.PICKOBJECTCONTACT=CSV2.VEHICLENUMBER(+) AND E.CASEID=CSV2.CASEID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;; *NASS.OCCUPANTINJURY || **BLOODGIVENUNITS || **2154 || **Unknown if blood given -99 || **No Blood Given 0 || **1 Unit given 1 || **10 or more Units given 10 || **Blood given, # units unknown 11 || **2 Unit given 2 || **3 Unit given 3 || **4 Unit given 4 || **5 Unit given 5 || **6 Unit given 6 || **7 Unit given 7 || **8 Unit given 8 || **9 Unit given 9 ;; *NASS.OCCUPANTINJURY || **PICKABGRESULTS || **2152 || **Not Injured 0 || **Injured, ABGs not measured or reported 1 || **ABG = 10 10 || **ABG = 11 11 || **ABG = 12 12 || **ABG = 13 13 || **ABG = 14 14 || **ABG = 15 15 || **ABG = 16 16 || **ABG = 17 17 || **ABG = 18 18 || **ABG = 19 19 || **ABG = 2 2 || **ABG = 20 20 || **ABG = 21 21 || **ABG = 22 22 || **ABG = 23 23 || **ABG = 24 24 || **ABG = 25 25 || **ABG = 26 26 || **ABG = 27 27 || **ABG = 28 28 || **ABG = 29 29 || **ABG = 3 3 || **ABG = 30 30 || **ABG = 31 31 || **ABG = 32 32 || **ABG = 33 33 || **ABG = 34 34 || **ABG = 35 35 || **ABG = 36 36 || **ABG = 37 37 || **ABG = 38 38 || **ABG = 39 39 || **ABG = 4 4 || **ABG = 40 40 || **ABG = 41 41 || **ABG = 42 42 || **ABG = 43 43 || **ABG = 44 44 || **ABG = 45 45 || **ABG = 46 46 || **ABG = 47 47 || **ABG = 48 48 || **ABG = 49 49 || **ABG = 5 5 || **ABG = 50 50 || **ABG = 6 6 || **ABG = 7 7 || **ABG = 8 8 || **ABG = 9 9 || **ABGs reported, HCO3 unknown 96 || **Injured, details unknown 97 || **Unknown if injured 99 ;; *NASS.OCCUPANTINJURY || **PICKFACILITYTYPE || **1267 || **Not treated at a medical facility 1 || **Trauma Center 2 || **Hospital 3 || **Medical clinic 4 || **Physician's Office 5 || **Treatment later at medical facility 6 || **Other (specify) 7 || **Unknown 8 ;; *NASS.OCCUPANTINJURY || **PICKGCSSCORE || **2150 || **Not Injured 0 || **Injured - not treated at medical facility 1 || **GCS = 10 10 || **GCS = 11 11 || **GCS = 12 12 || **GCS = 13 13 || **GCS = 14 14 || **GCS = 15 15 || **No GCS Score at medical facility 2 || **GCS = 3 3 || **GCS = 4 4 || **GCS = 5 5 || **GCS = 6 6 || **GCS = 7 7 || **GCS = 8 8 || **GCS = 9 9 || **Injured, details unknown 97 || **Unknown if injured 99 ;; *NASS.OCCUPANTINJURY || **PICKINITIALTREATMENT || **1265 || **No treatment 0 || **Hospitalization 1 || **Dead Prior To Admission 10 || **Transported and released 2 || **Treatment at scene - nontransported 3 || **Treatment later 4 || **Treatment - other (specify) 5 || **Transported to a medical facility-unknown if treated 6 || **Unknown 7 || **Dead on Arrival (DOA) at hospital 8 ;; *NASS.OCCUPANTINJURY || **PICKMORTALITY || **1263 || **Not Fatal 1 || **Fatal 2 || **Fatal - ruled disease (specify) 3 ;; *NASS.OCCUPANTINJURY || **PICKPOLICEINJURYSEVERITY || **1262 || **O - No injury 1 || **C - Possible injury 2 || **B - Nonincapacitating injury 3 || **A - Incapacitating injury 4 || **K - Killed 5 || **U - Injury, severity unknown 6 || **Died prior to crash 7 || **Unknown 8 (tempo-define-template "sql-bgp_ems-response-accident-medical-facility-arrival-times" ; template name '("-- EMS RESPONSE AND ACCIDENT TIME AND MEDICAL FACILITY ARRIVAL time: --DROP VIEW BGP_EMS_RSPNS_ACCDNT_MDCL; --CREATE OR REPLACE VIEW BGP_EMS_RSPNS_ACCDNT_MDCL AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NA.ACCIDENTTIME AS ACCIDENT_TIME, EMODE.DESCRIPTION AS EMSMODE, EMS.MEDARRIVALTIME AS MEDICAL_FACILITY_ARRIVAL_TIME, NOI.NUMDAYSHOSPITALIZED, SUBSTR(QL1.OPTIONTEXT,1,50) AS BLOODGIVENUNITS, SUBSTR(QL2.OPTIONTEXT,1,50) AS PICKABGRESULTS, SUBSTR(QL3.OPTIONTEXT,1,50) AS PICKFACILITYTYPE, SUBSTR(QL4.OPTIONTEXT,1,50) AS PICKGCSSCORE, SUBSTR(QL5.OPTIONTEXT,1,50) AS PICKINITIALTREATMENT, SUBSTR(QL6.OPTIONTEXT,1,50) AS PICKPOLICEINJURYSEVERITY, NOI.SPECIFYFACILITYTYPE, NOI.SPECIFYWORKDAYSLOST, CCI.INJURYID, CCI.AISCODE, SUBSTR(NAC.AISCODES,1,1) AS REGION, DECODE(SUBSTR(NAC.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(NAC.AISCODES,7,1) AS AIS, DECODE(SUBSTR(NAC.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, NAC.DESCRIPTION, NOI.TIMETODEATH, NOI.DEATHDATE, NOI.DEATHTIME, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.CIRENINJURY CCI, NASS.ACCIDENT NA, NASS.AISCODES NAC, NASS.EMSMODELOOKUP EMODE, NASS.EMSRESPONSE EMS, NASS.EMSTYPELOOKUP TYPE, NASS.OCCUPANTINJURY NOI, NASS.QUESTIONLOOKUP VEH, NASS.QUESTIONLOOKUP QL1, NASS.QUESTIONLOOKUP QL2, NASS.QUESTIONLOOKUP QL3, NASS.QUESTIONLOOKUP QL4, NASS.QUESTIONLOOKUP QL5, NASS.QUESTIONLOOKUP QL6, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.OCCUPANTID > 0 AND CCC.CIRENID=CCI.CIRENID(+) AND CCI.AISCODE=NAC.NASSCODE(+) AND CCC.CASEID=NOI.CASEID(+) AND CCC.OCCUPANTID=NOI.OCCUPANTID(+) AND CCC.CASEID=NA.CASEID(+) AND CCC.CASEID=EMS.CASEID(+) AND CCC.VEHICLEID=NOI.VEHICLEID(+) AND EMS.EMSTYPE=TYPE.ID(+) AND EMS.EMSMODE=EMODE.ID(+) AND EMS.VEHICLETYPEID=VEH.OPTIONVALUE(+) AND VEH.DATAITEMID(+)=3040 AND NOI.BLOODGIVENUNITS=QL1.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=2154 AND NOI.PICKABGRESULTS=QL2.OPTIONVALUE(+) AND QL2.DATAITEMID(+)=2152 AND NOI.PICKFACILITYTYPE=QL3.OPTIONVALUE(+) AND QL3.DATAITEMID(+)=1267 AND NOI.PICKGCSSCORE=QL4.OPTIONVALUE(+) AND QL4.DATAITEMID(+)=2150 AND NOI.PICKINITIALTREATMENT=QL5.OPTIONVALUE(+) AND QL5.DATAITEMID(+)=1265 AND NOI.PICKPOLICEINJURYSEVERITY=QL6.OPTIONVALUE(+) AND QL6.DATAITEMID(+)=1262 AND NOR.ORGID=CCC.CENTERID(+) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_lookuptables" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.ACTIONCATLOOKUP; SELECT * FROM NASS.ACTIONLOOKUP; SELECT * FROM NASS.AIRBAGTYPELOOKUP; SELECT * FROM NASS.AISCODES; SELECT * FROM NASS.ANTHROLOOKUP; SELECT * FROM NASS.AREALOOKUP; SELECT * FROM NASS.ASPECTLOOKUP; SELECT * FROM NASS.ATMOSPHERELOOKUP; SELECT * FROM NASS.BODYCATEGORYLOOKUP; SELECT * FROM NASS.BODYREGIONLOOKUP; SELECT * FROM NASS.BODYTYPELOOKUP; SELECT * FROM NASS.BPMETHODLOOKUP; SELECT * FROM NASS.CARGOBODYLOOKUP; SELECT * FROM NASS.CASESTATUSLOOKUP; SELECT * FROM NASS.CASESTRUCTUREOCCUPANTS; SELECT * FROM NASS.CASESTRUCTUREVEHICLES; SELECT * FROM NASS.CATEGORYLOOKUP; SELECT * FROM NASS.CDCLOOKUP; SELECT * FROM NASS.CDSTYPELOOKUP; SELECT * FROM NASS.CHARGETYPELOOKUP; SELECT * FROM NASS.CHILDSEATDESIGNLOOKUP; SELECT * FROM NASS.CHILDSEATLOOKUP; SELECT * FROM NASS.CHILDSEATMAKE; SELECT * FROM NASS.CHILDSEATORIENTCATEGORY; SELECT * FROM NASS.CHILDSEATUSAGELOOKUP; SELECT * FROM NASS.CIRENSTATUSLOOKUP; SELECT * FROM NASS.CLOTHINGLOOKUP; SELECT * FROM NASS.COLLISIONMANNERLOOKUP; SELECT * FROM NASS.COMPLICATIONLOOKUP; SELECT * FROM NASS.CONFIDENCELOOKUP; SELECT * FROM NASS.CONTACTLOOKUP; SELECT * FROM NASS.CONTRIBUTORLOOKUP; SELECT * FROM NASS.CONTROLLOOKUP; SELECT * FROM NASS.CORRECTACTIONCATLOOKUP; SELECT * FROM NASS.CORRECTIVEACTIONLOOKUP; SELECT * FROM NASS.CPTLOOKUP; SELECT * FROM NASS.CRASHCATLOOKUP; SELECT * FROM NASS.CRASHCONFIGLOOKUP; SELECT * FROM NASS.CRASHTYPELOOKUP; SELECT * FROM NASS.CRITICALEVENTCATLOOKUP; SELECT * FROM NASS.CRITICALEVENTLOOKUP; SELECT * FROM NASS.CRUSHDIRECTLOOKUP; SELECT * FROM NASS.DAMAGESEVERITYLOOKUP; SELECT * FROM NASS.DELTAVBASISCATLOOKUP; SELECT * FROM NASS.DELTAVBASISLOOKUP; SELECT * FROM NASS.DEMOCATLOOKUP; SELECT * FROM NASS.DEMOLOOKUP; SELECT * FROM NASS.DEPOWERLOOKUP; SELECT * FROM NASS.DEVICECATLOOKUP; SELECT * FROM NASS.DEVICELOOKUP; SELECT * FROM NASS.DIRINDIRINJURYLOOKUP; SELECT * FROM NASS.DISPOSITIONLOOKUP; SELECT * FROM NASS.DRIVERPRESENCELOOKUP; SELECT * FROM NASS.EJECTIONLOOKUP; SELECT * FROM NASS.EMSCARELOOKUP; SELECT * FROM NASS.EMSMODELOOKUP; SELECT * FROM NASS.EMSSAFETYLOOKUP; SELECT * FROM NASS.EMSSIGNLOOKUP; SELECT * FROM NASS.EMSTREATMENTLOOKUP; SELECT * FROM NASS.EMSTYPELOOKUP; SELECT * FROM NASS.EVENTS; SELECT * FROM NASS.EVIDENCELOOKUP; SELECT * FROM NASS.FACILITYLOOKUP; SELECT * FROM NASS.FACTORLOOKUP; SELECT * FROM NASS.GADLOOKUP; SELECT * FROM NASS.GCSLOOKUP; SELECT * FROM NASS.GENPOSITIONLOOKUP; SELECT * FROM NASS.GESCRITICALEVENTLOOKUP; SELECT * FROM NASS.GESDISTRACTLOOKUP; SELECT * FROM NASS.GLAZINGLOCATIONLOOKUP; SELECT * FROM NASS.GLAZINGTYPE; SELECT * FROM NASS.ICDMCODELOOKUP; SELECT * FROM NASS.IMAGETYPELOOKUP; SELECT * FROM NASS.IMPAIRLOOKUP; SELECT * FROM NASS.INITIALPOINTLOOKUP; SELECT * FROM NASS.INJURYSEVERITYLOOKUP; SELECT * FROM NASS.INJURYSOURCECATLOOKUP; SELECT * FROM NASS.INJURYSOURCELOOKUP; SELECT * FROM NASS.INTEGRITYLOCATIONLOOKUP; SELECT * FROM NASS.INTEGRITYTYPE; SELECT * FROM NASS.INTERIORCOMPARTCATREF; SELECT * FROM NASS.INTERIORCOMPARTREF; SELECT * FROM NASS.INTERVIEWREASONLOOKUP; SELECT * FROM NASS.INTRUDINGCOMPONENTCLASS; SELECT * FROM NASS.INTRUDINGTYPE; SELECT * FROM NASS.INTRUSIONMAGNITUDE; SELECT * FROM NASS.INTRUSIONROWLOOKUP; SELECT * FROM NASS.INTUBELOOKUP; SELECT * FROM NASS.JUNCTIONRELCATLOOKUP; SELECT * FROM NASS.JUNCTIONRELLOOKUP; SELECT * FROM NASS.JURISDICTIONSLOOKUP; SELECT * FROM NASS.LANDUSELOOKUP; SELECT * FROM NASS.LIGHTLOOKUP; SELECT * FROM NASS.LOCATIONLOOKUP; SELECT * FROM NASS.LOCUSLOOKUP; SELECT * FROM NASS.LOOKUPTABLE_NAME; SELECT * FROM NASS.LU_CARRIER; SELECT * FROM NASS.LU_COMPLIANCE; SELECT * FROM NASS.LU_COMPLIANCECAT; SELECT * FROM NASS.LU_DRUG; SELECT * FROM NASS.LU_HAZINSPECTIONITEM; SELECT * FROM NASS.LU_HAZMATERIAL; SELECT * FROM NASS.LU_PRODUCTTYPE; SELECT * FROM NASS.LU_TRUCKMAKES; SELECT * FROM NASS.LU_VIOLATIONS; SELECT * FROM NASS.MAKELOOKUP; SELECT * FROM NASS.MANNERLEFTLOOKUP; SELECT * FROM NASS.MANUEVERLOOKUP; SELECT * FROM NASS.MEASUREITEMLOOKUP; SELECT * FROM NASS.MECHANISMLOOKUP; SELECT * FROM NASS.MEDICALFACILITIESLOOKUP; SELECT * FROM NASS.MEDICALREASONLOOKUP; SELECT * FROM NASS.MEDICALRECTYPELOOKUP; SELECT * FROM NASS.MODELLOOKUP; SELECT * FROM NASS.NHS_ROADWAYCATLOOKUP; SELECT * FROM NASS.NHS_ROADWAYLOOKUP; SELECT * FROM NASS.OBJECTCONTACTCATLOOKUP; SELECT * FROM NASS.OBJECTCONTACTLOOKUP; SELECT * FROM NASS.OBJECTHITCATLOOKUP; SELECT * FROM NASS.OBJECTHITLOOKUP; SELECT * FROM NASS.ODOMETERLOOKUP; SELECT * FROM NASS.OPERATORLOOKUP; SELECT * FROM NASS.ORGANINJURYLOOKUP; SELECT * FROM NASS.ORGANIZATION; SELECT * FROM NASS.OVERRIDELOOKUP; SELECT * FROM NASS.PAYORLOOKUP; SELECT * FROM NASS.PEDBIKECATLOOKUP; SELECT * FROM NASS.PEDBIKELOOKUP; SELECT * FROM NASS.PERSONTYPELOOKUP; SELECT * FROM NASS.PLANEIMPACTCATEGORY; SELECT * FROM NASS.PLANEIMPACTLOOKUP; SELECT * FROM NASS.POLICE_ALCOHOLLOOKUP; SELECT * FROM NASS.POLICE_DRUGLOOKUP; SELECT * FROM NASS.POSTURELOOKUP; SELECT * FROM NASS.PULSEDESCLOOKUP; SELECT * FROM NASS.QUALITYTYPELOOKUP; SELECT * FROM NASS.QUESTIONLOOKUP; SELECT * FROM NASS.RANGECHECKLOOKUP; SELECT * FROM NASS.RESEARCHERNUMBER; SELECT * FROM NASS.RESPDESCLOOKUP; SELECT * FROM NASS.RESTRAINTCATLOOKUP; SELECT * FROM NASS.RESTRAINTLOOKUP; SELECT * FROM NASS.ROADWAYRELLOOKUP; SELECT * FROM NASS.ROLELOOKUP; SELECT * FROM NASS.ROLLOVERTYPELOOKUP; SELECT * FROM NASS.SAFETYLOOKUP; SELECT * FROM NASS.SCENEINSPTYPELOOKUP; SELECT * FROM NASS.SEATLOOKUP; SELECT * FROM NASS.SEATRECLINELOOKUP; SELECT * FROM NASS.SEXLOOKUP; SELECT * FROM NASS.SPECIALUSELOOKUP; SELECT * FROM NASS.STATELOOKUP; SELECT * FROM NASS.TABLOOKUP; SELECT * FROM NASS.TEMPMETHODLOOKUP; SELECT * FROM NASS.TESTLOOKUP; SELECT * FROM NASS.TRUCKTRAILER; SELECT * FROM NASS.USERS; SELECT * FROM NASS.VEHACTIONLOOKUP; SELECT * FROM NASS.VEHICLECLASSLOOKUP; SELECT * FROM NASS.VIOLATIONSLOOKUP; SELECT * FROM NASS.VISIONLOOKUP; SELECT * FROM NASS.VITALRANKLOOKUP; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_cdc" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CDC; --CREATE OR REPLACE VIEW BGP_CDC AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, WSV.PDOF, WSV.CDC, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.WSVEHICLE WSV, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND ((WSV.PDOF > -1) AND (WSV.PDOF < 361)) AND CCC.CASEID=WSV.CASEID(+) AND CCC.VEHICLEID=WSV.VEHICLEID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_ota_view" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM OTA_VIEW ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; (tempo-define-template "progress-bgp_grant-priveleges" ; template name '("/* Not sure about the semicolons here. */ GRANT RESOURCE, DBA TO 'powellbg' ; COMMIT ; ") ; definition "s-jjj" ; abbreviation "Inserts a PROGRESS SQL program command") ; documentation (tempo-define-template "progress-bgp_begin-data-dump" ; template name '("/* This one ptmdump.p may dump the database we want */ CONNECT CC8X_Journ. RUN ptmdump.p(\"ALL\"). /* This one ptmdp.p may dump the database we want */ CONNECT CC8X_Journ. RUN ptmd.p(\"ALL\"). ") ; definition "s-jjj" ; abbreviation "Inserts a PROGRESS SQL program command") ; documentation (tempo-define-template "progress-bgp_data-dump-using-odbc-maybe" ; template name '("/* This one ptmdump.p may dump the database we want */ CONNECT CC8X_Journ. RUN ptmsec.p. ") ; definition "s-jjj" ; abbreviation "Inserts a PROGRESS SQL program command") ; documentation (tempo-define-template "sql-bgp_vehiclecrash" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.VEHICLECRASH ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;; ;*Old version ;; (tempo-define-template ;; "sql-bgp_steerdeformation" ; template name ;; '("--*DOCUMENTATION-BLAH ;; SELECT ;; DISTINCT ;; /*+ ORDERED */ ;; CCC.CIRENID, ;; CCC.CASEID, ;; CCC.VEHICLEID, ;; NS.STEERID, ;; NS.COMPVALUE, ;; NS.DAMAGEVALUE, ;; NS.DEFORMATIONVALUE, ;; NS.RATING, ;; NS.VALIDDEFORMATION, ;; SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION ;; FROM ;; CIREN.CIREN_CASE CCC, ;; NASS.STEERDEFORMATION NS, ;; NASS.ORGANIZATION NOR ;; WHERE CCC.CASEID > 0 ;; AND CCC.CASEID=NS.CASEID(+) ;; AND CCC.VEHICLEID=NS.VEHICLEID(+) ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_steerdeformation" ; template name '("--*DOCUMENTATION-BLAH SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NS.STEERID, NS.COMPVALUE, NS.DAMAGEVALUE, NS.DEFORMATIONVALUE, NS.VALIDDEFORMATION, SUBSTR(QL1.OPTIONTEXT,1,50) AS DRIVINGEQUIPEXIST, NI.ODOMETER, NI.SPECIFYODOMETERSOURCE, SUBSTR(QL2.OPTIONTEXT,1,50) AS PICKBOLSTERCOVERING, SUBSTR(QL3.OPTIONTEXT,1,50) AS PICKTELEADJUSTCOLUMN, SUBSTR(QL4.OPTIONTEXT,1,50) AS PICKTILTADJUSTCOLUMN, SUBSTR(QL5.OPTIONTEXT,1,50) AS PICKTYPEOFCOLUMN, PICKSTEERRIMDEF, SUBSTR(QL6.OPTIONTEXT,1,50) AS PICKLOCSTEERRIMDEF, SUBSTR(QL7.OPTIONTEXT,1,50) AS PICKIPDAMAGEOCC, SUBSTR(QL8.OPTIONTEXT,1,50) AS PICKKBDAMAGEOCC, SUBSTR(QL9.OPTIONTEXT,1,50) AS PICKGLOVEDOOROPEN, NI.PICKODOMETERSOURCE, NI.PEDALEXTENDID, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.INTERIORVEHICLE NI, NASS.QUESTIONLOOKUP QL1, NASS.QUESTIONLOOKUP QL2, NASS.QUESTIONLOOKUP QL3, NASS.QUESTIONLOOKUP QL4, NASS.QUESTIONLOOKUP QL5, NASS.QUESTIONLOOKUP QL6, NASS.QUESTIONLOOKUP QL7, NASS.QUESTIONLOOKUP QL8, NASS.QUESTIONLOOKUP QL9, NASS.STEERDEFORMATION NS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NS.CASEID(+) AND CCC.VEHICLEID=NS.VEHICLEID(+) AND CCC.CASEID=NI.CASEID(+) AND CCC.VEHICLEID=NI.VEHICLEID(+) AND NI.DRIVINGEQUIPEXIST=QL1.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=1541 AND NI.PICKBOLSTERCOVERING=QL2.OPTIONVALUE(+) AND QL2.DATAITEMID(+)=1536 AND NI.PICKTELEADJUSTCOLUMN=QL3.OPTIONVALUE(+) AND QL3.DATAITEMID(+)=1527 AND NI.PICKTILTADJUSTCOLUMN=QL4.OPTIONVALUE(+) AND QL4.DATAITEMID(+)=1525 AND NI.PICKTYPEOFCOLUMN=QL5.OPTIONVALUE(+) AND QL5.DATAITEMID(+)=1522 AND NI.PICKLOCSTEERRIMDEF=QL6.OPTIONVALUE(+) AND QL6.DATAITEMID(+)=1530 AND NI.PICKIPDAMAGEOCC=QL7.OPTIONVALUE(+) AND QL7.DATAITEMID(+)=1535 AND NI.PICKKBDAMAGEOCC=QL8.OPTIONVALUE(+) AND QL8.DATAITEMID(+)=1538 AND NI.PICKGLOVEDOOROPEN=QL9.OPTIONVALUE(+) AND QL9.DATAITEMID(+)=1539 AND NOR.ORGID=CCC.CENTERID(+) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_abg" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM CIREN.ABG ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_nass-otherresponses" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.OTHERRESPONSES ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;;*Child seats and there contacts for less than 13 olds: ;*This data will not be released to me from NHTSA: ;... ;CIR1.CRASHDATE, ;... (tempo-define-template "sql-bgp_childseat-injury-source" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CHILDSEAT_INJURY_SOURCE; --CREATE OR REPLACE VIEW BGP_CHILDSEAT_INJURY_SOURCE AS SELECT DISTINCT /*+ ORDERED */ CIR1.CIRENID, CIR.INJURYID, CIR.AISCODE, SUBSTR(AIS.DESCRIPTION,1,100) AIS_DESCRIPTION, A.ASPECTID, SUBSTR(A.DESCRIPTION,1,60) ASPECT_DESCRIPTION, SUBSTR(ISC.DESCRIPTION,1,60) AREA_DESCRIPTION, SUBSTR(INS.DESCRIPTION,1,60) INJURY_SOURCE, DECODE(SUBSTR(AIS.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(AIS.AISCODES,7,1) AS AIS, DECODE(SUBSTR(AIS.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, CIR.SOURCEID, CIR.SOURCECONFIDENCEID, SEATLOC.SEATLOCID, SEATLOC.SEATROW ROW_SEAT, SEATLOC.SEATLOCATION LOCATION_SEAT, SEATLOC.PICKSEATTYPE, CHI.CHILDSEATID, CHI.CHILDSEATMAKEID, CHI.PICKMODELID, CHI.PICKCHILDSEATTYPE, CHI.PICKSHIELDUSAGE, CHI.PICKTETHERUSAGE, INS.INJURYSOURCEID, INS.INJURYSOURCECATID, INS.DESCRIPTION, AB.AIRBAGID, CIR.CIRENINJURYLINKID OTHERINJURYID, DI.DESCRIPTION DIRECTINDIRECT, CONF.CONFDESC CONFIDENCE_LEVEL, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CIR1, CIREN.CIRENINJURY CIR, CIREN.INJURYASPECT ASPECT, CIREN_WH.MV_AIRBAGID AB, NASS.AISCODES AIS, NASS.ASPECTLOOKUP A, NASS.CHILDSEAT CHI, NASS.CONFIDENCELOOKUP CONF, NASS.DIRINDIRINJURYLOOKUP DI, NASS.INJURYSOURCECATLOOKUP ISC, NASS.INJURYSOURCELOOKUP INS, NASS.SEATLOC SEATLOC, NASS.ORGANIZATION NOR WHERE CIR1.CIRENID=CIR.CIRENID(+) AND CIR.AISCODE=AIS.NASSCODE(+) AND CIR.CIRENID=ASPECT.CIRENID(+) AND CIR.INJURYID=ASPECT.INJURYID(+) AND ASPECT.ASPECTID=A.ASPECTID(+) AND CIR.SOURCEID=INS.INJURYSOURCEID(+) AND INS.INJURYSOURCECATID=ISC.INJURYSOURCECATID(+) AND CIR.CIRENID=AB.CIRENID(+) AND CIR.SOURCEID=AB.INJURYSOURCEID(+) AND CIR.INJURYID=AB.INJURYID(+) AND CIR.DIRECTINDIRECT=DI.DIRINDIRID(+) AND CIR.SOURCECONFIDENCEID=CONF.CONFIDENCEID(+) AND CIR1.CASEID=SEATLOC.CASEID(+) AND CIR1.VEHICLEID=SEATLOC.VEHICLEID(+) AND SEATLOC.VEHICLEID=CHI.VEHICLEID(+) AND SEATLOC.SEATLOCID=CHI.SEATLOCID(+) AND CIR.SOURCEID=INS.INJURYSOURCEID(+) AND CIR1.AGE < 168 AND ((CIR1.STATUSID > 14) OR (CIR1.STATUSID = 3)) AND NOR.ORGID=CIR1.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_cathy-injury-source-and-confidence-level" ; template name '("--*DOCUMENTATION-BLAH SELECT DISTINCT /*+ ORDERED */ CC.CIRENID, CENTERID, CIRENNUMBER, SUBSTR(AISCODE,1,7) AS AIS, A1.DESCRIPTION AS \"AIS DESCRIPTION\", SUBSTR(AISCODE,1,1) AS BODY, DECODE(SUBSTR(AISCODE,1,1),1,'HEAD',2,'FACE', 3,'NECK', 4,'THORAX', 5,'ABDOMEN', 6,'SPINE', 7,'UPPER EXTREMITY', 8,'LOWER EXTREMITY', 9,'UNSPECIFIED') AS BODYREGION, SUBSTR(AISCODE,7,1)AS SEVERITY, DIRECTINDIRECT, A2.DESCRIPTION AS \"CONTACT\", SOURCEID, A3.DESCRIPTION AS \"INJURY SOURCE\", CONFIDENCEID, A4.CONFDESC AS \"CONFIDENCE\" FROM CIREN.CIREN_CASE CC, CIREN.CIRENINJURY CI, NASS.AISCODES A1, NASS.CIRENSTATUSLOOKUP CS, NASS.DIRINDIRINJURYLOOKUP A2, NASS.INJURYSOURCELOOKUP A3, NASS.CONFIDENCELOOKUP A4 WHERE CC.CIRENID=CI.CIRENID AND CS.STATUSID=CC.STATUSID AND CI.AISCODE=A1.NASSCODE AND A2.DIRINDIRID=CI.DIRECTINDIRECT AND A3.INJURYSOURCEID=CI.SOURCEID AND A4.CONFIDENCEID=CI.SOURCECONFIDENCEID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*NASS.ENTRAPMENT || **MOBILITYRESTRICTION || **1185 || **Occupant fatal before removed from vehicle 1 || **Removed from vehicle while unconscious or not oriented to time o 2 || **Removed from vehicle due to perceived serious injuries 3 || **Exited vehicle with some assistance 4 || **Exited vehicle under own power 5 || **Occupant fully ejected 6 || **Removed from vehicle for other reasons, (specify) 7 || **Unknown 8 ;*NASS.ENTRAPMENT || **PICKENTRAPMENT || **1182 || **Not entrapped/exit not inhibited 1 || **Entrapped/pinned - mechanically restrained 2 || **Could not exit vehicle due to jammed doors, fire, etc (specify) 3 || **Unknown 4 (tempo-define-template "sql-bgp_ejection-entrapment" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_EJECTION_ENTRAPMENT; --CREATE OR REPLACE VIEW BGP_EJECTION_ENTRAPMENT AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NE.MOBILITYRESTRICTION, SUBSTR(DECODE(NE.MOBILITYRESTRICTION,NULL,'NOT CODED','1','OCCUPANT FATAL BEFORE REMOVED FROM VEHICLE','2','REMOVED FROM VEHICLE WHILE UNCONSCIOUS OR NOT ORIENTED TO TIME','3','REMOVED FROM VEHICLE DUE TO PERCEIVED SERIOUS INJURIES','4','EXITED VEHICLE WITH SOME ASSISTANCE','5','EXITED VEHICLE UNDER OWN POWER','6','OCCUPANT FULLY EJECTED','7','REMOVED FROM VEHICLE FOR OTHER REASONS','8','UNKNOWN',NE.MOBILITYRESTRICTION),1,72) AS MOBILITY_RESTRICTION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.ENTRAPMENT NE, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.OCCUPANTID > 0 AND CCC.VEHICLEID > 0 AND CCC.CASEID=NE.CASEID(+) AND CCC.VEHICLEID=NE.VEHICLEID(+) AND CCC.OCCUPANTID=NE.OCCUPANTID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_ota-table-creation" ; template name '("--*DOCUMENTATION-BLAH DROP TABLE OTA_VIEW CASCADE CONSTRAINTS ; CREATE TABLE OTA_VIEW ( CIRENID NUMBER (9) NOT NULL, OTACODE CHAR (8) NOT NULL, ASPECT VARCHAR2 (35) NOT NULL, CIRENNUMBER VARCHAR2 (10) NOT NULL, CENTERNAME VARCHAR2 (35) NOT NULL) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;; 1000000000000000 - Frontal (1) ;; 0100000000000000 - Near Side (2) ;; 0010000000000000 - Rear (3) ;; 0001000000000000 - Rollover (4) ;; 0000100000000000 - Fire (5) ;; 0000010000000000 - CRS (6) ;; 0000000010000000 - Far Side (9) ;; 0000001000000000 - PI's interest (7) (tempo-define-template "sql-bgp_criteria" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CRITERIA; --CREATE OR REPLACE VIEW BGP_CRITERIA AS --SELECT CIRENID, CRITERIAID, DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),7,1), 1,'PRINCIPAL INVESTIGATOR INTEREST', 0,NULL) \"0200\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),6,1), 1,'CRS ', 0,NULL) \"0400\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),5,1), 1,'FIRE', 0,NULL) \"0800\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),4,1), 1,'ROLLOVER', 0,NULL) \"1000\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),3,1), 1,'REAR', 0,NULL) \"2000\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),2,1), 1,'NEAR', 0,NULL) \"4000\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),1,1), 1,'FRONTAL', 0,NULL) \"8000\" FROM CIREN.CIREN_CASE --; --SELECT CIRENID, GET_BITMAP(CRITERIAID,NULL) AS CRITERIA_BINARY FROM CIREN.CIREN_CASE ; --*TO GET FAR SIDE CRITERIA ONLY --SELECT CIRENID, SUBSTR(GET_BITMAP(CRITERIAID,NULL),1,16) AS FAR_SIDE_CRITERIA_BINARY FROM CIREN.CIREN_CASE WHERE SUBSTR(GET_BITMAP(CRITERIAID,NULL),9,1)='1' --; SELECT CIRENID, CRITERIAID, GET_BITMAP(CRITERIAID,NULL) AS CRITERIA_BINARY, DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),9,1), 1,'FAR SIDE', 0,NULL) \"FAR\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),7,1), 1,'PRINCIPAL INVESTIGATOR INTEREST', 0,NULL) \"PII\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),6,1), 1,'CRS ', 0,NULL) \"CRS\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),5,1), 1,'FIRE', 0,NULL) \"FIRE\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),4,1), 1,'ROLLOVER', 0,NULL) \"ROLLOVER\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),3,1), 1,'REAR', 0,NULL) \"REAR\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),2,1), 1,'NEAR', 0,NULL) \"NEAR\", DECODE(SUBSTR(GET_BITMAP(CRITERIAID,NULL),1,1), 1,'FRONTAL', 0,NULL) \"FRONTAL\" FROM CIREN.CIREN_CASE --; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_injury-nass" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.OCCUPANTINJURY ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*This gives 6241 lines. ;*Taking this out for now: ...AND NCP.CALCTYPE LIKE '=' (tempo-define-template "sql-bgp_crushprofile" ; template name '("--*NASS.CRUSHPROFILE --DROP VIEW BGP_CRUSHPROFILE; --CREATE OR REPLACE VIEW BGP_CRUSHPROFILE AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NCP.CASEID, NCP.VEHICLEID, DL.LOCATIONDIRECTDAMAGE, NCP.IMPACTID, DL.IMPACTNUMBER, NCP.PLANEOFIMPACT, NCP.MAXCRUSH, D.TOTALDELTAV, SUBSTR(DECODE(D.TOTALDELTAV,999,'UNKNOWN',D.TOTALDELTAV),1,15) AS TOTALDELTAV, NCP.CRUSHID, NCP.CRUSH1, NCP.CRUSH2, NCP.CRUSH3, NCP.CRUSH4, NCP.CRUSH5, NCP.CRUSH6, NCP.DELTAVRATING, NCP.CALCTYPE, NCP.INACTIVEIND, NCP.LASTUPDATEID, NCP.LASTUPDATEDATE, NCP.PLANECATEGORY, NCP.SPECIFYPLANECATEGORY, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.CRUSHPROFILE NCP, NASS.VEHICLEDEFORMATION D, NASS.DAMAGELOCATOR DL, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCP.CASEID(+) AND CCC.CASEID=D.CASEID(+) AND CCC.VEHICLEID=NCP.VEHICLEID(+) AND NOR.ORGID=CCC.CENTERID AND CCC.CASEID=DL.CASEID(+) AND NCP.CALCTYPE LIKE '=' ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*This gives 6241 lines. ;*Taking this out for now: ...AND NCP.CALCTYPE='=' ;*Cardinality: 1-to-many (tempo-define-template "sql-bgp_damagelocator" ; template name '("--*NASS.DAMAGELOCATOR --DROP VIEW BGP_DAMAGELOCATOR; --CREATE OR REPLACE VIEW BGP_DAMAGELOCATOR AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NDL.ACCIDENTSEQUENCENO AS EVENTSEQUENCEID, NDL.CDCID AS DEFORMID, NVD.RANKING, NCP.CALCTYPE, NVD.DIRECTIONOFFORCE AS PDOF, NVD.TOTALDELTAV AS DELTAV, NVD.DAMAGEDISTRIBUTION, NVD.DAMAGEEXTENT, SUBSTR(C1.DESCRIPTION,1,40) AS DEFORMATIONLOCATION, NVD.LONGLATLOCATION, NVD.VERTLATLOCATION, NVD.LONGDELTAV, NVD.LATDELTAV, NVD.IMPACTDELTAV, NVD.ENERGYDELTAV, NVD.BARRIERDELTAV, NVD.ESTIMATEDDELTAV, NVD.CLOCKFORCE, NVD.PICKOVERRIDE, NVD.SHIFTINCREMENT, NVD.OTHEROVERRIDE, NVD.PICKDELTAVBASIS, NVD.SPECIFYDELTAVBASIS, NCP.MAXCRUSH, NDL.LOCATIONMAXCRUSH, NDL.IMPACTNUMBER, NDL.IMPACTID, NDL.LOCATIONDIRECTDAMAGE, NDL.LOCATIONFIELDL, NDL.DELTALVRATING, NDL.SMASHL, NDL.FIELDL, NDL.D, NDL.WIDTHCDC, NDL.SMASHD, NDL.INACTIVEIND, NDL.PLANECATEGORY, NDL.SPECIFYPLANECATEGORY, NDL.IFENDSHIFT10CM, SUBSTR(C1.DESCRIPTION,1,40)||' '||SUBSTR(C2.DESCRIPTION,1,40) AS CDC, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.CDCLOOKUP C1, NASS.CDCLOOKUP C2, NASS.CRUSHPROFILE NCP, NASS.DAMAGELOCATOR NDL, NASS.VEHICLEDEFORMATION NVD, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CIRENID > 0 AND CCC.CASEID=NCP.CASEID(+) AND NCP.CASEID=NDL.CASEID(+) AND NDL.CASEID=NVD.CASEID(+) AND CCC.VEHICLEID=NCP.VEHICLEID(+) AND NCP.VEHICLEID=NDL.VEHICLEID(+) AND NDL.VEHICLEID=NVD.VEHICLEID(+) AND NDL.CDCID=NVD.DEFORMID(+) AND NCP.IMPACTID=NDL.IMPACTID(+) AND NVD.DEFORMATIONLOCATION=C1.CDCID(+) AND NVD.LONGLATLOCATION=C2.CDCID(+) AND NOR.ORGID=CCC.CENTERID(+) AND NCP.CALCTYPE LIKE '=' ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; --lithmus test: AND ((CCC.CIRENID='484026611') or (CCC.CIRENID='469027824')) (tempo-define-template "sql-bgp_maxcrush" ; template name '("--*Requires NASS.MV_MAXCRUSH --DROP VIEW BGP_MAXCRUSH; --CREATE OR REPLACE VIEW BGP_MAXCRUSH AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, MVM.CASEID, MVM.VEHICLEID, MVM.CDCID, MVM.IMPACTID, MVM.MAXCRUSH, MVM.MAXCRUSHLOCATION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.MV_MAXCRUSH MVM, NASS.ORGANIZATION NOR WHERE CCC.CIRENID > 0 AND CCC.CASEID > 0 AND CCC.CASEID=MVM.CASEID(+) AND CCC.VEHICLEID=MVM.VEHICLEID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_all-ciren-wh-tables-names" ; template name '("--*To get all of the table names in a database SELECT * FROM CIREN_WH.CASELIST; SELECT * FROM CIREN_WH.CDC; SELECT * FROM CIREN_WH.CONTACTS; SELECT * FROM CIREN_WH.CRASH; SELECT * FROM CIREN_WH.EVENTS; SELECT * FROM CIREN_WH.INJURIES; SELECT * FROM CIREN_WH.INTRUSIONS; SELECT * FROM CIREN_WH.OCCUPANT; SELECT * FROM CIREN_WH.VEHICLE; SELECT * FROM CIREN_WH.VERSION; SELECT * FROM CIREN_WH.MV_IMPACT; SELECT * FROM CIREN_WH.MV_AIRBAG; SELECT * FROM CIREN_WH.MV_NASSINJURY; SELECT * FROM CIREN_WH.MV_OCCUPANT; SELECT * FROM CIREN_WH.MV_VEHICLE; SELECT * FROM CIREN_WH.MV_AIRBAGID; SELECT * FROM CIREN_WH.MV_ANTHRO; SELECT * FROM CIREN_WH.MV_CLOTHING; SELECT * FROM CIREN_WH.MV_COMORBIDITY; SELECT * FROM CIREN_WH.MV_DEMOINFO; SELECT * FROM CIREN_WH.MV_GCS; SELECT * FROM CIREN_WH.MV_INJURYCONTACT; SELECT * FROM CIREN_WH.MV_INJURYINTRUSION; SELECT * FROM CIREN_WH.MV_CRASHDERIVED; SELECT * FROM CIREN_WH.MV_CIRENINJURY; SELECT * FROM CIREN_WH.MV_ANTHRO_VALUE; SELECT * FROM CIREN_WH.MV_CIRENINJURY_VALUE; SELECT * FROM CIREN_WH.MV_CLOTHING_VALUE; SELECT * FROM CIREN_WH.MV_COMORBIDITY_VALUE; SELECT * FROM CIREN_WH.MV_CRASHDERIVED_VALUE; SELECT * FROM CIREN_WH.MV_DEMOINFO_VALUE; SELECT * FROM CIREN_WH.MV_GCS_VALUE; SELECT * FROM CIREN_WH.MV_IMPACT_VALUE; SELECT * FROM CIREN_WH.MV_INJURYCONTACT_VALUE; SELECT * FROM CIREN_WH.MV_INJURYINTRUSION_VALUE; SELECT * FROM CIREN_WH.MV_OCCUPANT_VALUE; SELECT * FROM CIREN_WH.MV_VEHICLE_VALUE; SELECT * FROM CIREN_WH.MV_AIRBAG_VALUE; SELECT * FROM CIREN_WH.MV_EVENTNUMBER; SELECT * FROM CIREN_WH.MV_VITALSIGNS; SELECT * FROM CIREN_WH.MV_VITALSIGNS_VALUE; SELECT * FROM CIREN_WH.MV_EVENTS; SELECT * FROM CIREN_WH.MV_EVENTS_VALUE; SELECT * FROM CIREN_WH.MV_EMSRESPONSE; SELECT * FROM CIREN_WH.MV_EMSRESPONSE_VALUE; SELECT * FROM CIREN_WH.MV_CHARGES; SELECT * FROM CIREN_WH.MV_CHARGES_VALUE; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_all-table-and-view-names" ; template name '("--*To get all of the table names in a database SELECT DISTINCT TABLE_NAME, OWNER FROM ALL_TABLES; SELECT DISTINCT VIEW_NAME, OWNER FROM ALL_VIEWS; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "hello" ; template name '("System.out.println(\"hello\");") ; definition "h" ; abbreviation "Inserts a print hello command") ; documentation (tempo-define-template "sql-bgp_cause-of-death" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CAUSE_OF_DEATH; --CREATE OR REPLACE VIEW BGP_CAUSE_OF_DEATH AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, SUBSTR(CCOD.CDORDERID,1,35) AS CAUSE_OF_DEATH_RANK, SUBSTR(CCOD.INJURYID,1,35) AS CAUSE_OF_DEATH_ID, SUBSTR(CCI.AISCODE,1,35) AS COD_AIS, DECODE(SUBSTR(NAC.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(NAC.AISCODES,7,1) AS AIS, DECODE(SUBSTR(NAC.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, SUBSTR(NAC.DESCRIPTION,1,255) AS CAUSE_OF_DEATH_DESCRIPTION, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.CAUSEOFDEATH CCOD, CIREN.CIRENINJURY CCI, NASS.AISCODES NAC, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCOD.INJURYID > 0 AND CCC.CIRENID=CCI.CIRENID(+) AND CCI.INJURYID=CCOD.INJURYID AND CCI.AISCODE=NAC.NASSCODE(+) AND NOR.ORGID=CCC.CENTERID(+) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_vehicledeformation" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.VEHICLEDEFORMATION ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_ciren-wh.c-impact" ; template name '("--*DOCUMENTATION-BLAH select * from CIREN_WH.C_IMPACT ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*Cardinality: 1-to-many (tempo-define-template "sql-bgp_vehiclerollover" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_VEHICLEROLLOVER; --CREATE OR REPLACE VIEW BGP_VEHICLEROLLOVER SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NVR.OTHERLOCTRIPFORCE, NVR.OTHERROLLINITOBJTYPE, NVR.OTHERROLLOVERINITTYPE, SUBSTR(QL1.OPTIONTEXT,1,50) AS PICKDIRECTIONOFINITROLL, SUBSTR(QL2.OPTIONTEXT,1,50) AS PICKLOCATIONROLLOVERINIT, SUBSTR(QL3.OPTIONTEXT,1,50) AS PICKLOCATIONTRIPPINGFORCE, NVR.ROLLINITOBJCLASS, NVR.ROLLINITOBJTYPE, SUBSTR(QL4.OPTIONTEXT,1,50) AS PICKROLLOVERINITTYPE, SUBSTR(QL5.OPTIONTEXT,1,50) AS PICKROLLOVERTYPE, NVR.ROLLOVERTURNS, CCI.AISCODE, DECODE(SUBSTR(NAC.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(NAC.AISCODES,7,1) AS AIS, DECODE(SUBSTR(NAC.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, NAC.DESCRIPTION, CCC.CIRENNUMBER, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIRENINJURY CCI, CIREN.CIREN_CASE CCC, NASS.AISCODES NAC, NASS.VEHICLEROLLOVER NVR, NASS.QUESTIONLOOKUP QL1, NASS.QUESTIONLOOKUP QL2, NASS.QUESTIONLOOKUP QL3, NASS.QUESTIONLOOKUP QL4, NASS.QUESTIONLOOKUP QL5, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NVR.CASEID(+) AND CCC.CIRENID=CCI.CIRENID(+) AND CCC.VEHICLEID=NVR.VEHICLEID(+) AND CCI.AISCODE=NAC.NASSCODE(+) AND NVR.PICKDIRECTIONOFINITROLL=QL1.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=1492 AND NVR.PICKLOCATIONROLLOVERINIT=QL2.OPTIONVALUE(+) AND QL2.DATAITEMID(+)=1488 AND NVR.PICKLOCATIONTRIPPINGFORCE=QL3.OPTIONVALUE(+) AND QL3.DATAITEMID(+)=1490 AND NVR.PICKROLLOVERINITTYPE=QL4.OPTIONVALUE(+) AND QL4.DATAITEMID(+)=1486 AND NVR.PICKROLLOVERTYPE=QL5.OPTIONVALUE(+) AND QL5.DATAITEMID(+)=1484 AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_blob-dev" ; template name '("--*DOCUMENTATION-BLAH declare i1 blob; len number; my_vr raw(10); i2 number; i3 number := 10; begin SELECT THEIMAGE INTO i1 FROM ciren.images WHERE cirenid=377036830 AND IMAGEID=377040622 and VERSIONNUMBER=0; len := DBMS_LOB.GETLENGTH(i1); dbms_output.put_line('Length of the Column : ' || to_char(len)); i2 := 1; if len < 10 then DBMS_LOB.READ(i1,len,i2,my_vr); outputstring('d:\\test\\bgp-test.bmp',rawtohex(my_vr),'wb',2*len); dbms_output.put_line('Read ' || to_char(len) || 'Bytes'); else DBMS_LOB.READ(i1,i3,i2,my_vr); outputstring('d:\\test\\bgp-test.bmp',rawtohex(my_vr),'wb',2*i3); dbms_output.put_line('Read ' || to_char(i3) || ' Bytes '); end if; i2 := i2 + 10; while (i2 < len ) loop DBMS_LOB.READ(i1,i3,i2,my_vr); dbms_output.put_line('Read ' || to_char(i3+i2-1) || ' Bytes '); outputstring('d:\\test\\bgp-test.bmp',rawtohex(my_vr),'ab',2*i3); i2 := i2 + 10; end loop; end; run; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*To extract a BLOB--with ORACLE 8i (9i has this solved--they provide a function "BLAH_UTIL") (tempo-define-template "sql-bgp_blob" ; template name '("--*DOCUMENTATION-BLAH --select CIRENID, IMAGEID, VERSIONNUMBER from ciren.images WHERE cirenid=377036830 AND IMAGEID=377040622 and VERSIONNUMBER=0; declare i1 blob; len number; my_vr raw(10000); i2 number; i3 number := 10000; begin -- get the blob locator SELECT THEIMAGE INTO i1 FROM ciren.images WHERE cirenid=377036830 AND IMAGEID=377040622 and VERSIONNUMBER=0; -- find the length of the blob column len := DBMS_LOB.GETLENGTH(i1); dbms_output.put_line('Length of the Column : ' || to_char(len)); --Read 10000 bytes at a time i2 := 1; if len < 10000 then --If the col length is < 10000 DBMS_LOB.READ(i1,len,i2,my_vr); outputstring('d:\\test\\bgp-test.bmp',rawtohex(my_vr),'wb',2*len); --You have to convert the data to rawtohex format. Directly sending the buffer --data will not work --That is the reason why we are sending the length as the double the size of the data read dbms_output.put_line('Read ' || to_char(len) || 'Bytes'); else --If the col length is > 10000 DBMS_LOB.READ(i1,i3,i2,my_vr); outputstring('d:\\test\\bgp-test.bmp',rawtohex(my_vr),'wb',2*i3); dbms_output.put_line('Read ' || to_char(i3) || ' Bytes '); end if; i2 := i2 + 10000; while (i2 < len ) loop --loop till entire data is fetched DBMS_LOB.READ(i1,i3,i2,my_vr); dbms_output.put_line('Read ' || to_char(i3+i2-1) || ' Bytes '); outputstring('d:\\test\\bgp-test.bmp',rawtohex(my_vr),'ab',2*i3); i2 := i2 + 10000; end loop; end; run; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;**But the above dookie returns this error (unsurprisingly): ;; ... ;; 44* ;; SELECT c2 INTO i1 FROM lob_tab WHERE c1 = 2; ;; ERROR at line 10: ;; ORA-06550: line 10, column 24: ;; PLS-00201: identifier 'LOB_TAB' must be declared ;*To change a CLOB to VARCHAR2 (related to the dookie/template above): ;; "This piece of code works for me just fine ;; CREATE OR REPLACE fonction lob_to_varchar2(clob_colum clob) return varchar2 IS ;; buffer varchar2(4000); ;; amt BINARY_INTEGER := 4000; ;; pos INTEGER := 1; ;; l clob; ;; bfils bfile; ;; l_var varchar2(4000):=''; ;; begin ;; LOOP ;; if dbms_lob.getlength(clob_col)<=4000 THEN ;; dbms_lob.read (clob_col, amt, pos, buffer); ;; l_var := l_var||buffer; ;; pos:=pos+amt; ;; ELSE ;; --l_var:= 'Cannot convert to varchar2..Exceeding varchar2 field limit'; ;; l_var:= null; ;; exit; ;; END IF; ;; END LOOP; ;; return l_var; ;; EXCEPTION ;; WHEN NO_DATA_FOUND THEN ;; return l_var; ;; END; ;; / ;; Then just called in a query: ;; SELECT lob_to_varchar2(clob_column) FROM table_w/_clob; ;;**And for LOB data (not CLOB) ;;"The following article presents a simple method for exporting the contents of a BLOB datatype to the filesystem. ;; First we create a Java stored procedure that accepts a file name and a BLOB as parameters: ;; CREATE OR REPLACE JAVA SOURCE NAMED "BlobHandler" AS ;; import java.lang.*; ;; import java.sql.*; ;; import oracle.sql.*; ;; import java.io.*; ;; public class BlobHandler ;; { ;; public static void ExportBlob(String myFile, BLOB myBlob) throws Exception ;; { ;; // Bind the image object to the database object ;; // Open streams for the output file and the blob ;; File binaryFile = new File(myFile); ;; FileOutputStream outStream = new FileOutputStream(binaryFile); ;; InputStream inStream = myBlob.getBinaryStream(); ;; // Get the optimum buffer size and use this to create the read/write buffer ;; int size = myBlob.getBufferSize(); ;; byte[] buffer = new byte[size]; ;; int length = -1; ;; // Transfer the data ;; while ((length = inStream.read(buffer)) != -1) ;; { ;; outStream.write(buffer, 0, length); ;; outStream.flush(); ;; } ;; // Close everything down ;; inStream.close(); ;; outStream.close(); ;; } ;; }; ;; / ;; ALTER java source "BlobHandler" compile; ;; show errors java source "BlobHandler" ;; Next we publish the Java call specification so we can access it via PL/SQL: ;; CREATE OR REPLACE PROCEDURE ExportBlob (p_file IN VARCHAR2, ;; p_blob IN BLOB) ;; AS LANGUAGE JAVA ;; NAME 'BlobHandler.ExportBlob(java.lang.String, oracle.sql.BLOB)'; ;; / ;; Next we grant the Oracle JVM the relevant filesystem permissions: ;; EXEC Dbms_Java.Grant_Permission( - ;; 'SCHEMA-NAME', - ;; 'java.io.FilePermission', - ;; '<>', - ;; 'read ,write, execute, delete'); ;; Finally we can test it: ;; CREATE TABLE tab1 (col1 BLOB); ;; INSERT INTO tab1 VALUES(empty_blob()); ;; COMMIT; ;; DECLARE ;; v_blob BLOB; ;; BEGIN ;; SELECT col1 ;; INTO v_blob ;; FROM tab1; ;; ExportBlob('c:\MyBlob',v_blob); ;; END; ;; run; ;; / ;; Hope this helps. Regards Tim... ;*But to get data out of a CLOB object this will always work--but only people like myself know how to handle/use the output--also if there are special chars in the database/garbage-in-garbage-out (tempo-define-template "sql-bgp_annotations" ; template name '("--*DOCUMENTATION-BLAH SET LONG 80; SET LOBOFFSET 1; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 80; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 1920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 2960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 3920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 4960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 5920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 6960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 7920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 8960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 9920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 10960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 11920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 12960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 13920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14000; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14080; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14160; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14240; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14320; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14400; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14480; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14560; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14640; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14720; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14800; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14880; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 14960; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15040; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15120; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15200; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15280; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15360; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15440; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15520; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15600; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15680; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15760; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15840; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 15920; SELECT CIRENID, ANNOTATIONID, ANNOTATIONTEXT FROM CIREN.ANNOTATION; SET LOBOFFSET 16000; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ; (tempo-define-template ; "sql-bgp_injury-analysis-text" ; template name ; '("--*DOCUMENTATION-BLAH ; SET LONG 80; ; SET LOBOFFSET 1; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 80; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 1920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 2960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 3920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 4960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 5920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 6960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 7920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 8960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 9920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 10960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 11920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 12960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 13920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14000; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14080; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14160; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14240; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14320; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14400; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14480; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14560; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14640; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14720; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14800; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14880; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 14960; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15040; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15120; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15200; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15280; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15360; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15440; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15520; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15600; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15680; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15760; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15840; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 15920; ; SELECT CIRENID, IMAGEID, ANNOTATIONTEXT FROM CIREN.IMAGES; ; SET LOBOFFSET 16000; ; ") ; definition ; "s-jjj" ; abbreviation ; "Inserts an SQL program command") ; documentation ;; (tempo-define-template ;; "sql-bgp_annotation-text" ; template name ;; '("--*DOCUMENTATION-BLAH ;; SELECT * FROM CIREN.ANNOTATION ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_injuries-aiscodes-and-body-regions" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_INJURIES_AISCODES_AND_BODY_REGIONS; --CREATE OR REPLACE VIEW BGP_INJURIES_AISCODES_AND_BODY_REGIONS AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCI.AISCODE, DECODE(SUBSTR(NAC.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(NAC.AISCODES,7,1) AS AIS, DECODE(SUBSTR(NAC.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, NAC.DESCRIPTION, CCC.CIRENNUMBER, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIRENINJURY CCI, CIREN.CIREN_CASE CCC, NASS.AISCODES NAC, NASS.ORGANIZATION NOR WHERE CCC.CIRENID=CCI.CIRENID(+) AND CCI.AISCODE=NAC.NASSCODE(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_compelling-injuries" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_COMPELLING_INJURIES; --CREATE OR REPLACE VIEW BGP_COMPELLING_INJURIES AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCI.AISCODE, DECODE(SUBSTR(NAC.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(NAC.AISCODES,7,1) AS AIS, DECODE(SUBSTR(NAC.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, NAC.DESCRIPTION, CCC.CIRENNUMBER, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.CIRENINJURY CCI, NASS.AISCODES NAC, NASS.ORGANIZATION NOR WHERE CCC.CIRENID=CCI.CIRENID(+) AND NOR.ORGID=CCC.CENTERID AND CCI.AISCODE=NAC.NASSCODE AND ((CCI.AISCODE = '1130006') OR (CCI.AISCODE = '1202025') OR (CCI.AISCODE = '1202043') OR (CCI.AISCODE = '1202063') OR (CCI.AISCODE = '1202993') OR (CCI.AISCODE = '1204025') OR (CCI.AISCODE = '1204045') OR (CCI.AISCODE = '1204995') OR (CCI.AISCODE = '1206024') OR (CCI.AISCODE = '1208024') OR (CCI.AISCODE = '1208045') OR (CCI.AISCODE = '1208063') OR (CCI.AISCODE = '1208993') OR (CCI.AISCODE = '1210025') OR (CCI.AISCODE = '1210044') OR (CCI.AISCODE = '1210063') OR (CCI.AISCODE = '1210993') OR (CCI.AISCODE = '1212024') OR (CCI.AISCODE = '1212043') OR (CCI.AISCODE = '1212063') OR (CCI.AISCODE = '1212993') OR (CCI.AISCODE = '1214025') OR (CCI.AISCODE = '1214044') OR (CCI.AISCODE = '1214063') OR (CCI.AISCODE = '1214993') OR (CCI.AISCODE = '1216024') OR (CCI.AISCODE = '1216043') OR (CCI.AISCODE = '1216063') OR (CCI.AISCODE = '1216993') OR (CCI.AISCODE = '1218025') OR (CCI.AISCODE = '1218043') OR (CCI.AISCODE = '1218063') OR (CCI.AISCODE = '1218993') OR (CCI.AISCODE = '1220024') OR (CCI.AISCODE = '1220045') OR (CCI.AISCODE = '1220064') OR (CCI.AISCODE = '1220994') OR (CCI.AISCODE = '1222024') OR (CCI.AISCODE = '1222043') OR (CCI.AISCODE = '1222993') OR (CCI.AISCODE = '1224024') OR (CCI.AISCODE = '1224045') OR (CCI.AISCODE = '1224064') OR (CCI.AISCODE = '1224994') OR (CCI.AISCODE = '1226024') OR (CCI.AISCODE = '1226045') OR (CCI.AISCODE = '1226064') OR (CCI.AISCODE = '1226994') OR (CCI.AISCODE = '1228025') OR (CCI.AISCODE = '1228043') OR (CCI.AISCODE = '1228063') OR (CCI.AISCODE = '1228993') OR (CCI.AISCODE = '1402025') OR (CCI.AISCODE = '1402045') OR (CCI.AISCODE = '1402065') OR (CCI.AISCODE = '1402085') OR (CCI.AISCODE = '1402105') OR (CCI.AISCODE = '1402126') OR (CCI.AISCODE = '1402146') OR (CCI.AISCODE = '1402166') OR (CCI.AISCODE = '1402995') OR (CCI.AISCODE = '1404023') OR (CCI.AISCODE = '1404033') OR (CCI.AISCODE = '1404044') OR (CCI.AISCODE = '1404055') OR (CCI.AISCODE = '1404065') OR (CCI.AISCODE = '1404104') OR (CCI.AISCODE = '1404144') OR (CCI.AISCODE = '1404184') OR (CCI.AISCODE = '1404225') OR (CCI.AISCODE = '1404264') OR (CCI.AISCODE = '1404304') OR (CCI.AISCODE = '1404345') OR (CCI.AISCODE = '1404384') OR (CCI.AISCODE = '1404424') OR (CCI.AISCODE = '1404465') OR (CCI.AISCODE = '1404503') OR (CCI.AISCODE = '1404543') OR (CCI.AISCODE = '1404583') OR (CCI.AISCODE = '1404623') OR (CCI.AISCODE = '1404663') OR (CCI.AISCODE = '1404703') OR (CCI.AISCODE = '1404744') OR (CCI.AISCODE = '1404785') OR (CCI.AISCODE = '1404993') OR (CCI.AISCODE = '1406023') OR (CCI.AISCODE = '1406043') OR (CCI.AISCODE = '1406063') OR (CCI.AISCODE = '1406084') OR (CCI.AISCODE = '1406105') OR (CCI.AISCODE = '1406123') OR (CCI.AISCODE = '1406143') OR (CCI.AISCODE = '1406164') OR (CCI.AISCODE = '1406185') OR (CCI.AISCODE = '1406203') OR (CCI.AISCODE = '1406223') OR (CCI.AISCODE = '1406244') OR (CCI.AISCODE = '1406265') OR (CCI.AISCODE = '1406285') OR (CCI.AISCODE = '1406294') OR (CCI.AISCODE = '1406304') OR (CCI.AISCODE = '1406324') OR (CCI.AISCODE = '1406345') OR (CCI.AISCODE = '1406365') OR (CCI.AISCODE = '1406384') OR (CCI.AISCODE = '1406404') OR (CCI.AISCODE = '1406424') OR (CCI.AISCODE = '1406444') OR (CCI.AISCODE = '1406465') OR (CCI.AISCODE = '1406485') OR (CCI.AISCODE = '1406504') OR (CCI.AISCODE = '1406524') OR (CCI.AISCODE = '1406545') OR (CCI.AISCODE = '1406565') OR (CCI.AISCODE = '1406603') OR (CCI.AISCODE = '1406623') OR (CCI.AISCODE = '1406644') OR (CCI.AISCODE = '1406665') OR (CCI.AISCODE = '1406683') OR (CCI.AISCODE = '1406703') OR (CCI.AISCODE = '1406724') OR (CCI.AISCODE = '1406745') OR (CCI.AISCODE = '1406763') OR (CCI.AISCODE = '1406784') OR (CCI.AISCODE = '1406803') OR (CCI.AISCODE = '1406823') OR (CCI.AISCODE = '1406843') OR (CCI.AISCODE = '1406863') OR (CCI.AISCODE = '1406884') OR (CCI.AISCODE = '1406905') OR (CCI.AISCODE = '1406993') OR (CCI.AISCODE = '1407993') OR (CCI.AISCODE = '1502064') OR (CCI.AISCODE = '1504043') OR (CCI.AISCODE = '1504064') OR (CCI.AISCODE = '1504084') OR (CCI.AISCODE = '1602043') OR (CCI.AISCODE = '1602063') OR (CCI.AISCODE = '1602084') OR (CCI.AISCODE = '1602104') OR (CCI.AISCODE = '1602125') OR (CCI.AISCODE = '1602145') OR (CCI.AISCODE = '1604042') OR (CCI.AISCODE = '1604083') OR (CCI.AISCODE = '1604123') OR (CCI.AISCODE = '1604163') OR (CCI.AISCODE = '1606022') OR (CCI.AISCODE = '1606043') OR (CCI.AISCODE = '1606062') OR (CCI.AISCODE = '1606083') OR (CCI.AISCODE = '1606102') OR (CCI.AISCODE = '1606123') OR (CCI.AISCODE = '1606143') OR (CCI.AISCODE = '1606164') OR (CCI.AISCODE = '1606992') OR (CCI.AISCODE = '1608023') OR (CCI.AISCODE = '1608044') OR (CCI.AISCODE = '1608063') OR (CCI.AISCODE = '1608084') OR (CCI.AISCODE = '1608103') OR (CCI.AISCODE = '1608124') OR (CCI.AISCODE = '1608144') OR (CCI.AISCODE = '1608165') OR (CCI.AISCODE = '1608185') OR (CCI.AISCODE = '1608204') OR (CCI.AISCODE = '1608225') OR (CCI.AISCODE = '1608245') OR (CCI.AISCODE = '1608993') OR (CCI.AISCODE = '1906063') OR (CCI.AISCODE = '1908063') OR (CCI.AISCODE = '3202124') OR (CCI.AISCODE = '3208063') OR (CCI.AISCODE = '3210123') OR (CCI.AISCODE = '3210992') OR (CCI.AISCODE = '3402042') OR (CCI.AISCODE = '3402083') OR (CCI.AISCODE = '3402104') OR (CCI.AISCODE = '3402125') OR (CCI.AISCODE = '3402992') OR (CCI.AISCODE = '3406105') OR (CCI.AISCODE = '4202024') OR (CCI.AISCODE = '4202045') OR (CCI.AISCODE = '4202064') OR (CCI.AISCODE = '4202084') OR (CCI.AISCODE = '4202105') OR (CCI.AISCODE = '4202125') OR (CCI.AISCODE = '4202145') OR (CCI.AISCODE = '4202165') OR (CCI.AISCODE = '4202186') OR (CCI.AISCODE = '4202994') OR (CCI.AISCODE = '4204023') OR (CCI.AISCODE = '4204043') OR (CCI.AISCODE = '4204063') OR (CCI.AISCODE = '4204084') OR (CCI.AISCODE = '4204993') OR (CCI.AISCODE = '4206023') OR (CCI.AISCODE = '4206043') OR (CCI.AISCODE = '4206064') OR (CCI.AISCODE = '4206085') OR (CCI.AISCODE = '4206993') OR (CCI.AISCODE = '4208005') OR (CCI.AISCODE = '4210023') OR (CCI.AISCODE = '4210043') OR (CCI.AISCODE = '4210063') OR (CCI.AISCODE = '4210084') OR (CCI.AISCODE = '4210993') OR (CCI.AISCODE = '4212023') OR (CCI.AISCODE = '4212043') OR (CCI.AISCODE = '4212064') OR (CCI.AISCODE = '4212993') OR (CCI.AISCODE = '4214023') OR (CCI.AISCODE = '4214043') OR (CCI.AISCODE = '4214063') OR (CCI.AISCODE = '4214084') OR (CCI.AISCODE = '4214993') OR (CCI.AISCODE = '4216023') OR (CCI.AISCODE = '4216043') OR (CCI.AISCODE = '4216064') OR (CCI.AISCODE = '4216993') OR (CCI.AISCODE = '4218023') OR (CCI.AISCODE = '4218043') OR (CCI.AISCODE = '4218064') OR (CCI.AISCODE = '4218085') OR (CCI.AISCODE = '4218993') OR (CCI.AISCODE = '4220083') OR (CCI.AISCODE = '4222063') OR (CCI.AISCODE = '4402021') OR (CCI.AISCODE = '4402042') OR (CCI.AISCODE = '4402062') OR (CCI.AISCODE = '4402083') OR (CCI.AISCODE = '4402104') OR (CCI.AISCODE = '4402123') OR (CCI.AISCODE = '4402143') OR (CCI.AISCODE = '4402164') OR (CCI.AISCODE = '4402991') OR (CCI.AISCODE = '4404005') OR (CCI.AISCODE = '4408043') OR (CCI.AISCODE = '4410064') OR (CCI.AISCODE = '4410083') OR (CCI.AISCODE = '4410103') OR (CCI.AISCODE = '4410125') OR (CCI.AISCODE = '4410146') OR (CCI.AISCODE = '4410166') OR (CCI.AISCODE = '4412005') OR (CCI.AISCODE = '4413005') OR (CCI.AISCODE = '4414104') OR (CCI.AISCODE = '4414143') OR (CCI.AISCODE = '4414163') OR (CCI.AISCODE = '4414184') OR (CCI.AISCODE = '4414204') OR (CCI.AISCODE = '4414225') OR (CCI.AISCODE = '4414245') OR (CCI.AISCODE = '4414265') OR (CCI.AISCODE = '4414323') OR (CCI.AISCODE = '4414344') OR (CCI.AISCODE = '4414364') OR (CCI.AISCODE = '4414385') OR (CCI.AISCODE = '4414405') OR (CCI.AISCODE = '4414425') OR (CCI.AISCODE = '4414504') OR (CCI.AISCODE = '4414524') OR (CCI.AISCODE = '4414544') OR (CCI.AISCODE = '4414565') OR (CCI.AISCODE = '4414585') OR (CCI.AISCODE = '4414605') OR (CCI.AISCODE = '4414625') OR (CCI.AISCODE = '4416022') OR (CCI.AISCODE = '4416043') OR (CCI.AISCODE = '4416992') OR (CCI.AISCODE = '4422023') OR (CCI.AISCODE = '4422043') OR (CCI.AISCODE = '4422064') OR (CCI.AISCODE = '4422084') OR (CCI.AISCODE = '4422105') OR (CCI.AISCODE = '4422125') OR (CCI.AISCODE = '4426043') OR (CCI.AISCODE = '4426063') OR (CCI.AISCODE = '4426084') OR (CCI.AISCODE = '4426105') OR (CCI.AISCODE = '4426124') OR (CCI.AISCODE = '4426144') OR (CCI.AISCODE = '4426165') OR (CCI.AISCODE = '4502303') OR (CCI.AISCODE = '4502324') OR (CCI.AISCODE = '4502404') OR (CCI.AISCODE = '4502425') OR (CCI.AISCODE = '4502503') OR (CCI.AISCODE = '4502524') OR (CCI.AISCODE = '4502604') OR (CCI.AISCODE = '4502623') OR (CCI.AISCODE = '4502644') OR (CCI.AISCODE = '4502665') OR (CCI.AISCODE = '5202994') OR (CCI.AISCODE = '5202024') OR (CCI.AISCODE = '5202044') OR (CCI.AISCODE = '5202064') OR (CCI.AISCODE = '5202085') OR (CCI.AISCODE = '5204993') OR (CCI.AISCODE = '5204023') OR (CCI.AISCODE = '5204043') OR (CCI.AISCODE = '5204064') OR (CCI.AISCODE = '5204085') OR (CCI.AISCODE = '5206993') OR (CCI.AISCODE = '5206023') OR (CCI.AISCODE = '5206043') OR (CCI.AISCODE = '5206063') OR (CCI.AISCODE = '5206084') OR (CCI.AISCODE = '5208993') OR (CCI.AISCODE = '5208023') OR (CCI.AISCODE = '5208043') OR (CCI.AISCODE = '5208064') OR (CCI.AISCODE = '5210992') OR (CCI.AISCODE = '5210022') OR (CCI.AISCODE = '5210042') OR (CCI.AISCODE = '5210063') OR (CCI.AISCODE = '5212993') OR (CCI.AISCODE = '5212023') OR (CCI.AISCODE = '5212043') OR (CCI.AISCODE = '5212064') OR (CCI.AISCODE = '5214993') OR (CCI.AISCODE = '5214023') OR (CCI.AISCODE = '5214043') OR (CCI.AISCODE = '5214063') OR (CCI.AISCODE = '5214084') OR (CCI.AISCODE = '5216993') OR (CCI.AISCODE = '5216023') OR (CCI.AISCODE = '5216043') OR (CCI.AISCODE = '5216064') OR (CCI.AISCODE = '5402263') OR (CCI.AISCODE = '5404264') OR (CCI.AISCODE = '5408264') OR (CCI.AISCODE = '5410265') OR (CCI.AISCODE = '5410285') OR (CCI.AISCODE = '5412243') OR (CCI.AISCODE = '5412264') OR (CCI.AISCODE = '5414264') OR (CCI.AISCODE = '5416143') OR (CCI.AISCODE = '5416264') OR (CCI.AISCODE = '5416285') OR (CCI.AISCODE = '5416404') OR (CCI.AISCODE = '5418143') OR (CCI.AISCODE = '5418264') OR (CCI.AISCODE = '5418285') OR (CCI.AISCODE = '5418306') OR (CCI.AISCODE = '5420264') OR (CCI.AISCODE = '5428143') OR (CCI.AISCODE = '5428264') OR (CCI.AISCODE = '5428284') OR (CCI.AISCODE = '5428304') OR (CCI.AISCODE = '5428325') OR (CCI.AISCODE = '5430242') OR (CCI.AISCODE = '5430263') OR (CCI.AISCODE = '5432242') OR (CCI.AISCODE = '5432263') OR (CCI.AISCODE = '5436243') OR (CCI.AISCODE = '5436265') OR (CCI.AISCODE = '5440242') OR (CCI.AISCODE = '5442143') OR (CCI.AISCODE = '5442264') OR (CCI.AISCODE = '5442285') OR (CCI.AISCODE = '5444264') OR (CCI.AISCODE = '5448263') OR (CCI.AISCODE = '5450263') OR (CCI.AISCODE = '5452263') OR (CCI.AISCODE = '5452303') OR (CCI.AISCODE = '5452343') OR (CCI.AISCODE = '5452364') OR (CCI.AISCODE = '5452403') OR (CCI.AISCODE = '5452424') OR (CCI.AISCODE = '5452465') OR (CCI.AISCODE = '5454263') OR (CCI.AISCODE = '5456263') OR (CCI.AISCODE = '6302243') OR (CCI.AISCODE = '6302263') OR (CCI.AISCODE = '6402003') OR (CCI.AISCODE = '6402013') OR (CCI.AISCODE = '6402023') OR (CCI.AISCODE = '6402043') OR (CCI.AISCODE = '6402063') OR (CCI.AISCODE = '6402083') OR (CCI.AISCODE = '6402104') OR (CCI.AISCODE = '6402124') OR (CCI.AISCODE = '6402144') OR (CCI.AISCODE = '6402164') OR (CCI.AISCODE = '6402184') OR (CCI.AISCODE = '6402205') OR (CCI.AISCODE = '6402215') OR (CCI.AISCODE = '6402225') OR (CCI.AISCODE = '6402245') OR (CCI.AISCODE = '6402265') OR (CCI.AISCODE = '6402285') OR (CCI.AISCODE = '6402296') OR (CCI.AISCODE = '6402306') OR (CCI.AISCODE = '6402326') OR (CCI.AISCODE = '6402346') OR (CCI.AISCODE = '6402366') OR (CCI.AISCODE = '6402405') OR (CCI.AISCODE = '6402425') OR (CCI.AISCODE = '6402445') OR (CCI.AISCODE = '6402465') OR (CCI.AISCODE = '6402485') OR (CCI.AISCODE = '6402505') OR (CCI.AISCODE = '6402605') OR (CCI.AISCODE = '6402615') OR (CCI.AISCODE = '6402625') OR (CCI.AISCODE = '6402645') OR (CCI.AISCODE = '6402665') OR (CCI.AISCODE = '6402685') OR (CCI.AISCODE = '6402696') OR (CCI.AISCODE = '6402706') OR (CCI.AISCODE = '6402726') OR (CCI.AISCODE = '6402746') OR (CCI.AISCODE = '6402766') OR (CCI.AISCODE = '6404104') OR (CCI.AISCODE = '6404124') OR (CCI.AISCODE = '6404144') OR (CCI.AISCODE = '6404164') OR (CCI.AISCODE = '6404184') OR (CCI.AISCODE = '6404205') OR (CCI.AISCODE = '6404225') OR (CCI.AISCODE = '6404245') OR (CCI.AISCODE = '6404265') OR (CCI.AISCODE = '6404285') OR (CCI.AISCODE = '6404405') OR (CCI.AISCODE = '6404425') OR (CCI.AISCODE = '6404445') OR (CCI.AISCODE = '6404465') OR (CCI.AISCODE = '6404485') OR (CCI.AISCODE = '6404505') OR (CCI.AISCODE = '6404605') OR (CCI.AISCODE = '6404625') OR (CCI.AISCODE = '6404645') OR (CCI.AISCODE = '6404665') OR (CCI.AISCODE = '6404685') OR (CCI.AISCODE = '6406124') OR (CCI.AISCODE = '6406144') OR (CCI.AISCODE = '6406164') OR (CCI.AISCODE = '6406184') OR (CCI.AISCODE = '6406205') OR (CCI.AISCODE = '6406225') OR (CCI.AISCODE = '6406245') OR (CCI.AISCODE = '6406265') OR (CCI.AISCODE = '6406285') OR (CCI.AISCODE = '6406405') OR (CCI.AISCODE = '6406425') OR (CCI.AISCODE = '6406445') OR (CCI.AISCODE = '6406465') OR (CCI.AISCODE = '6406485') OR (CCI.AISCODE = '6406505') OR (CCI.AISCODE = '6406605') OR (CCI.AISCODE = '6406625') OR (CCI.AISCODE = '6406645') OR (CCI.AISCODE = '6406665') OR (CCI.AISCODE = '6406685') OR (CCI.AISCODE = '6502033') OR (CCI.AISCODE = '6502042') OR (CCI.AISCODE = '6502063') OR (CCI.AISCODE = '6502082') OR (CCI.AISCODE = '6502092') OR (CCI.AISCODE = '6502103') OR (CCI.AISCODE = '6502123') OR (CCI.AISCODE = '6502283') OR (CCI.AISCODE = '6504162') OR (CCI.AISCODE = '7130003') OR (CCI.AISCODE = '7150002') OR (CCI.AISCODE = '7202022') OR (CCI.AISCODE = '7202042') OR (CCI.AISCODE = '7202062') OR (CCI.AISCODE = '7202083') OR (CCI.AISCODE = '7202992') OR (CCI.AISCODE = '7206042') OR (CCI.AISCODE = '7206062') OR (CCI.AISCODE = '7206083') OR (CCI.AISCODE = '7506503') OR (CCI.AISCODE = '7510503') OR (CCI.AISCODE = '8110003') OR (CCI.AISCODE = '8110044') OR (CCI.AISCODE = '8130002') OR (CCI.AISCODE = '8130022') OR (CCI.AISCODE = '8130043') OR (CCI.AISCODE = '8150002') OR (CCI.AISCODE = '8202084') OR (CCI.AISCODE = '8204063') OR (CCI.AISCODE = '8206083') OR (CCI.AISCODE = '8208063') OR (CCI.AISCODE = '8506102') OR (CCI.AISCODE = '8506142') OR (CCI.AISCODE = '8506182') OR (CCI.AISCODE = '8508062') OR (CCI.AISCODE = '8508102') OR (CCI.AISCODE = '8508142') OR (CCI.AISCODE = '8518022') OR (CCI.AISCODE = '8526043') OR (CCI.AISCODE = '8526064') OR (CCI.AISCODE = '8526084') OR (CCI.AISCODE = '8526105') OR (CCI.AISCODE = '8528003') OR (CCI.AISCODE = '8940063')) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ; ; (tempo-define-template ; "sql-bgp_procedures" ; template name ; '("--*DOCUMENTATION-BLAH ; --DROP VIEW BGP_PROCEDURES; ; --CREATE OR REPLACE VIEW BGP_PROCEDURES AS ; SELECT ; DISTINCT ; /*+ ORDERED */ ; CCC.CIRENID, ; CDP.CPTID, ; CDP.PROCID, ; CDP.PROCDATE, ; CDP.PROCTIME, ; CDP.LOCATIONID, ; SUBSTR(ORGTITLE,1,35) AS ORGANIZATION ; FROM ; CIREN.CIREN_CASE CCC, ; CIREN.DXPROCEDURES CDP, ; NASS.ORGANIZATION NOR ; WHERE CCC.CIRENID=CDP.CIRENID(+) ; AND CDP.CPTID > 0 ; AND NOR.ORGID=CCC.CENTERID ; ; ; ; ") ; definition ; "s-jjj" ; abbreviation ; "Inserts an SQL program command") ; documentation ;*The above works well--at extracting procedures from the CIREN.DXPROCEDURES table. ;**Below though is the "main line" for now--it uses the CIREN.OPPROCEDURES table. ;*Cardinality: 1-to-many (tempo-define-template "sql-bgp_procedures" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_PROCEDURES; --CREATE OR REPLACE VIEW BGP_PROCEDURES AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CDP.CPTID, CDP.OPERATIONID, CDP.OPPROCID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.OPPROCEDURES CDP, NASS.ORGANIZATION NOR WHERE CCC.CIRENID=CDP.CIRENID(+) AND CDP.CPTID > 0 AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_deltav_worst" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_DELTAV; --CREATE OR REPLACE VIEW BGP_DELTAV_WORST AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CASEID, SUBSTR(DECODE(D.TOTALDELTAV,999,'UNKNOWN',D.TOTALDELTAV),1,15) AS TOTALDELTAV, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.VEHICLEDEFORMATION D, NASS.ORGANIZATION NOR WHERE CCC.CASEID=D.CASEID(+) AND CCC.VEHICLEID=D.VEHICLEID(+) AND D.RANKING=1 AND NOR.ORGID=CCC.CENTERID(+) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*METADATALOOKUP (tempo-define-template "sql-bgp_metadatalookup" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.METADATALOOKUP ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*desc ciren.outcome; ;; Name Null? Type ;; ------------------------------------------------------------------------ -------- ------------------------------------------------- ;; CIRENID NOT NULL NUMBER(9) ;; OUTCOMEID NOT NULL NUMBER(9) ;; OUTCOMEDATE NOT NULL DATE ;; MEASUREITEMID NUMBER(9) ;; MEASUREVALUE NUMBER(9) ;; MEASUREAGE NUMBER(9) ;; MEASUREFLAG NUMBER(9) ;; LASTUPDATEDATE DATE ;; TIMELAPSE NUMBER(9) (tempo-define-template "sql-bgp_outcome" ; template name '("--*CIREN.OUTCOME: CIRENID| OUTCOMEID|OUTCOMEDA|MEASUREITEMID|MEASUREVALUE|MEASUREAGE|MEASUREFLAG|LASTUPDAT| TIMELAPSE --DROP VIEW BGP_OUTCOME; --CREATE OR REPLACE VIEW BGP_OUTCOME AS SELECT DISTINCT /*+ ORDERED */ CO.CIRENID, CO.OUTCOMEID, CO.OUTCOMEDATE, CO.MEASUREITEMID, CO.MEASUREVALUE, CO.MEASUREAGE, CO.MEASUREFLAG, CO.TIMELAPSE, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.OUTCOME CO, NASS.ORGANIZATION NOR WHERE CO.CIRENID=CCC.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*BELT-TYPE (tempo-define-template "sql-bgp_belt-type" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_BELT_TYPE --CREATE OR REPLACE VIEW BGP_BELT_TYPE AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, SUBSTR(QL1.OPTIONTEXT,1,35) AS BELT_TYPE, SUBSTR(QL2.OPTIONTEXT,1,35) AS BELT_USE, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, NASS.MANUALBELTUSE MB, NASS.ORGANIZATION NOR, NASS.QUESTIONLOOKUP QL1, NASS.QUESTIONLOOKUP QL2 WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=MB.CASEID(+) AND C.VEHICLEID=MB.VEHICLEID(+) AND C.OCCUPANTID=MB.OCCUPANTID(+) AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND NOR.ORGID=C.CENTERID(+) AND MB.MANUALBELTTYPEUSED=QL1.OPTIONVALUE(+) AND MB.MANUALCRASHUSE=QL2.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=1188 AND QL2.DATAITEMID(+)=1190 ; ") ; definition "s-belt" ; abbreviation "Inserts an SQL program command") ; documentation ;*Why can't these lines be used: ;SUBSTR(QL3.OPTIONTEXT,1,35) AS AIRBAG, ;... (tempo-define-template "sql-bgp_feol-and-vol" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_FEOL_AND_VOL --CREATE OR REPLACE VIEW BGP_FEOL_AND_VOL AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, C.OCCUPANTID, C.AGE, SUBSTR(QL1.OPTIONTEXT,1,25) AS BELT_TYPE, SUBSTR(QL2.OPTIONTEXT,1,25) AS BELT_USE, VOL, FEOL, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, CIREN.V_OVERLAP VO, NASS.MANUALBELTUSE MB, NASS.ORGANIZATION NOR, NASS.QUESTIONLOOKUP QL1, NASS.QUESTIONLOOKUP QL2 WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CIRENID=VO.CIRENID(+) AND C.CASEID=MB.CASEID(+) AND C.VEHICLEID=MB.VEHICLEID(+) AND C.OCCUPANTID=MB.OCCUPANTID(+) AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND NOR.ORGID=C.CENTERID(+) AND MB.MANUALBELTTYPEUSED=QL1.OPTIONVALUE(+) AND MB.MANUALCRASHUSE=QL2.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=1188 AND QL2.DATAITEMID(+)=1190 ; ") ; definition "s-belt" ; abbreviation "Inserts an SQL program command") ; documentation ;;*desc nass.EJECTIONCOMMENTS; ;; Name Null? Type ;; ------------------------------------------------------------------------ -------- ------------------------------------------------- ;; CASEID NOT NULL NUMBER(9) ;; VEHICLEID NOT NULL NUMBER(9) ;; EJECTIONID NOT NULL NUMBER(9) ;;** select * from nass.EJECTIONCOMMENTS; ;; CASEID| VEHICLEID|EJECTIONID|EJECTCOMMENT ;; ----------|----------|----------|--------------------------------------------------------------------------------------------------- ;; 484000721| 484031940| 484031967|Definite possibility of partial head/face ejection based on injuries, location of direct damage and ;; 438000362| 438027214| 456038448|this ejection is for occupant 2. I was unable to delete it ;;*desc nass.ejection; ;; Name Null? Type ;; ------------------------------------------------------------------------ -------- ------------------------------------------------- ;; CASEID NOT NULL NUMBER(9) ;; VEHICLEID NOT NULL NUMBER(9) ;; EJECTIONID NOT NULL NUMBER(9) ;;*select * from nass.EJECTION_X_OCCUPANT; ;; CASEID|EJECTIONID|OCCUPANTID|LASTUPDATEID|LASTUPDAT ;; ----------|----------|----------|------------|--------- ;; 422002147| 422061300| 422057973| |19-MAR-03 ;;*desc nass.entrapment; ;; Name Null? Type ;; ------------------------------------------------------------------------ -------- ------------------------------------------------- ;; CASEID NOT NULL NUMBER(9) ;; VEHICLEID NOT NULL NUMBER(9) ;; OCCUPANTID NOT NULL NUMBER(9) ;*Cardinality: 1-to-1 (tempo-define-template "sql-bgp_ejection" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_EJECTION; --CREATE OR REPLACE VIEW BGP_EJECTION AS SELECT CCC.CIRENID, NCS.EJECTIONID AS CHILDSEAT_EJECTION_ID, NCS.SEATEJECTION AS CHILDSEAT_EJECTION, NEX.EXTRICTID, NEX.EXTRICTTIME, NE.EJECTIONID AS EJECTION_ID, NE.EJECTIONNUMBER AS EJECTION_NUMBER, SUBSTR(QL1.OPTIONTEXT,1,30) AS EJECTION_TYPE, SUBSTR(DECODE(NEN.MOBILITYRESTRICTION,NULL,'NOT CODED','1','OCCUPANT FATAL BEFORE REMOVED FROM VEHICLE','2','REMOVED FROM VEHICLE WHILE UNCONSCIOUS OR NOT ORIENTED TO TIME','3','REMOVED FROM VEHICLE DUE TO PERCEIVED SERIOUS INJURIES','4','EXITED VEHICLE WITH SOME ASSISTANCE','5','EXITED VEHICLE UNDER OWN POWER','6','OCCUPANT FULLY EJECTED','7','REMOVED FROM VEHICLE FOR OTHER REASONS','8','UNKNOWN',NEN.MOBILITYRESTRICTION),1,72) AS MOBILITY_RESTRICTION, NE.PICKEJECTIONAREA AS EJECTION_AREA, NE.OTHEREJECTIONAREA AS OTHER_EJECTION_AREA, NE.PICKEJECTIONMEDIUM AS PICK_EJECTION_MEDIUM, NE.SPECIFYEJECTIONMEDIUM AS SPECIFY_EJECTION_MEDIUM, NE.PICKEJECTIONMEDIUMSTATUS AS PICK_EJECTION_MEDIUM_STATUS, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION, NEC.EJECTCOMMENT FROM CIREN.CIREN_CASE CCC, NASS.CHILDSEAT NCS, NASS.EJECTION NE, NASS.EJECTIONCOMMENTS NEC, NASS.ENTRAPMENT NEN, NASS.EXTRICATION NEX, NASS.EJECTION_X_OCCUPANT NEXO, NASS.ORGANIZATION NOR, NASS.QUESTIONLOOKUP QL1 WHERE CCC.CASEID > 0 AND CCC.OCCUPANTID > 0 AND CCC.VEHICLEID > 0 AND NE.EJECTIONID > 0 AND CCC.CASEID=NCS.CASEID(+) AND CCC.CASEID=NE.CASEID(+) AND CCC.CASEID=NEC.CASEID(+) AND CCC.CASEID=NEN.CASEID(+) AND CCC.CASEID=NEX.CASEID(+) AND CCC.CASEID=NEXO.CASEID(+) AND CCC.OCCUPANTID=NCS.OCCUPANTID(+) AND CCC.OCCUPANTID=NEN.OCCUPANTID(+) AND CCC.OCCUPANTID=NEX.OCCUPANTID(+) AND CCC.OCCUPANTID=NEXO.OCCUPANTID(+) AND CCC.VEHICLEID=NCS.VEHICLEID(+) AND CCC.VEHICLEID=NE.VEHICLEID(+) AND CCC.VEHICLEID=NEN.VEHICLEID(+) AND CCC.VEHICLEID=NEX.VEHICLEID(+) AND NE.EJECTIONID=NEC.EJECTIONID AND NE.EJECTIONID=NEXO.EJECTIONID AND NE.PICKEJECTIONTYPE=QL1.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=1173 AND NOR.ORGID=CCC.CENTERID ; ") ; definition "sxj" ; abbreviation "Inserts an SQL program stub command") ; documentation ;*What the hell is "...DEFORMATIONLOCATION=2" ;*OVERLAP (tempo-define-template "sql-bgp_overlap" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_OVERLAP; --CREATE OR REPLACE VIEW BGP_OVERLAP AS SELECT DISTINCT /*+ ORDERED */ CIRENID, CENTERID, CIRENNUMBER, SUBSTR(C1.DESCRIPTION,1,1) || SUBSTR(C2.DESCRIPTION,1,1) AS CDC, SMASHD, WIDTHCDC, ENDWIDTH, MAXWIDTH, SUBSTR(' '||ROUND(WIDTHCDC/ENDWIDTH * 100,0)||'%',1,7) AS FEOL, SUBSTR(' '||ROUND((ROUND((MAXWIDTH-ENDWIDTH)/2,1)+WIDTHCDC)/MAXWIDTH *100,0)||'%',1,7) AS VOL, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM NASS.VEHICLEDEFORMATION VD, CIREN.CIREN_CASE C, NASS.DAMAGELOCATOR DL, NASS.CDCLOOKUP C1, NASS.CDCLOOKUP C2, NASS.ORGANIZATION NOR, NASS.VEHICLE V WHERE DEFORMATIONLOCATION=2 AND WIDTHCDC > 0 AND ENDWIDTH > 0 AND LONGLATLOCATION IN (10,12,16,17) AND C.CASEID=VD.CASEID AND DL.CASEID=VD.CASEID AND DL.VEHICLEID=VD.VEHICLEID AND DL.CDCID=VD.DEFORMID AND VD.DEFORMATIONLOCATION=C1.CDCID AND VD.LONGLATLOCATION=C2.CDCID AND V.CASEID=VD.CASEID AND V.VEHICLEID=VD.VEHICLEID AND NOR.ORGID=C.CENTERID ; ") ; definition "soverlap" ; abbreviation "Inserts an SQL program command") ; documentation ;*Used to be in code above: ;AND WIDTHCDC > 0 ;AND ENDWIDTH > 0 ;*What the hell is "...DEFORMATIONLOCATION=2" ;*CDC (tempo-define-template "sql-bgp_cdc-feol-vol" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CDC_FEOL_VOL; --CREATE OR REPLACE VIEW BGP_CDC_FEOL_VOL AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, SUBSTR(C1.DESCRIPTION,1,40) || SUBSTR(C2.DESCRIPTION,1,40) AS CDC, DL.SMASHD, DL.WIDTHCDC, V.ENDWIDTH, V.MAXWIDTH, SUBSTR(' '||ROUND(DL.WIDTHCDC/V.ENDWIDTH * 100,0)||'%',1,7) AS FEOL, SUBSTR(' '||ROUND((ROUND((V.MAXWIDTH-V.ENDWIDTH)/2,1)+DL.WIDTHCDC)/V.MAXWIDTH *100,0)||'%',1,7) AS VOL, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM NASS.VEHICLEDEFORMATION VD, CIREN.CIREN_CASE C, NASS.DAMAGELOCATOR DL, NASS.CDCLOOKUP C1, NASS.CDCLOOKUP C2, NASS.ORGANIZATION NOR, NASS.VEHICLE V WHERE C.CASEID=DL.CASEID(+) AND DL.CASEID=VD.CASEID(+) AND DL.VEHICLEID=VD.VEHICLEID(+) AND DL.CDCID=VD.DEFORMID(+) AND VD.CASEID=V.CASEID(+) AND VD.DEFORMATIONLOCATION=C1.CDCID(+) AND VD.LONGLATLOCATION=C2.CDCID(+) AND VD.VEHICLEID=V.VEHICLEID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "soverlap" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_injuries-and-descriptions" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_INJURIES_AND_DESCRIPTIONS --CREATE OR REPLACE VIEW BGP_INJURIES_AND_DESCRIPTIONS AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CASEID, CCC.VEHICLEID, CCC.CIRENNUMBER, CCI.INJURYID, CCI.AISCODE, NAC.DESCRIPTION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.CIRENINJURY CCI, NASS.AISCODES NAC, NASS.ORGANIZATION NOR WHERE CCI.AISCODE=NAC.NASSCODE AND CCC.CIRENID=CCI.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;; SET LOBOFFSET 80; ;; SET LONG 160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND ccc.cirenid='425040321' and CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 1920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 2960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 3920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 4960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 5920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 6960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 7920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 8960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 9920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 10960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 11920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 12960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 13920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14000; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14080; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14160; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14240; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14320; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14400; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14480; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14560; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14640; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14720; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14800; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14880; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 14960; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15040; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15120; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15200; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15280; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15360; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15440; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15520; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15600; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15680; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15760; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15840; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 15920; ;; SELECT CCC.CIRENID,NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 AND CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID; ;; SET LOBOFFSET 16000; (tempo-define-template "sql-bgp_summaries" ; template name '("--*No \"DISTINCT\" ALLOWED HERE!! --DROP VIEW BGP_SUMMARIES; --CREATE OR REPLACE VIEW BGP_SUMMARIES AS --SET LONG 5000000; SELECT CCC.CIRENID, NCS.SUMMARY FROM CIREN.CIREN_CASE CCC, NASS.CASESUMMARY NCS, NASS.ORGANIZATION NOR WHERE CCC.CASEID > 0 and CCC.CASEID=NCS.CASEID AND NOR.ORGID=CCC.CENTERID ; ") ; definition "scs" ; abbreviation "Inserts an SQL program stub command") ; documentation ;; *Mark on the subject of case status: ;; "Hence- ;; Statusid=2 for Complete ;; Statusid=15 for QC review ;; Statusid=16 for QC complete ;; Statusid=17 for Center closed --aka complete ;; Statusid=-1(QC Incomplete) ;; Now that brings up the issue of Statusid=-1(QC Incomplete) - Yes this status is beyond the wrap-up point of the CIREN site, but is known to have errors that are currently being addressed. Not to mention that Michigan has used this status to re-label their cases requiring injury summary corrections(many cases). ;*These two lines may never go back into this program--because NHTSA will not release this data to me: ;... ;CCC.CRASHDATE FIRST_DATE_OF_CRASH_MONTH, ;TO_CHAR(CCC.CRASHDATE,'DAY') FIRST_DAY_OF_CRASH_MONTH, ;... (tempo-define-template "sql-bgp_root" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_MAXCRUSH CREATE OR REPLACE VIEW BGP_MAXCRUSH AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, MVM.CASEID, MVM.VEHICLEID, MVM.CDCID, MVM.IMPACTID, MVM.MAXCRUSH, MVM.MAXCRUSHLOCATION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.MV_MAXCRUSH MVM, NASS.ORGANIZATION NOR WHERE CCC.CIRENID > 0 AND CCC.CASEID > 0 AND CCC.CASEID=MVM.CASEID(+) AND CCC.VEHICLEID=MVM.VEHICLEID(+) AND NOR.ORGID=CCC.CENTERID AND ((MVM.MAXCRUSH > '-1') AND (MVM.MAXCRUSH < '999')) ; --DROP VIEW BGP_MAXAIS; CREATE OR REPLACE VIEW BGP_MAXAIS AS SELECT DISTINCT /*+ ORDERED */ CIRENID, MAX(SUBSTR(AISCODE,7,1)) AS MAXAIS FROM CIREN.CIRENINJURY WHERE SUBSTR(AISCODE,7,1) <> '7' GROUP BY CIRENID ; --DROP VIEW BGP_MAXINTRUSION; CREATE OR REPLACE VIEW BGP_MAXINTRUSION AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(I.INTRUSION) AS MAXINTRUSION FROM CIREN.CIREN_CASE C, NASS.INTRUSION I WHERE C.CASEID=I.CASEID(+) AND C.VEHICLEID=I.VEHICLEID(+) AND ((I.INTRUSION > '-1') AND (I.INTRUSION < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_MAXDELTAV; CREATE OR REPLACE VIEW BGP_MAXDELTAV AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(NVD.TOTALDELTAV) AS MAXDELTAV FROM CIREN.CIREN_CASE C, NASS.VEHICLEDEFORMATION NVD WHERE C.CASEID=NVD.CASEID(+) AND C.VEHICLEID=NVD.VEHICLEID(+) AND ((NVD.TOTALDELTAV > '-1') AND (NVD.TOTALDELTAV < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_MAXMAXCRUSH; CREATE OR REPLACE VIEW BGP_MAXMAXCRUSH AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(BGP_MAXCRUSH.MAXCRUSH) AS MAXMAXCRUSH FROM CIREN.CIREN_CASE C, POWELLB.BGP_MAXCRUSH BGP_MAXCRUSH WHERE C.CIRENID=BGP_MAXCRUSH.CIRENID(+) AND C.CASEID=BGP_MAXCRUSH.CASEID(+) AND C.VEHICLEID=BGP_MAXCRUSH.VEHICLEID(+) AND ((BGP_MAXCRUSH.MAXCRUSH > '-1') AND (BGP_MAXCRUSH.MAXCRUSH < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_ROOT; --CREATE OR REPLACE VIEW BGP_ROOT AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CIRENNUMBER, CCC.CASEID, CCC.VEHICLEID, CCC.OCCUPANTID, BGP_MAXDELTAV.MAXDELTAV, BGP_MAXINTRUSION.MAXINTRUSION, BGP_MAXMAXCRUSH.MAXMAXCRUSH, BGP_MAXAIS.MAXAIS, CMVI.ISS, CCC.CRASHDATE AS CRASH_MONTH, CCC.DATEOPENED, CCC.STATUSID, DECODE(CCC.STATUSID,'-1','QC INCOMPLETE','2','COMPLETE','3','IN TRANSPORT','1','OPEN','0','PENDING','4','COPY','5','PRELIMINARY REVIEW','10','IN REVIEW','15','QC REVIEW','17','COMPLETE','16','QC COMPLETE') AS CASE_STATUS, CCC.CIREN_NAME, CCC.PHOTO_RELEASE, CCC.PROCESS_STATUSID, CCC.DOB, CCC.CRASHTIME, CCC.AGE, CCC.FATALID, SUBSTR(DECODE(CCC.FATALID,NULL,'NOT CODED','1','NOT FATAL','2','FATAL','3','FATAL BY DISEASE',CCC.FATALID),1,9) AS FATALITY, CCC.FATALLOCID, CCC.CENTERID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.MV_ISS CMVI, CIREN.CIREN_CASE CCC, NASS.ORGANIZATION NOR, POWELLB.BGP_MAXAIS BGP_MAXAIS, POWELLB.BGP_MAXDELTAV BGP_MAXDELTAV, POWELLB.BGP_MAXINTRUSION BGP_MAXINTRUSION, POWELLB.BGP_MAXMAXCRUSH BGP_MAXMAXCRUSH WHERE CCC.CIRENID=BGP_MAXAIS.CIRENID(+) AND CCC.CIRENID=BGP_MAXDELTAV.CIRENID(+) AND CCC.CIRENID=BGP_MAXINTRUSION.CIRENID(+) AND CCC.CIRENID=BGP_MAXMAXCRUSH.CIRENID(+) AND CCC.CIRENID=CMVI.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;*John is continually plagued by VOLPE's mis-labeling of the "CIRENNUMBER"/"CIRENID" crap; so, here is a lookup-table: (tempo-define-template "sql-bgp_cirenid-cirennumber-caseid" ; template name '("--*John is continually plagued by VOLPE's mis-labeling of the CIRENNUMBER... --DROP VIEW BGP_CIRENID_CIRENNUMBER_CASEID; --CREATE OR REPLACE VIEW BGP_CIRENID_CIRENNUMBER_CASEID AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CIRENNUMBER, CCC.CASEID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.ORGANIZATION NOR WHERE NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;; *Mark on the subject of case status: ;; "Hence- ;; Statusid=2 for Complete ;; Statusid=15 for QC review ;; Statusid=16 for QC complete ;; Statusid=17 for Center closed ;; Statusid=-1(QC Incomplete) ;; Now that brings up the issue of Statusid=-1(QC Incomplete) - Yes this status is beyond the wrap-up point of the CIREN site, but is known to have errors that are currently being addressed. Not to mention that Michigan has used this status to re-label their cases requiring injury summary corrections(many cases). (tempo-define-template "sql-bgp_boilerplate" ; template name '("--*BOILERPLATE: This is whatever John Machey thinks it ought to be! Presently, it is this table (below) and BGP_VEHICLE and BGP_IMPACTS_ALL. --DROP VIEW BGP_MAXCRUSH CREATE OR REPLACE VIEW BGP_MAXCRUSH AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, MVM.VEHICLEID, MVM.CASEID, MVM.CDCID, MVM.IMPACTID, MVM.MAXCRUSH, MVM.MAXCRUSHLOCATION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.MV_MAXCRUSH MVM, NASS.ORGANIZATION NOR WHERE CCC.CIRENID > 0 AND CCC.CASEID > 0 AND CCC.CASEID=MVM.CASEID(+) AND CCC.VEHICLEID=MVM.VEHICLEID(+) AND NOR.ORGID=CCC.CENTERID AND ((MVM.MAXCRUSH > '-1') AND (MVM.MAXCRUSH < '999')) ; --DROP VIEW BGP_MAXAIS; CREATE OR REPLACE VIEW BGP_MAXAIS AS SELECT DISTINCT /*+ ORDERED */ CIRENID, MAX(SUBSTR(AISCODE,7,1)) AS MAXAIS FROM CIREN.CIRENINJURY WHERE SUBSTR(AISCODE,7,1) <> '7' GROUP BY CIRENID ; --DROP VIEW BGP_MAXINTRUSION; CREATE OR REPLACE VIEW BGP_MAXINTRUSION AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(I.INTRUSION) AS MAXINTRUSION FROM CIREN.CIREN_CASE C, NASS.INTRUSION I WHERE C.CASEID=I.CASEID(+) AND C.VEHICLEID=I.VEHICLEID(+) AND ((I.INTRUSION > '-1') AND (I.INTRUSION < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_MAXDELTAV; CREATE OR REPLACE VIEW BGP_MAXDELTAV AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(NVD.TOTALDELTAV) AS MAXDELTAV FROM CIREN.CIREN_CASE C, NASS.VEHICLEDEFORMATION NVD WHERE C.CASEID=NVD.CASEID(+) AND C.VEHICLEID=NVD.VEHICLEID(+) AND ((NVD.TOTALDELTAV > '-1') AND (NVD.TOTALDELTAV < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_MAXMAXCRUSH; CREATE OR REPLACE VIEW BGP_MAXMAXCRUSH AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, MAX(BGP_MAXCRUSH.MAXCRUSH) AS MAXMAXCRUSH FROM CIREN.CIREN_CASE C, POWELLB.BGP_MAXCRUSH BGP_MAXCRUSH WHERE C.CIRENID=BGP_MAXCRUSH.CIRENID(+) AND C.CASEID=BGP_MAXCRUSH.CASEID(+) AND C.VEHICLEID=BGP_MAXCRUSH.VEHICLEID(+) AND ((BGP_MAXCRUSH.MAXCRUSH > '-1') AND (BGP_MAXCRUSH.MAXCRUSH < '999')) GROUP BY C.CIRENID ; --DROP VIEW BGP_BOILERPLATE; --CREATE OR REPLACE VIEW BGP_BOILERPLATE AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.VEHICLEID, CCC.CASEID, CCC.OCCUPANTID, BGP_MAXDELTAV.MAXDELTAV, BGP_MAXINTRUSION.MAXINTRUSION, BGP_MAXMAXCRUSH.MAXMAXCRUSH, BGP_MAXAIS.MAXAIS, CMVI.ISS, CCC.DATEOPENED, SUBSTR(CCC.STATUSID,1,35) AS CASE_STATUS_ID, DECODE(CCC.STATUSID,'-1','QC INCOMPLETE','2','COMPLETE','3','IN TRANSPORT','1','OPEN','0','PENDING','4','COPY','5','PRELIMINARY REVIEW','10','IN REVIEW','15','QC REVIEW','17','COMPLETE','16','QC COMPLETE') AS CASE_STATUS, SUBSTR(CCC.AGE,1,35) AS AGE_MONTHS, FLOOR(TO_CHAR(CCC.AGE/12)) AGE_YEARS, CCC.CIRENNUMBER, SUBSTR(CCC.FATALID,1,35) AS FATALITY_ID, SUBSTR(DECODE(CCC.FATALID,NULL,'NOT CODED','1','NOT FATAL','2','FATAL','3','FATAL BY DISEASE',CCC.FATALID),1,9) AS FATALITY, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.MV_ISS CMVI, NASS.ORGANIZATION NOR, POWELLB.BGP_MAXAIS BGP_MAXAIS, POWELLB.BGP_MAXDELTAV BGP_MAXDELTAV, POWELLB.BGP_MAXINTRUSION BGP_MAXINTRUSION, POWELLB.BGP_MAXMAXCRUSH BGP_MAXMAXCRUSH WHERE CCC.CIRENID=BGP_MAXAIS.CIRENID(+) AND ((CCC.STATUSID > 9) OR (CCC.STATUSID = 2)) AND CCC.CIRENID=BGP_MAXDELTAV.CIRENID(+) AND CCC.CIRENID=BGP_MAXINTRUSION.CIRENID(+) AND CCC.CIRENID=BGP_MAXMAXCRUSH.CIRENID(+) AND CCC.CIRENID=CMVI.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;*For completed cases only: ;AND ((CCC.STATUSID > 14) OR (CCC.STATUSID = 2)) ;*For some reason VOLPE got rid of the CIREN.MV_ISS table, here is the related code: ;... ;CMVI.ISS, ;... ;CIREN.MV_ISS CMVI, ;... ;AND CCC.CIRENID=CMVI.CIRENID(+) ;; SELECT * FROM NASS.NASS_CASE ;; ; ;; SP2-0613: Unable to verify PLAN_TABLE format or existence ;; SP2-0611: Error enabling EXPLAIN report ;; CASEID|CASENUMB| ORGID|STRA| STATUSID|ST| IFMASTER|IFWRITABLE| OWNERID|DATEOPENE|RESEARCHERID|PSUREVIEWERID|ZONEREVIEWERID|LASTUPDATEID|LASTUPDAT|SEQUENCEID|RELEASEDA|APPROVEDA|DROPDATE |DROPREASON| TEAMERROR|ZONEUSERID| HDGUSERID|DROPAUTHORIZATION | CASETYPE| STUDYID ;; ----------|--------|----------|----|----------|--|----------|----------|----------|---------|------------|-------------|--------------|------------|---------|----------|---------|---------|---------|----------|----------|----------|----------|--------------------|----------|---------- ;; select * from nass.users; ;; USERID| ORGID|USERNAME |PHONENUMBER |EMAILADDRESS |LOGINID ;; ----------|----------|------------------------------|------------------|------------------------------------------------------------|------------------------------ ;; 810046056| 750|Richard Reed |207-326-9678 |Richard.Reed@nhtsa.dot.gov |REEDR ;; 6024| 802|Tom Swiercinsky |210-699-9065 x34 |Tom.Swiercinsky@nhtsa.dot.gov |SWIERCINSKY ;; 810144063| 903|Janet Brooks | |Janet.Brooks@nhtsa.dot.gov |BROOKSJ ;; 810996188| 741|Ken Campbell |865-574-7953 |campbellkl@ornl.gov |CAMPBELLK (tempo-define-template "sql-bgp_researchers" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_RESEARCHERS; --CREATE OR REPLACE VIEW BGP_RESEARCHERS AS SELECT DISTINCT /*+ ORDERED */ NNC.CASEID, NU.USERID, NU.USERNAME, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM NASS.ORGANIZATION NOR, NASS.NASS_CASE NNC, NASS.USERS NU WHERE NOR.ORGID=NU.ORGID(+) AND NU.USERID=NNC.RESEARCHERID(+) ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;*This will not be released by NHTSA: ;... ;CCC.CRASHDATE, ;... (tempo-define-template "sql-bgp_root_miami_completed_cases" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_MAXAIS; --CREATE OR REPLACE VIEW BGP_MAXAIS AS SELECT CIRENID, MAX(SUBSTR(AISCODE,7,1)) AS MAXAIS FROM CIREN.CIRENINJURY WHERE SUBSTR(AISCODE,7,1) <> '7' GROUP BY CIRENID; --DROP VIEW BGP_BGP_ROOT_MIAMI_COMPLETED_CASES; --CREATE OR REPLACE VIEW BGP_ROOT_MIAMI_COMPLETED_CASES AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CIRENNUMBER, CCC.CASEID, CCC.VEHICLEID, BGP_MAXAIS.MAXAIS, CCC.DATEOPENED, CCC.OCCUPANTID, CCC.STATUSID, DECODE(CCC.STATUSID,'2','COMPLETE','3','IN TRANSPORT','1','OPEN','0','PENDING','4','COPY','5','PRELIMINARY REVIEW','10','QC INCOMPLETE','15','QC REVIEW','17','UNKNOWN','16','QC COMPL ETE') AS CASE_STATUS, CCC.CENTERID, CCC.CIREN_NAME, CCC.SAMPLE_YEAR, CCC.PHOTO_RELEASE, CCC.CASE_TYPEID, CCC.OWNER_STATUSID, CCC.PROCESS_STATUSID, CCC.COPY_LASTUPDATE, CCC.LASTUPDATEDATE, CCC.DOB, CCC.CRITERIAID, CCC.CRASHTIME, CCC.CENTERNUMBER, CCC.AGE, CCC.FATALID, CCC.FATALLOCID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.ORGANIZATION NOR, POWELLB.BGP_MAXAIS BGP_MAXAIS WHERE CCC.CIRENID=BGP_MAXAIS.CIRENID(+) AND NOR.ORGID=CCC.CENTERID AND CCC.CENTERID=604 AND CCC.STATUSID=2 ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation (tempo-define-template "sql-bgp_case_audit" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CASE_AUDIT; --CREATE OR REPLACE VIEW BGP_CASE_AUDIT AS SELECT * FROM NASS.NASS_CASE ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;*Cardinality of this file is 1-to-1--so if you get the CIRENID then the CIRENNUMBER, CASEID, VEHICLEID, OCCUPANTID are gotten as well--they "necessarily follow" they are "implied" (tempo-define-template "sql-bgp_generic" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_GENERIC; --CREATE OR REPLACE VIEW BGP_GENERIC AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CIRENNUMBER, CCC.CASEID, CCC.OCCUPANTID, CCC.VEHICLEID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.ORGANIZATION NOR WHERE NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation ;; *NASS.SEATLOC || **AIRBAGAVAIL || **1790 || **No 1 || **Yes 2 || **Unknown 3 ;; *NASS.SEATLOC || **INTEGRATEDRESTRAINTS || **1790 || **No 1 || **Yes 2 || **Unknown 3 ;; *NASS.SEATLOC || **LATCHANCHORID || **1535 || **No 1 || **Yes 2 || **Unknown 3 ;; *NASS.SEATLOC || **LATCHTETHERID || **1535 || **No 1 || **Yes 2 || **Unknown 3 ;; *NASS.SEATLOC || **PICKPRIORINCLINE || **1285 || **Not Adjustable 1 || **Upright 2 || **Slightly Reclined 3 || **Completely Reclined 4 || **Unknown 9 ;; *NASS.SEATLOC || **PICKSEATORIENTATION || **1282 || **Forward facing seat 1 || **Rear facing seat 2 || **Side facing seat (inward) 3 || **Side facing seat (outward) 4 || **Other (specify) 5 || **Unknown 6 ;; *NASS.SEATLOC || **PICKSEATPERFORMANCE || **1287 || **No seat performance failure(s) 1 || **Seat adjusters failed 2 || **Seat back folding locks or "seat back" failed (specify) 3 || **Seat track/anchors failed 4 || **Deformed by impact of occupant 5 || **Deformed by passenger compartment intrusion, (specify) 6 || **Combination of above (specify) 7 || **Other (specify) 8 || **Unknown 9 ;; *NASS.SEATLOC || **PICKSEATTYPE || **1280 || **Occupant not seated or no seat 1 || **Box mounted seat (i.e., van type) 10 || **Other seat type (specify) 11 || **Unknown 12 || **In or on Unenclosed area(specify) 13 || **In other Enclosed area(specify) 14 || **Bucket 2 || **Bucket with folding back 3 || **Bench 4 || **Bench with separate back cushions 5 || **Bench with folding back(s) 6 || **Split bench with separate back cushions 7 || **Split bench with folding back(s) 8 || **Pedestal (i.e., column supported) 9 ;; *NASS.SEATLOC || **PICKTRACKPOSITION || **1284 || **Non-adjustable seat track 1 || **Seat at forward most track position 2 || **Seat between forward most and middle track positions 3 || **Seat at middle track position 4 || **Seat between middle and rear most track positions 5 || **Seat at rear most track position 6 || **Unknown 7 (tempo-define-template "sql-bgp_seatloc" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_SEATLOC; --CREATE OR REPLACE VIEW BGP_SEATLOC AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, NSL.AIRBAGAVAIL AS AIR_BAG_AVAIL, SUBSTR(QL1.OPTIONTEXT,1,10) AS AIRBAGAVAIL, NSL.INTEGRATEDRESTRAINTS AS INTEGRATED_RESTRAINTS, SUBSTR(QL2.OPTIONTEXT,1,10) AS INTEGRATEDRESTRAINTS, NSL.LATCHANCHORID AS LATCH_ANCHORID, SUBSTR(QL3.OPTIONTEXT,1,10) AS LATCHANCHORID, NSL.LATCHTETHERID AS LATCH_TETHERID, SUBSTR(QL4.OPTIONTEXT,1,10) AS LATCHTETHERID, NSL.PICKPRIORINCLINE AS PRIOR_INCLINE, SUBSTR(QL5.OPTIONTEXT,1,50) AS PICKPRIORINCLINE, NSL.PICKSEATORIENTATION AS SEAT_ORIENTATION, SUBSTR(QL6.OPTIONTEXT,1,70) AS PICKSEATORIENTATION, NSL.PICKSEATPERFORMANCE AS SEAT_PERFORMANCE, SUBSTR(QL7.OPTIONTEXT,1,70) AS PICKSEATPERFORMANCE, NSL.PICKSEATTYPE AS SEAT_TYPE, SUBSTR(QL8.OPTIONTEXT,1,70) AS PICKSEATTYPE, NSL.PICKTRACKPOSITION AS SEAT_TRACK_POSITION, SUBSTR(QL9.OPTIONTEXT,1,70) AS PICKTRACKPOSITION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, NASS.OCCUPANT NOC, NASS.ORGANIZATION NOR, NASS.QUESTIONLOOKUP QL1, NASS.QUESTIONLOOKUP QL2, NASS.QUESTIONLOOKUP QL3, NASS.QUESTIONLOOKUP QL4, NASS.QUESTIONLOOKUP QL5, NASS.QUESTIONLOOKUP QL6, NASS.QUESTIONLOOKUP QL7, NASS.QUESTIONLOOKUP QL8, NASS.QUESTIONLOOKUP QL9, NASS.QUESTIONLOOKUP QSEATTYPE, NASS.SEATLOC NSL, POWELLB.BGP_MAXAIS BGP_MAXAIS WHERE CCC.CASEID > 0 AND CCC.OCCUPANTID > 0 AND CCC.CASEID=NOC.CASEID(+) AND CCC.CASEID=NSL.CASEID(+) AND CCC.OCCUPANTID=NOC.OCCUPANTID(+) AND CCC.VEHICLEID=NOC.VEHICLEID(+) AND CCC.VEHICLEID=NSL.VEHICLEID(+) AND NOC.SEATLOCID=NSL.SEATLOCID AND QSEATTYPE.DATAITEMID(+)=1280 AND TO_CHAR(NSL.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) AND NSL.AIRBAGAVAIL=QL1.OPTIONVALUE(+) AND QL1.DATAITEMID(+)=1790 AND NSL.INTEGRATEDRESTRAINTS=QL2.OPTIONVALUE(+) AND QL2.DATAITEMID(+)=1790 AND NSL.LATCHANCHORID=QL3.OPTIONVALUE(+) AND QL3.DATAITEMID(+)=1535 AND NSL.LATCHTETHERID=QL4.OPTIONVALUE(+) AND QL4.DATAITEMID(+)=1535 AND NSL.PICKPRIORINCLINE=QL5.OPTIONVALUE(+) AND QL5.DATAITEMID(+)=1285 AND NSL.PICKSEATORIENTATION=QL6.OPTIONVALUE(+) AND QL6.DATAITEMID(+)=1282 AND NSL.PICKSEATPERFORMANCE=QL7.OPTIONVALUE(+) AND QL7.DATAITEMID(+)=1287 AND NSL.PICKSEATTYPE=QL8.OPTIONVALUE(+) AND QL8.DATAITEMID(+)=1280 AND NSL.PICKTRACKPOSITION=QL9.OPTIONVALUE(+) AND QL9.DATAITEMID(+)=1284 AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation (tempo-define-template "sql-bgp_anthroid" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_ANTHROID; --CREATE OR REPLACE VIEW BGP_ANTHROID AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCC.CIRENNUMBER, CCC.CASEID, CCC.VEHICLEID, BGP_MAXAIS.MAXAIS, CA.ANTHROID, CA.MEASURE, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.ANTHROPOMETRIC CA, CIREN.CIREN_CASE CCC, NASS.ORGANIZATION NOR WHERE CCC.CIRENID=CA.CIRENID AND CCC.CIRENID=BGP_MAXAIS.CIRENID AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s" ; abbreviation "Inserts an SQL program stub command") ; documentation (tempo-define-template "sql-bgp_admissions" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_ADMISSIONS; --CREATE OR REPLACE VIEW BGP_ADMISSIONS AS SELECT DISTINCT /*+ ORDERED */ CA.CIRENID, CA.ADMISSID, CA.FACILITYID, CA.ADMITTYPE, CA.ADM_DATE, CA.ADM_TIME, CA.ADM_LOCATIONID, CA.DISC_DATE, CA.DISC_TIME, CA.DISC_LOCATIONID, CA.DISC_DISPID, CA.TRANSFERID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.ADMISSIONS CA, NASS.ORGANIZATION NOR WHERE CA.CIRENID=CCC.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-bgp_admiss" ; abbreviation "Inserts an SQL program stub command") ; documentation (tempo-define-template "sql-bgp_anthro" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_ANTHRO --CREATE OR REPLACE VIEW BGP_ANTHRO AS SELECT DISTINCT C.CIRENID, DECODE(SIGN((W.MEASURE/999)-1),0,'UNKNOWN',1,'UNKNOWN',NULL,'NOT CODED',W.MEASURE) AS WEIGHT, DECODE(SIGN((S.MEASURE/999)-1),0,'UNKNOWN',1,'UNKNOWN',NULL,'NOT CODED',S.MEASURE) AS HEIGHT, DECODE(SIGN((SH.MEASURE/999)-1),0,'UNKNOWN',1,'UNKNOWN',NULL,'NOT CODED',SH.MEASURE) AS SEATEDHEIGHT, DECODE(SIGN((CB.MEASURE/999)-1),0,'UNKNOWN',1,'UNKNOWN',NULL,'NOT CODED',CB.MEASURE) AS CHESTBREADTH, DECODE(SIGN((NC.MEASURE/999)-1),0,'UNKNOWN',1,'UNKNOWN',NULL,'NOT CODED',NC.MEASURE) AS NECK_CIRCUMFERENCE, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.ANTHROPOMETRIC W, CIREN.ANTHROPOMETRIC S, CIREN.ANTHROPOMETRIC SH, CIREN.ANTHROPOMETRIC CB, CIREN.ANTHROPOMETRIC NC, NASS.ANTHROLOOKUP LW, NASS.ANTHROLOOKUP LS, NASS.ANTHROLOOKUP LSH, NASS.ANTHROLOOKUP LCB, NASS.ANTHROLOOKUP LNC, CIREN.CIREN_CASE C, NASS.ORGANIZATION NOR WHERE W.ANTHROID=LW.ANTHROID AND W.ANTHROID=1 AND S.ANTHROID=LS.ANTHROID AND S.ANTHROID=2 AND SH.ANTHROID=LSH.ANTHROID AND SH.ANTHROID=17 AND CB.ANTHROID=LCB.ANTHROID AND CB.ANTHROID=7 AND NC.ANTHROID=LNC.ANTHROID AND NC.ANTHROID=31 AND C.CIRENID=W.CIRENID AND W.CIRENID=S.CIRENID AND S.CIRENID=SH.CIRENID AND SH.CIRENID=CB.CIRENID AND CB.CIRENID=NC.CIRENID AND NOR.ORGID=C.CENTERID ; ") ; definition "s-bgp_anthro" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_charges" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CHARGES; --CREATE OR REPLACE VIEW BGP_CHARGES AS SELECT DISTINCT CC.CIRENID, C.ADMID AS ADMISSID, C.CHARGEID, TYPE.DESCRIPTION CHARGETYPE, C.AMOUNT, P1.DESCRIPTION PAYOR1, P2.DESCRIPTION PAYOR2, C.CHARGEFLAG, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CHARGES C, CIREN.CIREN_CASE CC, NASS.CHARGETYPELOOKUP TYPE, NASS.PAYORLOOKUP P1, NASS.PAYORLOOKUP P2, NASS.ORGANIZATION NOR WHERE C.CHARGETYPEID=TYPE.CHARGETYPEID(+) AND CC.CIRENID=C.CIRENID(+) AND C.PAYOR1ID=P1.PAYORID(+) AND C.PAYOR2ID=P2.PAYORID(+) AND NOR.ORGID=CC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*Cardinality: 1-to-many (tempo-define-template "sql-bgp_injury-source-ais-aspect-area-confidence-element" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_INJURY_SOURCE; --CREATE OR REPLACE VIEW BGP_INJURY_SOURCE AS SELECT DISTINCT /*+ ORDERED */ CI.CIRENID, CI.AISCODE, SUBSTR(AIS.DESCRIPTION,1,100) AS AIS_DESCRIPTION, SUBSTR(ISC.DESCRIPTION,1,60) AS AREA_DESCRIPTION, SUBSTR(AIS.AISCODES,1,1) AS REGION, DECODE(SUBSTR(AIS.AISCODES,1,1), '1','HEAD', '2','FACE', '3','NECK', '4','THORAX', '5','ABDOMEN', '6','SPINE', '7','UPPER EXTREMITY', '8','LOWER EXTREMITY', '9','UNSPECIFIED') AS REGION, SUBSTR(AIS.AISCODES,7,1) AS SEVERITY, DECODE(SUBSTR(AIS.AISCODES,7,1), '1','MINOR', '2','MODERATE', '3','SERIOUS', '4','SEVERE', '5','CRITICAL', '6','MAXIMUM', '7','INJURED UNKNOWN SEVERITY') AS SEVERITY, ASPECT.ASPECTID AS ASPECT_DESCRIPTION, SUBSTR(A.DESCRIPTION,1,60) AS ASPECT_DESCRIPTION, CI.SOURCEID AS INJURY_SOURCE, SUBSTR(INS.DESCRIPTION,1,60) AS INJURY_SOURCE, CI.SOURCECONFIDENCEID AS CONFIDENCE_LEVEL, SUBSTR(CONF.CONFDESC,1,35) AS CONFIDENCE_LEVEL, CI.DIRECTINDIRECT AS DIRECTINDIRECT, SUBSTR(DI.DESCRIPTION,1,35) AS DIRECTINDIRECT, CI.INJURYID, CI.CIRENINJURYLINKID AS OTHERINJURYID, AB.AIRBAGID, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, CIREN.CIRENINJURY CI, NASS.AISCODES AIS, CIREN.INJURYASPECT ASPECT, NASS.ASPECTLOOKUP A, CIREN_WH.MV_AIRBAGID AB, NASS.INJURYSOURCELOOKUP INS, NASS.INJURYSOURCECATLOOKUP ISC, NASS.DIRINDIRINJURYLOOKUP DI, NASS.CONFIDENCELOOKUP CONF, NASS.ORGANIZATION NOR WHERE C.CIRENID=CI.CIRENID AND CI.INJURYID > 0 AND CI.AISCODE=AIS.NASSCODE(+) AND CI.CIRENID=ASPECT.CIRENID(+) AND CI.INJURYID=ASPECT.INJURYID(+) AND ASPECT.ASPECTID=A.ASPECTID(+) AND CI.SOURCEID=INS.INJURYSOURCEID(+) AND INS.INJURYSOURCECATID=ISC.INJURYSOURCECATID(+) AND CI.CIRENID=AB.CIRENID(+) AND CI.SOURCEID=AB.INJURYSOURCEID(+) AND CI.INJURYID=AB.INJURYID(+) AND CI.DIRECTINDIRECT=DI.DIRINDIRID(+) AND CI.SOURCECONFIDENCEID=CONF.CONFIDENCEID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_injury-severity-contact-completed-cases-only" ; template name '("--*DOCUMENTATION-BLAH --THIS PROGRAM IS TABLE 3 FOR TED SCHUMAN --LOOKING AT COMPLETED CASES --PULLING OUT INJURY INFORMATION, CONFIDENCE LEVEL --DROP VIEW BGP_INJURY_SEVERITY_CONTACT_COMPLETED_CASES_ONLY; --CREATE OR REPLACE VIEW BGP_INJURY_SEVERITY_CONTACT_COMPLETED_CASES_ONLY AS SELECT CC.CIRENID, CIRENNUMBER, CENTERID, DECODE(CC.STATUSID,'2','COMPLETE') AS STATUS, SUBSTR(AISCODE,1,7) AS AIS, A1.DESCRIPTION AS "AIS DESCRIPTION", SUBSTR(AISCODE,1,1) AS BODY, DECODE(SUBSTR(AISCODE,1,1), 1,'HEAD', 2,'FACE', 3,'NECK', 4,'THORAX', 5,'ABDOMEN', 6,'SPINE', 7,'UPPER EXTREMITY', 8,'LOWER EXTREMITY', 9,'UNSPECIFIED') AS BODYREGION, SUBSTR(AISCODE,7,1) AS SEVERITY, DIRECTINDIRECT, A2.DESCRIPTION AS "CONTACT", SOURCEID, A3.DESCRIPTION AS "INJURY SOURCE", CONFIDENCEID, A4.CONFDESC AS "CONFIDENCE" FROM CIREN.CIREN_CASE CC, CIREN.CIRENINJURY CI, NASS.AISCODES A1, NASS.CIRENSTATUSLOOKUP CS, NASS.DIRINDIRINJURYLOOKUP A2, NASS.INJURYSOURCELOOKUP A3, NASS.CONFIDENCELOOKUP A4 WHERE CC.CIRENID=CI.CIRENID(+) AND CC.STATUSID=CS.STATUSID(+) AND CI.AISCODE=A1.NASSCODE AND A2.DIRINDIRID=CI.DIRECTINDIRECT AND A3.INJURYSOURCEID=CI.SOURCEID AND A4.CONFIDENCEID=CI.SOURCECONFIDENCEID AND CC.STATUSID='2' ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_clothing" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CLOTHING; --CREATE OR REPLACE VIEW BGP_CLOTHING AS SELECT DISTINCT CC.CIRENID, CC.CASEID, CC.CIRENNUMBER CIRENNUMBER, L.DESCRIPTION CLOTHING, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CC, CIREN.CLOTHING C, NASS.CLOTHINGLOOKUP L, NASS.ORGANIZATION NOR WHERE CC.CIRENID=C.CIRENID(+) AND C.CLOTHINGID=L.CLOTHINGID(+) AND NOR.ORGID=CC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_comorbidity" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_COMORBIDITY; --CREATE OR REPLACE VIEW BGP_COMORBIDITY AS SELECT DISTINCT CC.CIRENID, L.DESCRIPTION COMORBIDITY, C.COMORBIDCOMMENT, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CC, CIREN.COMORBIDITY C, NASS.FACTORLOOKUP L, NASS.ORGANIZATION NOR WHERE CC.CIRENID=C.CIRENID(+) AND C.FACTORID=L.FACTORID(+) AND NOR.ORGID=CC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*The idiots at VOLPE and their sycophants here in DC have delivered "lies" in the form of these 2 columns (so I will extract these lines now--and forever--until they stop delivering (knowingly delivering) false data): ;... ;C.CRASHDATE, ;TO_CHAR(C.CRASHDATE,'DAY') DAY, ;... ;*Is the ISS calculated below better than other code in this file that calculates ISS? ;... ;CIREN.F_CALCISS(C.CIRENID) ISS, ;... (tempo-define-template "sql-bgp_crashderived" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_CRASHDERIVED; --CREATE OR REPLACE VIEW BGP_CRASHDERIVED AS SELECT DISTINCT /*+ ORDERED */ C.CIRENID, A.SPECIFYCONFIG AS MANNEROFCOLLISION, SUBSTR(ETOH.OPTIONTEXT,1,60) ALCOHOLINVOLVED, SUBSTR(DRUG.OPTIONTEXT,1,60) DRUGINVOLVED, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.ACCIDENT A, NASS.DRIVER D, NASS.QUESTIONLOOKUP DRUG, NASS.QUESTIONLOOKUP ETOH, POWELLB.BGP_MAXAIS BGP_MAXAIS, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CIRENID=BGP_MAXAIS.CIRENID(+) AND C.CASEID=A.CASEID(+) AND C.CASEID=D.CASEID(+) AND C.VEHICLEID=D.VEHICLEID(+) AND C.OCCUPANTID=D.OCCUPANTID(+) AND D.ALCOHOLPRESENCE=ETOH.OPTIONVALUE(+) AND ETOH.DATAITEMID(+)=1634 AND D.DRUGPRESENCE=DRUG.OPTIONVALUE(+) AND DRUG.DATAITEMID(+)=1635 AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*AKA sql-bgp_demoinfo --theee two "sql-bgp_" should be identical (tempo-define-template "sql-bgp_lifestyle" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_LIFESTYLE; --CREATE OR REPLACE VIEW BGP_LIFESTYLE AS SELECT DISTINCT CCC.CIRENID, DA.DESCRIPTION ALCOHOL, DI.DESCRIPTION HOUSEHOLDINCOME, DIS.DESCRIPTION INDUSTRY, DOCC.DESCRIPTION OCCUPATION, DLIV.DESCRIPTION LIVINGARRANGMENT, DMARI.DESCRIPTION MARITALSTATUS, DRACE.DESCRIPTION RACEETHNICITY, DEDU.DESCRIPTION LEVELOFEDUCATION, DSMOK.DESCRIPTION SMOKINGHABITS, DSEX.OPTIONTEXT SEX, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.DEMOINFO AI, CIREN.DEMOINFO II, CIREN.DEMOINFO IIS, CIREN.DEMOINFO OCC, CIREN.DEMOINFO LIV, CIREN.DEMOINFO MARI, CIREN.DEMOINFO RACE, CIREN.DEMOINFO EDU, CIREN.DEMOINFO SMOK, CIREN.DEMOINFO SEX, NASS.DEMOLOOKUP DA, NASS.DEMOLOOKUP DI, NASS.DEMOLOOKUP DIS, NASS.DEMOLOOKUP DOCC, NASS.DEMOLOOKUP DLIV, NASS.DEMOLOOKUP DMARI, NASS.DEMOLOOKUP DRACE, NASS.DEMOLOOKUP DEDU, NASS.DEMOLOOKUP DSMOK, NASS.QUESTIONLOOKUP DSEX, NASS.ORGANIZATION NOR WHERE CCC.CIRENID=AI.CIRENID(+) AND AI.CIRENID=II.CIRENID(+) AND II.CIRENID=IIS.CIRENID(+) AND IIS.CIRENID=OCC.CIRENID(+) AND OCC.CIRENID=LIV.CIRENID(+) AND LIV.CIRENID=MARI.CIRENID(+) AND MARI.CIRENID=RACE.CIRENID(+) AND RACE.CIRENID=EDU.CIRENID(+) AND EDU.CIRENID=SMOK.CIRENID(+) AND SMOK.CIRENID=SEX.CIRENID(+) AND AI.DEMOID=DA.DEMOID(+) AND II.DEMOID=DI.DEMOID(+) AND DIS.DEMOID=IIS.DEMOID(+) AND OCC.DEMOID=DOCC.DEMOID(+) AND LIV.DEMOID=DLIV.DEMOID(+) AND MARI.DEMOID=DMARI.DEMOID(+) AND RACE.DEMOID=DRACE.DEMOID(+) AND EDU.DEMOID=DEDU.DEMOID(+) AND SMOK.DEMOID=DSMOK.DEMOID(+) AND SEX.DEMOID=DSEX.OPTIONVALUE(+) AND DSEX.DATAITEMID=1043 AND AI.DEMOCATID=284043708 AND II.DEMOCATID=284043709 AND IIS.DEMOCATID=284043710 AND OCC.DEMOCATID=284043712 AND LIV.DEMOCATID=284043713 AND MARI.DEMOCATID=284043714 AND RACE.DEMOCATID=284043715 AND EDU.DEMOCATID=284043716 AND SMOK.DEMOCATID=284043717 AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*AKA sql-bgp_lifestyle--theee two "sql-bgp_" should be identical (tempo-define-template "sql-bgp_demoinfo" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_DEMOINFO; --CREATE OR REPLACE VIEW BGP_DEMOINFO AS SELECT DISTINCT CCC.CIRENID, DA.DESCRIPTION ALCOHOL, DI.DESCRIPTION HOUSEHOLDINCOME, DIS.DESCRIPTION INDUSTRY, DOCC.DESCRIPTION OCCUPATION, DLIV.DESCRIPTION LIVINGARRANGMENT, DMARI.DESCRIPTION MARITALSTATUS, DRACE.DESCRIPTION RACEETHNICITY, DEDU.DESCRIPTION LEVELOFEDUCATION, DSMOK.DESCRIPTION SMOKINGHABITS, DSEX.OPTIONTEXT SEX, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.DEMOINFO AI, CIREN.DEMOINFO II, CIREN.DEMOINFO IIS, CIREN.DEMOINFO OCC, CIREN.DEMOINFO LIV, CIREN.DEMOINFO MARI, CIREN.DEMOINFO RACE, CIREN.DEMOINFO EDU, CIREN.DEMOINFO SMOK, CIREN.DEMOINFO SEX, NASS.DEMOLOOKUP DA, NASS.DEMOLOOKUP DI, NASS.DEMOLOOKUP DIS, NASS.DEMOLOOKUP DOCC, NASS.DEMOLOOKUP DLIV, NASS.DEMOLOOKUP DMARI, NASS.DEMOLOOKUP DRACE, NASS.DEMOLOOKUP DEDU, NASS.DEMOLOOKUP DSMOK, NASS.QUESTIONLOOKUP DSEX, NASS.ORGANIZATION NOR WHERE AI.DEMOID=DA.DEMOID(+) AND II.DEMOID=DI.DEMOID(+) AND DIS.DEMOID=IIS.DEMOID(+) AND OCC.DEMOID=DOCC.DEMOID(+) AND LIV.DEMOID=DLIV.DEMOID(+) AND MARI.DEMOID=DMARI.DEMOID(+) AND RACE.DEMOID=DRACE.DEMOID(+) AND EDU.DEMOID=DEDU.DEMOID(+) AND SMOK.DEMOID=DSMOK.DEMOID(+) AND SEX.DEMOID=DSEX.OPTIONVALUE(+) AND DSEX.DATAITEMID=1043 AND AI.DEMOCATID=284043708 AND II.DEMOCATID=284043709 AND IIS.DEMOCATID=284043710 AND OCC.DEMOCATID=284043712 AND LIV.DEMOCATID=284043713 AND MARI.DEMOCATID=284043714 AND RACE.DEMOCATID=284043715 AND EDU.DEMOCATID=284043716 AND SMOK.DEMOCATID=284043717 AND AI.CIRENID=II.CIRENID AND IIS.CIRENID=II.CIRENID(+) AND IIS.CIRENID=OCC.CIRENID(+) AND OCC.CIRENID=LIV.CIRENID(+) AND LIV.CIRENID=MARI.CIRENID(+) AND MARI.CIRENID=RACE.CIRENID(+) AND RACE.CIRENID=EDU.CIRENID(+) AND EDU.CIRENID=SMOK.CIRENID(+) AND SMOK.CIRENID=SEX.CIRENID(+) AND CCC.CIRENID=AI.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;* (tempo-define-template "sql-bgp_emsresponse" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_EMSRESPONSE; --CREATE OR REPLACE VIEW BGP_EMSRESPONSE AS SELECT DISTINCT C.CIRENID, EMS.CASEID, C.CIRENNUMBER, EMS.EMSID, TYPE.DESCRIPTION AGENCY, EMODE.DESCRIPTION EMSMODE, VEH.OPTIONTEXT VEHICLETYPE, EMS.NOTIFICATIONTIME, EMS.DEPARTURETIME, EMS.MEDARRIVALTIME, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM NASS.EMSRESPONSE EMS, CIREN.CIREN_CASE C, NASS.EMSMODELOOKUP EMODE, NASS.EMSTYPELOOKUP TYPE, NASS.QUESTIONLOOKUP VEH, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=EMS.CASEID(+) AND EMS.EMSTYPE=TYPE.ID(+) AND EMS.EMSMODE=EMODE.ID(+) AND EMS.VEHICLETYPEID=VEH.OPTIONVALUE(+) AND VEH.DATAITEMID(+)=3040 AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_casestructurevehicles" ; template name '("--*DOCUMENTATION-BLAH SELECT * FROM NASS.CASESTRUCTUREVEHICLES ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;; 10. EVENTS: ;; NAME TYPE ;; CIRENID NUMBER ;; CIRENNUMBER VARCHAR2 ;; CASEID NUMBER ;; STRIKEVEHICLEID NUMBER ;; EVENTID NUMBER ;; EVENTNO NUMBER ;; STRIKEVEHICLENO NUMBER ;; STRIKEVEHICLECLASS VARCHAR2 ;; STRIKEGAD VARCHAR2 ;; STRUCKOBJECTCLASS VARCHAR2 ;; STRUCKOBJECT VARCHAR2 ;; STRUCKVEHICLECLASS VARCHAR2 ;; STRUCKGAD VARCHAR2 ;; STRUCKVEHICLEID NUMBER ;; Query used for EVENTS: ;; CREATE OR REPLACE VIEW c_events as ;; SELECT ;; c.cirenid CIRENID, ;; c.cirennumber CIRENNumber, ;; e.caseid CaseID, ;; e.vehicleid StrikeVehicleID, ;; e.eventsequenceid EventID, ;; e.eventsequencenumber EventNo, ;; csv1.vehiclenumber StrikeVehicleNo, ;; strikel.description StrikeVehicleClass, ;; strikeg.description StrikeGAD, ;; struckoc.description StruckObjectClass, ;; strucko.description StruckObject, ;; struckl.description StruckVehicleClass, ;; struckg.description StruckGAD, ;; DECODE(e.pickobjectcontactclass, 1, csv2.vehicleid) StruckVehicleID ;; FROM ;; ciren.ciren_case c, nass.events e, nass.casestructurevehicles csv1, nass.vehicle v, ;; nass.vehicleclasslookup strikel, nass.vehicleclasslookup struckl, nass.gadlookup strikeg, ;; nass.gadlookup struckg, nass.objectcontactlookup strucko, nass.objectcontactcatlookup ;; struckoc, nass.casestructurevehicles csv2 ;; WHERE ;; c.caseid=e.caseid(+) and ;; c.vehicleid=e.vehicleid(+) and ;; e.vehicleid=csv1.vehicleid (+) and ;; e.vehicleid = v.vehicleid (+) and ;; v.pickvehicleclass=strikel.vehicleclassid (+) and ;; e.pickareaofdamage=strikeg.gadid(+) and ;; e.pickobjectcontactclass=struckoc.contactcatid (+) and ;; e.pickobjectcontact=strucko.objectcontactid (+) and ;; e.pickcontactvehicleclass=struckl.vehicleclassid (+)and ;; e.pickcontactvehicledamage=struckg.gadid(+) and ;; e.pickobjectcontact=csv2.vehiclenumber (+) and ;; e.caseid=csv2.caseid (+) ; (tempo-define-template "sql-bgp_events-original" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_EVENTS; --CREATE OR REPLACE VIEW BGP_EVENTS AS SELECT C.CIRENID, E.EVENTSEQUENCEID, E.EVENTSEQUENCENUMBER, C.CASEID, C.CIRENNUMBER, E.VEHICLEID AS STRIKE_VEHICLEID, CSV1.VEHICLENUMBER AS STRIKE_VEHICLE_NO, STRIKEL.DESCRIPTION AS STRIKE_VEHICLE_CLASS, STRIKEG.DESCRIPTION AS STRIKE_GAD, STRUCKOC.DESCRIPTION AS STRUCK_OBJECT_CLASS, STRUCKO.DESCRIPTION AS STRUCK_OBJECT, STRUCKL.DESCRIPTION AS STRUCK_VEHICLE_CLASS, STRUCKG.DESCRIPTION AS STRUCK_GAD, CSV2.VEHICLEID AS STRUCK_VEHICLEID, E.PICKOBJECTCONTACTCLASS, E.PICKOBJECTCONTACT, DECODE(E.PICKOBJECTCONTACTCLASS, 1, CSV2.VEHICLEID) STRUCKVEHICLEID, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.CASESTRUCTUREVEHICLES CSV1, NASS.VEHICLE V, NASS.VEHICLECLASSLOOKUP STRIKEL, NASS.VEHICLECLASSLOOKUP STRUCKL, NASS.GADLOOKUP STRIKEG, NASS.GADLOOKUP STRUCKG, NASS.OBJECTCONTACTLOOKUP STRUCKO, NASS.OBJECTCONTACTCATLOOKUP STRUCKOC, NASS.CASESTRUCTUREVEHICLES CSV2, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND E.VEHICLEID=CSV1.VEHICLEID(+) AND E.VEHICLEID=V.VEHICLEID(+) AND V.PICKVEHICLECLASS=STRIKEL.VEHICLECLASSID(+) AND E.PICKAREAOFDAMAGE=STRIKEG.GADID(+) AND E.PICKOBJECTCONTACTCLASS=STRUCKOC.CONTACTCATID(+) AND E.PICKOBJECTCONTACT=STRUCKO.OBJECTCONTACTID(+) AND E.PICKCONTACTVEHICLECLASS=STRUCKL.VEHICLECLASSID(+) AND E.PICKCONTACTVEHICLEDAMAGE=STRUCKG.GADID(+) AND E.PICKOBJECTCONTACT=CSV2.VEHICLENUMBER(+) AND E.CASEID=CSV2.CASEID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*Cardinality: 1-to-many (tempo-define-template "sql-bgp_gcs" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_GCS; --CREATE OR REPLACE VIEW BGP_GCS AS SELECT DISTINCT C.CIRENID, G.GCSMEASUREID, G.GCSDATE, G.GCSTIME, G.GCSEYE, G.GCSVERBAL, G.GCSMOTOR, G.GCSSTATE, G.LOCATIONID, G.GCSTOTAL, STATE.OPTIONTEXT QUALIFIER, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, CIREN.GCSMEASURE G, NASS.QUESTIONLOOKUP STATE, NASS.ORGANIZATION NOR WHERE C.CIRENID=G.CIRENID(+) AND G.GCSSTATE=STATE.OPTIONVALUE(+) AND DATAITEMID(+)=3010 AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;The following IMPACT VIEWS are inspired by the following (in part by VOLPE--the ;; MAXCRUSH and the STRIKE_STRUCK tables are the best guess I have at their original--which ;;is @definitely@ there fault--because they direct us to there documentation which contains ;;references to tables and VIEWS that do not exist anymore (i.e. they deleted) and then they ;;refuse or fail to update the documentation and/or VIEWS these programs reference: ;; SELECT ;; c.cirenid CIRENID, ;; TO_CHAR(d.deformid) DeformID, ;; e.eventsequenceid EventID, ;; e.eventsequencenumber EventNo, ;; RPAD(SUBSTR(c1.description,1,1), 15, ' ') ImpactType, ;; DECODE (vmc.MaxCrush, null, 'NONE', vmc.MaxCrush) MaxCrush, ;; DECODE (TO_CHAR(d.directionofforce),-9999, 'Unknown', -8888, 'NA', ;; d.Directionofforce) PDOF, ;; c1.description DeformationLocation, ;; c2.description LongLateral, ;; c3.description VerticalLateral, ;; c4.description Distribution, ;; c5.description Extent, ;; DECODE (Totaldeltav, null, 'NOT CODED',Totaldeltav) Total, ;; DECODE (Longdeltav, null, 'NOT CODED',Longdeltav) Longtdl, ;; DECODE (Latdeltav,null,'NOT CODED',Latdeltav) Lateral, ;; DECODE (Energydeltav, -9999,'Unknown', null, 'NOT CODED', energydeltav) Energy, ;; DECODE (Impactdeltav,null,'NOT CODED', Impactdeltav) Impact, ;; DECODE (Barrierdeltav, null , 'NOT CODED', Barrierdeltav) Barrier, ;; SUBSTR(DECODE (q.optiontext, null, 'NOT CODED', q. optiontext),1,80) Estimated, ;; DECODE(dl.description, null, 'NOT CODED', dl. description ) Basis ;; FROM ;; ciren.ciren_case c, nass.events e, nass.vehicledeformation d, nass.cdclookup c1, ;; nass.cdclookup c2, nass.cdclookup c3, nass.cdclookup c4, nass.cdclookup c5, ;; nass.questionlookup q, ;; nass.deltavbasislookup dl, NASS.MV_MAXCRUSH vmc ;; WHERE ;; c.caseid=e.caseid and ;; c.vehicleid=e.vehicleid and ;; e.caseid=d.caseid and ;; e.eventsequenceid=d.eventsequenceid and ;; e.vehicleid=d.vehicleid and ;; d.ranking=1 and ;; d.caseid=vmc.caseid(+) and ;; d.vehicleid=vmc.vehicleid(+) and ;; d.deformid=vmc.cdcid(+) and ;; d.deformationlocation=c1.cdcid and ;; d.longlatlocation=c2.cdcid and ;; d.vertlatlocation=c3.cdcid and ;; d.damagedistribution=c4.cdcid and ;; d.damageextent=c5.cdcid and ;; d.estimateddeltav =q.optionvalue and ;; q.dataitemid=1566 and ;; d.pickdeltavbasis=dl.deltavbasisid ;; UNION ;; SELECT ;; c.cirenid CIRENID , ;; Null DeformID, ;; e.eventsequenceid EventID, ;; e.eventsequencenumber EventNo, ;; RPAD(SUBSTR (DECODE (LOWER(GAD), 'unknown', '9', GAD),1,1), 15, ' ') ;; ImpactType, ;; DECODE (null, null, 'NA') MaxCrush, ;; DECODE (null, null, 'NA') PDOF, ;; DECODE (null, null, 'NA') DeformationLocation, ;; DECODE (null, null, 'NA') LongLateral, ;; DECODE (null, null, 'NA') VerticalLateral, ;; DECODE (null, null, 'NA') Distribution, ;; DECODE (null, null, 'NA') Extent, ;; DECODE (vc.highestdeltav, null, 'NOT CODED',vc.highestdeltav) Total, ;; DECODE (vc.highestlongdeltav, null, 'NOT CODED',vc.highestlongdeltav) Longtdl, ;; DECODE (vc.highestlatdeltav, null, 'NOT CODED', vc.highestlatdeltav) Lateral, ;; DECODE (vc.highestenergy,-9999, 'Unknown', null, 'NOT CODED', vc.highestenergy ) ;; Energy, ;; DECODE (vc.highestspeed, null, 'NOT CODED',vc.highestspeed) Impact, ;; DECODE (vc.highestbarrierspeed, null, 'NOT CODED',vc.highestbarrierspeed) Barrier, ;; SUBSTR (DECODE (q.optiontext, null, 'NOT CODED', q. optiontext ), 1, 80) ;; Estimated, ;; DECODE(dl.description, null, 'NOT CODED', dl.description) Basis ;; FROM ;; ciren.ciren_case c, nass.events e, nass.vehiclecrash vc, nass.questionlookup q, ;; nass.deltavbasislookup dl, NASS.MV_STRIKING_STRUCK vss ;; WHERE ;; c.caseid=e.caseid and ;; c.vehicleid=e.vehicleid and ;; vc.pickinspectiontype in (1, 2) and ;; vc.estdeltav=q.optionvalue and ;; q.dataitemid=1566 and ;; vc.pickdeltavbasis=dl.deltavbasisid and ;; e.caseid=vc.caseid and ;; e.vehicleid=vc.vehicleid and ;; vc.caseid=vss.caseid(+) and ;; vc.vehicleid=vss.vehicleid(+); (tempo-define-template "sql-bgp_impacts-worst" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_IMPACTS_WORST; --CREATE OR REPLACE VIEW BGP_IMPACTS_WORST AS SELECT DISTINCT C.CIRENID, E.EVENTSEQUENCEID, TO_CHAR(D.DEFORMID) DEFORMID, E.EVENTSEQUENCENUMBER, D.RANKING, RPAD(SUBSTR(C1.DESCRIPTION,1,1),15,' ') IMPACTTYPE_GAD, DECODE(VMC.MAXCRUSH,NULL,'NONE',VMC.MAXCRUSH) MAXCRUSH, DECODE(TO_CHAR(D.DIRECTIONOFFORCE),-9999,'UNKNOWN',-8888,'NA',D.DIRECTIONOFFORCE) PDOF, C1.DESCRIPTION DEFORMATIONLOCATION, C2.DESCRIPTION LONGLATERAL, C3.DESCRIPTION VERTICALLATERAL, C4.DESCRIPTION DISTRIBUTION, C5.DESCRIPTION EXTENT, DECODE(TOTALDELTAV,NULL,'NOT CODED',TOTALDELTAV) TOTAL, DECODE(LONGDELTAV,NULL,'NOT CODED',LONGDELTAV) LONGTDL, DECODE(LATDELTAV,NULL,'NOT CODED',LATDELTAV) LATERAL, DECODE(ENERGYDELTAV,-9999,'UNKNOWN',NULL,'NOT CODED',ENERGYDELTAV) ENERGY, DECODE(IMPACTDELTAV,NULL,'NOT CODED',IMPACTDELTAV) IMPACT, DECODE(BARRIERDELTAV,NULL ,'NOT CODED',BARRIERDELTAV) BARRIER, SUBSTR(DECODE(Q.OPTIONTEXT,NULL,'NOT CODED',Q.OPTIONTEXT),1,80) DELTAV_ESTIMATED, DECODE(DL.DESCRIPTION,NULL,'NOT CODED',DL.DESCRIPTION) BASIS, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.VEHICLEDEFORMATION D, NASS.CDCLOOKUP C1, NASS.CDCLOOKUP C2, NASS.CDCLOOKUP C3, NASS.CDCLOOKUP C4, NASS.CDCLOOKUP C5, NASS.QUESTIONLOOKUP Q, NASS.DELTAVBASISLOOKUP DL, NASS.MV_MAXCRUSH VMC, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND E.CASEID=D.CASEID(+) AND E.EVENTSEQUENCEID=D.EVENTSEQUENCEID AND E.VEHICLEID=D.VEHICLEID(+) AND D.RANKING=1 AND D.CASEID=VMC.CASEID(+) AND D.VEHICLEID=VMC.VEHICLEID(+) AND D.DEFORMID=VMC.CDCID(+) AND D.DEFORMATIONLOCATION=C1.CDCID AND D.LONGLATLOCATION=C2.CDCID AND D.VERTLATLOCATION=C3.CDCID AND D.DAMAGEDISTRIBUTION=C4.CDCID AND D.DAMAGEEXTENT=C5.CDCID AND D.ESTIMATEDDELTAV=Q.OPTIONVALUE(+) AND Q.DATAITEMID=1566 AND D.PICKDELTAVBASIS=DL.DELTAVBASISID AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, E.EVENTSEQUENCEID, NULL DEFORMID, E.EVENTSEQUENCENUMBER, D.RANKING, RPAD(SUBSTR(DECODE(LOWER(GAD),'UNKNOWN','9',GAD),1,1),15,' ') IMPACTTYPE_GAD, DECODE(NULL,NULL,'NA') MAXCRUSH, DECODE(TO_CHAR(D.DIRECTIONOFFORCE),-9999,'UNKNOWN',-8888,'NA',D.DIRECTIONOFFORCE) PDOF, DECODE(NULL,NULL,'NA') DEFORMATIONLOCATION, DECODE(NULL,NULL,'NA') LONGLATERAL, DECODE(NULL,NULL,'NA') VERTICALLATERAL, DECODE(NULL,NULL,'NA') DISTRIBUTION, DECODE(NULL,NULL,'NA') EXTENT, DECODE(VC.HIGHESTDELTAV,NULL,'NOT CODED',VC.HIGHESTDELTAV) TOTAL, DECODE(VC.HIGHESTLONGDELTAV,NULL,'NOT CODED',VC.HIGHESTLONGDELTAV) LONGTDL, DECODE(VC.HIGHESTLATDELTAV,NULL,'NOT CODED',VC.HIGHESTLATDELTAV) LATERAL, DECODE(VC.HIGHESTENERGY,-9999,'UNKNOWN',NULL,'NOT CODED',VC.HIGHESTENERGY) ENERGY, DECODE(VC.HIGHESTSPEED,NULL,'NOT CODED',VC.HIGHESTSPEED) IMPACT, DECODE(VC.HIGHESTBARRIERSPEED,NULL,'NOT CODED',VC.HIGHESTBARRIERSPEED) BARRIER, SUBSTR(DECODE(Q.OPTIONTEXT,NULL,'NOT CODED',Q.OPTIONTEXT),1,80) DELTAV_ESTIMATED, DECODE(DL.DESCRIPTION,NULL,'NOT CODED',DL.DESCRIPTION) BASIS, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.VEHICLEDEFORMATION D, NASS.VEHICLECRASH VC, NASS.QUESTIONLOOKUP Q, NASS.DELTAVBASISLOOKUP DL, NASS.MV_STRIKING_STRUCK VSS, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND VC.PICKINSPECTIONTYPE IN (1,2) AND VC.ESTDELTAV=Q.OPTIONVALUE AND Q.DATAITEMID=1566 AND VC.PICKDELTAVBASIS=DL.DELTAVBASISID AND E.CASEID=VC.CASEID(+) AND E.VEHICLEID=VC.VEHICLEID(+) AND VC.CASEID=VSS.CASEID(+) AND VC.VEHICLEID=VSS.VEHICLEID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*Two CIRENIDs and one CASEID problem: ; 554075520|00-006-1-1|03-DEC-00| 554003709| 554078359| 554080162| 2| 610| | | ; 554075453|00-006-2-1|03-JAN-01| 554003709| 554078360| 554080163| 2| 610| | | (tempo-define-template "sql-bgp_impacts-all" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_IMPACTS_ALL; --CREATE OR REPLACE VIEW BGP_IMPACTS_ALL AS SELECT DISTINCT C.CIRENID, E.EVENTSEQUENCEID, TO_CHAR(D.DEFORMID) DEFORMID, E.EVENTSEQUENCENUMBER, D.RANKING, RPAD(SUBSTR(C1.DESCRIPTION,1,1),15,' ') IMPACTTYPE_GAD, DECODE(VMC.MAXCRUSH,NULL,'NONE',VMC.MAXCRUSH) MAXCRUSH, DECODE(TO_CHAR(D.DIRECTIONOFFORCE),-9999,'UNKNOWN',-8888,'NA',D.DIRECTIONOFFORCE) PDOF, C1.DESCRIPTION DEFORMATIONLOCATION, C2.DESCRIPTION LONGLATERAL, C3.DESCRIPTION VERTICALLATERAL, C4.DESCRIPTION DISTRIBUTION, C5.DESCRIPTION EXTENT, DECODE(TOTALDELTAV,NULL,'NOT CODED',TOTALDELTAV) TOTAL, DECODE(LONGDELTAV,NULL,'NOT CODED',LONGDELTAV) LONGTDL, DECODE(LATDELTAV,NULL,'NOT CODED',LATDELTAV) LATERAL, DECODE(ENERGYDELTAV,-9999,'UNKNOWN',NULL,'NOT CODED',ENERGYDELTAV) ENERGY, DECODE(IMPACTDELTAV,NULL,'NOT CODED',IMPACTDELTAV) IMPACT, DECODE(BARRIERDELTAV,NULL ,'NOT CODED',BARRIERDELTAV) BARRIER, SUBSTR(DECODE(Q.OPTIONTEXT,NULL,'NOT CODED',Q.OPTIONTEXT),1,80) DELTAV_ESTIMATED, DECODE(DL.DESCRIPTION,NULL,'NOT CODED',DL.DESCRIPTION) BASIS, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.VEHICLEDEFORMATION D, NASS.CDCLOOKUP C1, NASS.CDCLOOKUP C2, NASS.CDCLOOKUP C3, NASS.CDCLOOKUP C4, NASS.CDCLOOKUP C5, NASS.QUESTIONLOOKUP Q, NASS.DELTAVBASISLOOKUP DL, NASS.MV_MAXCRUSH VMC, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND E.CASEID=D.CASEID(+) AND E.EVENTSEQUENCEID=D.EVENTSEQUENCEID AND E.VEHICLEID=D.VEHICLEID(+) AND D.RANKING IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) AND D.CASEID=VMC.CASEID(+) AND D.VEHICLEID=VMC.VEHICLEID(+) AND D.DEFORMID=VMC.CDCID(+) AND D.DEFORMATIONLOCATION=C1.CDCID AND D.LONGLATLOCATION=C2.CDCID AND D.VERTLATLOCATION=C3.CDCID AND D.DAMAGEDISTRIBUTION=C4.CDCID AND D.DAMAGEEXTENT=C5.CDCID AND D.ESTIMATEDDELTAV=Q.OPTIONVALUE(+) AND Q.DATAITEMID=1566 AND D.PICKDELTAVBASIS=DL.DELTAVBASISID AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, E.EVENTSEQUENCEID, NULL DEFORMID, E.EVENTSEQUENCENUMBER, D.RANKING, RPAD(SUBSTR(DECODE(LOWER(GAD),'UNKNOWN','9',GAD),1,1),15,' ') IMPACTTYPE_GAD, DECODE(NULL,NULL,'NA') MAXCRUSH, DECODE(TO_CHAR(D.DIRECTIONOFFORCE),-9999,'UNKNOWN',-8888,'NA',D.DIRECTIONOFFORCE) PDOF, DECODE(NULL,NULL,'NA') DEFORMATIONLOCATION, DECODE(NULL,NULL,'NA') LONGLATERAL, DECODE(NULL,NULL,'NA') VERTICALLATERAL, DECODE(NULL,NULL,'NA') DISTRIBUTION, DECODE(NULL,NULL,'NA') EXTENT, DECODE(VC.HIGHESTDELTAV,NULL,'NOT CODED',VC.HIGHESTDELTAV) TOTAL, DECODE(VC.HIGHESTLONGDELTAV,NULL,'NOT CODED',VC.HIGHESTLONGDELTAV) LONGTDL, DECODE(VC.HIGHESTLATDELTAV,NULL,'NOT CODED',VC.HIGHESTLATDELTAV) LATERAL, DECODE(VC.HIGHESTENERGY,-9999,'UNKNOWN',NULL,'NOT CODED',VC.HIGHESTENERGY) ENERGY, DECODE(VC.HIGHESTSPEED,NULL,'NOT CODED',VC.HIGHESTSPEED) IMPACT, DECODE(VC.HIGHESTBARRIERSPEED,NULL,'NOT CODED',VC.HIGHESTBARRIERSPEED) BARRIER, SUBSTR(DECODE(Q.OPTIONTEXT,NULL,'NOT CODED',Q.OPTIONTEXT),1,80) DELTAV_ESTIMATED, DECODE(DL.DESCRIPTION,NULL,'NOT CODED',DL.DESCRIPTION) BASIS, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.VEHICLEDEFORMATION D, NASS.VEHICLECRASH VC, NASS.QUESTIONLOOKUP Q, NASS.DELTAVBASISLOOKUP DL, NASS.MV_STRIKING_STRUCK VSS, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND VC.PICKINSPECTIONTYPE IN (1,2) AND VC.ESTDELTAV=Q.OPTIONVALUE AND Q.DATAITEMID=1566 AND VC.PICKDELTAVBASIS=DL.DELTAVBASISID AND E.CASEID=VC.CASEID(+) AND E.VEHICLEID=VC.VEHICLEID(+) AND VC.CASEID=VSS.CASEID(+) AND VC.VEHICLEID=VSS.VEHICLEID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_impacts_all_frontals" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_IMPACTS_ALL_FRONTALS; --CREATE OR REPLACE VIEW BGP_IMPACTS_ALL_FRONTALS AS SELECT C.CIRENID, C.CASEID, C.VEHICLEID, E.EVENTSEQUENCEID, E.EVENTSEQUENCENUMBER, TO_CHAR(D.DEFORMID) DEFORMID, D.RANKING, RPAD(SUBSTR(C1.DESCRIPTION,1,1),15,' ') IMPACTTYPE_GAD, DECODE(VMC.MAXCRUSH,NULL,'NONE',VMC.MAXCRUSH) MAXCRUSH, DECODE(TO_CHAR(D.DIRECTIONOFFORCE),-9999,'UNKNOWN',-8888,'NA',D.DIRECTIONOFFORCE) PDOF, C1.DESCRIPTION DEFORMATIONLOCATION, C2.DESCRIPTION LONGLATERAL, C3.DESCRIPTION VERTICALLATERAL, C4.DESCRIPTION DISTRIBUTION, C5.DESCRIPTION EXTENT, DECODE(TOTALDELTAV,NULL,'NOT CODED',TOTALDELTAV) TOTAL, DECODE(LONGDELTAV,NULL,'NOT CODED',LONGDELTAV) LONGTDL, DECODE(LATDELTAV,NULL,'NOT CODED',LATDELTAV) LATERAL, DECODE(ENERGYDELTAV,-9999,'UNKNOWN',NULL,'NOT CODED',ENERGYDELTAV) ENERGY, DECODE(IMPACTDELTAV,NULL,'NOT CODED',IMPACTDELTAV) IMPACT, DECODE(BARRIERDELTAV,NULL ,'NOT CODED',BARRIERDELTAV) BARRIER, SUBSTR(DECODE(Q.OPTIONTEXT,NULL,'NOT CODED',Q.OPTIONTEXT),1,80) ESTIMATED, DECODE(DL.DESCRIPTION,NULL,'NOT CODED',DL.DESCRIPTION) BASIS, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.VEHICLEDEFORMATION D, NASS.CDCLOOKUP C1, NASS.CDCLOOKUP C2, NASS.CDCLOOKUP C3, NASS.CDCLOOKUP C4, NASS.CDCLOOKUP C5, NASS.QUESTIONLOOKUP Q, NASS.DELTAVBASISLOOKUP DL, NASS.MV_MAXCRUSH VMC, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND E.CASEID=D.CASEID(+) AND E.EVENTSEQUENCEID=D.EVENTSEQUENCEID AND E.VEHICLEID=D.VEHICLEID(+) AND D.RANKING IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) AND D.CASEID=VMC.CASEID(+) AND D.VEHICLEID=VMC.VEHICLEID(+) AND D.DEFORMID=VMC.CDCID(+) AND D.DEFORMATIONLOCATION=C1.CDCID AND D.LONGLATLOCATION=C2.CDCID AND D.VERTLATLOCATION=C3.CDCID AND D.DAMAGEDISTRIBUTION=C4.CDCID AND D.DAMAGEEXTENT=C5.CDCID AND D.ESTIMATEDDELTAV=Q.OPTIONVALUE(+) AND Q.DATAITEMID=1566 AND D.PICKDELTAVBASIS=DL.DELTAVBASISID AND ((DIRECTIONOFFORCE BETWEEN 0 AND 30) OR (DIRECTIONOFFORCE BETWEEN 330 AND 360)) AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID,PDOF, DECODE(NULL,NULL,'NA') DEFORMATIONLOCATION, DECODE(NULL,NULL,'NA') LONGLATERAL, DECODE(NULL,NULL,'NA') VERTICALLATERAL, DECODE(NULL,NULL,'NA') DISTRIBUTION, DECODE(NULL,NULL,'NA') EXTENT, DECODE(VC.HIGHESTDELTAV,NULL,'NOT CODED',VC.HIGHESTDELTAV) TOTAL, DECODE(VC.HIGHESTLONGDELTAV,NULL,'NOT CODED',VC.HIGHESTLONGDELTAV) LONGTDL, DECODE(VC.HIGHESTLATDELTAV,NULL,'NOT CODED',VC.HIGHESTLATDELTAV) LATERAL, DECODE(VC.HIGHESTENERGY,-9999,'UNKNOWN',NULL,'NOT CODED',VC.HIGHESTENERGY) ENERGY, DECODE(VC.HIGHESTSPEED,NULL,'NOT CODED',VC.HIGHESTSPEED) IMPACT, DECODE(VC.HIGHESTBARRIERSPEED,NULL,'NOT CODED',VC.HIGHESTBARRIERSPEED) BARRIER, SUBSTR(DECODE(Q.OPTIONTEXT,NULL,'NOT CODED',Q.OPTIONTEXT),1,80) ESTIMATED, DECODE(DL.DESCRIPTION,NULL,'NOT CODED',DL.DESCRIPTION) BASIS, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.EVENTS E, NASS.VEHICLECRASH VC, NASS.VEHICLEDEFORMATION D, NASS.QUESTIONLOOKUP Q, NASS.DELTAVBASISLOOKUP DL, NASS.MV_STRIKING_STRUCK VSS, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=E.CASEID(+) AND C.VEHICLEID=E.VEHICLEID(+) AND VC.PICKINSPECTIONTYPE IN (1,2) AND VC.ESTDELTAV=Q.OPTIONVALUE AND Q.DATAITEMID=1566 AND VC.PICKDELTAVBASIS=DL.DELTAVBASISID AND E.CASEID=VC.CASEID(+) AND E.VEHICLEID=VC.VEHICLEID(+) AND VC.CASEID=VSS.CASEID(+) AND VC.VEHICLEID=VSS.VEHICLEID(+) AND ((DIRECTIONOFFORCE BETWEEN 0 AND 30) OR (DIRECTIONOFFORCE BETWEEN 330 AND 360)) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_injury-contact-bodyregion-evidence-confidence" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_INJURY_CONTACT; --CREATE OR REPLACE VIEW BGP_INJURY_CONTACT AS SELECT DISTINCT C.CIRENID, I.INJURYID, I.CONTACTID, BODY.DESCRIPTION BODYREGION, AREA.DESCRIPTION AREA, COM.DESCRIPTION COMPONENT, EVD.DESCRIPTION EVIDENCE, CONF.CONFDESC CONFIDENCE_LEVEL, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.INJURY_X_CONTACT I, CIREN.CIREN_CASE C, NASS.OCCUPANTCONTACT OC, NASS.BODYREGIONLOOKUP BODY, NASS.INTERIORCOMPARTCATREF AREA, NASS.INTERIORCOMPARTREF COM, NASS.EVIDENCELOOKUP EVD, NASS.CONFIDENCELOOKUP CONF, NASS.ORGANIZATION NOR WHERE C.CIRENID=I.CIRENID(+) AND I.CONTACTID=OC.CONTACTID AND C.CASEID=OC.CASEID(+) AND C.VEHICLEID=OC.VEHICLEID(+) AND OC.AISID=BODY.BODYREGIONID(+) AND OC.PICKCOMPONENTAREA=AREA.CATEGORYID(+) AND OC.PICKCOMPONENT=COM.COMPARTMENTID(+) AND OC.PICKEVIDENCE=EVD.EVIDENCEID(+) AND OC.PICKCONFIDENCELEVEL=CONF.CONFIDENCEID(+) AND NOR.ORGID=C.CENTERID(+) ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*"INTRUSION measurements==measure deformations-on-the-interior ;*"CRUSH measurements==deformations-on-the-exterior ;*Cardinality: 1-to-many (tempo-define-template "sql-bgp_injury-intrusion-magnitude-crushdirection-seat-position" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_INJURY_INTRUSION; --CREATE OR REPLACE VIEW BGP_INJURY_INTRUSION AS SELECT DISTINCT C.CIRENID, II.INJURYID, C.CASEID, C.CIRENNUMBER, R.ROWDESC SEATROW, P.POSDESC POSITION, A.CLASSDESC AREA, T.INTRUDINGDESC COMPONENT, I.COMPARISONVALUE COMPARISON, I.INTRUDEDVALUE INTRUDED, I.INTRUSION INTRUSION, M.DESCRIPTION MAGNITUDE, CL.DIRECTDESC CRUSHDIRECTION, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, CIREN.INJURY_X_INTRUSION II, NASS.INTRUSION I, NASS.INTRUSIONROWLOOKUP R, NASS.GENPOSITIONLOOKUP P, NASS.INTRUDINGCOMPONENTCLASS A, NASS.INTRUDINGTYPE T, NASS.INTRUSIONMAGNITUDE M, NASS.CRUSHDIRECTLOOKUP CL, NASS.ORGANIZATION NOR WHERE C.CIRENID=II.CIRENID(+) AND C.CASEID=I.CASEID AND C.VEHICLEID=I.VEHICLEID AND II.INTRUSIONID=I.OCCUPANTINTRUSIONID(+) AND I.PICKLOCATIONROW=R.IROWID(+) AND I.PICKLOCATIONPOSITION=P.POSID(+) AND I.PICKINTRUDINGCOMPCLASS=A.INTRUDCLASSID(+) AND I.PICKINTRUDINGCOMPONENT=T.TYPEID(+) AND I.PICKINTRUDINGMAGNITUDE=M.MAGNITUDEID(+) AND I.PICKINTRUDINGDIRECTION=CL.CRUSHID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*1-to-many columns: ;*CHILDSEAT_MAKE ;*CHILDSEAT_MODEL ;*CHILDSEAT_TYPE ;*CHILDPOSTURE ;*ORIENTATION ;*HARNESSUSE ;*SHIELDUSE ;*TETHERUSE ;*RETATINERCLIPUSE ;*LATCHUSE ;*BELTROUTING ;***Note: BELTROUTING is messed up for one of the CIRENIDs--two twins--its wrong. ;*Cardinality: 1-to-many ;**To make this 1-to-1 just delete-tail... at CHILDSEATAVAILABLE (tempo-define-template "sql-bgp_occupant" ; template name '("--*DOCUMENTATION-BLAH --*DOCUMENTATION-BLAH --DROP VIEW BGP_OCCUPANT; --CREATE OR REPLACE VIEW BGP_OCCUPANT AS SELECT DISTINCT C.CIRENID, SUBSTR(DECODE(QSEX.OPTIONTEXT,NULL,'NOT CODED',QSEX.OPTIONTEXT),1,40) AS SEX, DECODE(PL.POSTUREDESC,NULL,'NOT CODED',PL.POSTUREDESC) AS POSTURE, SUBSTR(DECODE(QROLE.OPTIONTEXT,NULL,'NOT CODED',QROLE.OPTIONTEXT),1,40) ROLE,'ROW '||DECODE(LOWER(SEATROW),'O','CARGOAREA',NULL,'NOT CODED',SEATROW)||''||DECODE(LOWER(SEATLOCATION),'1',' LEFT','2',' MIDDLE','3',' RIGHT','4',' OTHER','O','NO SEAT',SEATLOCATION) AS SEATLOCATION, SUBSTR(DECODE(QSEATTYPE.OPTIONTEXT,NULL,'NOT CODED',QSEATTYPE.OPTIONTEXT),1,60) AS SEATTYPE, SUBSTR(DECODE(QMBTYPE.OPTIONTEXT,NULL,'NOT CODED',QMBTYPE.OPTIONTEXT),1,60) AS MANUALBELTTYPE, SUBSTR(DECODE(QMBCRASH.OPTIONTEXT,NULL,'NOT CODED',QMBCRASH.OPTIONTEXT),1,60) AS MANUALBELTCRASHUSE, SUBSTR(DECODE(QMBFAIL.OPTIONTEXT,NULL,'NOT CODED',QMBFAIL.OPTIONTEXT),1,60) AS MANUALBELTFAILURE, SUBSTR(DECODE(QMBDEVICE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVICE.OPTIONTEXT),1,60) AS BELTPOSITIONINGPRESENCE, SUBSTR(DECODE(QMBDEVUSE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVUSE.OPTIONTEXT),1,60) AS BELTPOSITIONINGUSE, SUBSTR(DECODE(QABTYPE.OPTIONTEXT,NULL,'NOT CODED',QABTYPE.OPTIONTEXT),1,100) AS AUTOMATICBELTTYPE, SUBSTR(DECODE(QABCRASH.OPTIONTEXT,NULL,'NOT CODED',QABCRASH.OPTIONTEXT),1,60) AS AUTOMATICBELTCRASHUSE, SUBSTR(DECODE(QABFAIL.OPTIONTEXT,NULL,'NOT CODED',QABFAIL.OPTIONTEXT),1,60) AS AUTOMATICBELTFAILURE, SUBSTR(AVAIL.OPTIONTEXT,1,30) AS CHILDSEATAVAILABLE, DECODE(CSMAKE.MAKEDESC,NULL,'NO CHILDSEAT',CSMAKE.MAKEDESC) AS CHILDSEAT_MAKE, DECODE(CSL.MODELDESC,NULL,'NO CHILDSEAT',CSL.MODELDESC) AS CHILDSEAT_MODEL, SUBSTR(DECODE(TYPE.OPTIONTEXT,NULL,'NO CHILDSEAT',TYPE.OPTIONTEXT),1,60) AS CHILDSEAT_TYPE, POSTURE.OPTIONTEXT, SUBSTR(DECODE(POSTURE.OPTIONTEXT,NULL,'NOT DEFINED',POSTURE.OPTIONTEXT),1,60) AS CHILDPOSTURE, DECODE(ORIENT.ORIENTDESC,NULL,'NO CHILDSEAT',ORIENT.ORIENTDESC) AS ORIENTATION, DECODE(HARNESS.USAGEDESC,NULL,'NO CHILDSEAT',HARNESS.USAGEDESC) AS HARNESSUSE, DECODE(SHIELD.USAGEDESC,NULL,'NO CHILDSEAT',SHIELD.USAGEDESC) AS SHIELDUSE, DECODE(TETHER.USAGEDESC,NULL,'NO CHILDSEAT',TETHER.USAGEDESC) AS TETHERUSE, SUBSTR(DECODE(CLIP.OPTIONTEXT,NULL,'NOT DEFINED',CLIP.OPTIONTEXT),1,60) AS RETAINERCLIPUSE, SUBSTR(DECODE(LATCH.OPTIONTEXT,NULL,'NOT DEFINED',LATCH.OPTIONTEXT),1,60) AS LATCHUSE, SUBSTR(DECODE(BELT.OPTIONTEXT,NULL,'NOT DEFINED',BELT.OPTIONTEXT),1,60) AS BELTROUTING, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.AUTOMATICBELTUSE AB, NASS.CHILDSEAT CS, NASS.CHILDSEATLOOKUP CSL, NASS.CHILDSEATMAKE CSMAKE, NASS.CHILDSEATORIENTLOOKUP ORIENT, NASS.CHILDSEATUSAGELOOKUP HARNESS, NASS.CHILDSEATUSAGELOOKUP SHIELD, NASS.CHILDSEATUSAGELOOKUP TETHER, NASS.MANUALBELTUSE MB, NASS.OCCUPANT O, NASS.POSTURELOOKUP PL, NASS.QUESTIONLOOKUP AVAIL, NASS.QUESTIONLOOKUP BELT, NASS.QUESTIONLOOKUP CLIP, NASS.QUESTIONLOOKUP LATCH, NASS.QUESTIONLOOKUP POSTURE, NASS.QUESTIONLOOKUP QABCRASH, NASS.QUESTIONLOOKUP QABFAIL, NASS.QUESTIONLOOKUP QABTYPE, NASS.QUESTIONLOOKUP QMBCRASH, NASS.QUESTIONLOOKUP QMBDEVICE, NASS.QUESTIONLOOKUP QMBDEVUSE, NASS.QUESTIONLOOKUP QMBFAIL, NASS.QUESTIONLOOKUP QMBTYPE, NASS.QUESTIONLOOKUP QROLE, NASS.QUESTIONLOOKUP QSEATTYPE, NASS.QUESTIONLOOKUP QSEX, NASS.QUESTIONLOOKUP TYPE, NASS.SEATLOC L, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEX=QSEX.OPTIONVALUE(+) AND QSEX.DATAITEMID(+)=1043 AND O.PICKPOSTURE=PL.POSTUREID(+) AND TO_CHAR(O.PICKROLE)=QROLE.OPTIONVALUE(+) AND QROLE.DATAITEMID(+)=1046 AND O.CASEID=L.CASEID(+) AND O.VEHICLEID=L.VEHICLEID(+) AND O.SEATLOCID=L.SEATLOCID(+)AND TO_CHAR(L.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) AND QSEATTYPE.DATAITEMID(+)=1280 AND O.CASEID=MB.CASEID(+) AND O.VEHICLEID=MB.VEHICLEID(+) AND O.OCCUPANTID=MB.OCCUPANTID(+) AND QMBCRASH.OPTIONVALUE(+)=TO_CHAR(MB.MANUALCRASHUSE) AND QMBCRASH.DATAITEMID(+)=1190 AND QMBTYPE.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTTYPEUSED) AND QMBTYPE.DATAITEMID(+)=1188 AND QMBFAIL.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTFAILURE) AND QMBFAIL.DATAITEMID(+)=1192 AND QMBDEVICE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEID) AND QMBDEVICE.DATAITEMID(+)=3786 AND QMBDEVUSE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEUSEID) AND QMBDEVUSE.DATAITEMID(+)=3787 AND O.CASEID=AB.CASEID(+) AND O.VEHICLEID=AB.VEHICLEID(+) AND O.OCCUPANTID=AB.OCCUPANTID(+) AND QABCRASH.OPTIONVALUE(+)=TO_CHAR(AB.AUTOCRASHUSE) AND QABCRASH.DATAITEMID(+)=1199 AND QABTYPE.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTTYPEUSED) AND QABTYPE.DATAITEMID(+)=1197 AND QABFAIL.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTFAILURE) AND QABFAIL.DATAITEMID(+)=1200 AND O.CHILDSEATAVAILABLE=AVAIL.OPTIONVALUE(+) AND AVAIL.DATAITEMID(+)=1790 AND O.CHILDSEATAVAILABLE=1 AND O.CASEID=CS.CASEID(+) AND O.VEHICLEID=CS.VEHICLEID(+) AND CS.CHILDSEATMANID=CSMAKE.MAKEID(+) AND CS.PICKMODELID=CSL.MODELID(+) AND TO_CHAR(CSL.SEATTYPEID)=TYPE.OPTIONVALUE(+) AND TYPE.DATAITEMID(+)=3733 AND TO_CHAR(CS.POSTUREINUSEID)=POSTURE.OPTIONVALUE(+) AND POSTURE.DATAITEMID(+)=3748 AND CS.PICKORIENTATION=ORIENT.ORIENTID(+) AND CS.PICKHARNESSUSAGE=HARNESS.USAGEID(+) AND CS.PICKSHIELDUSAGE=SHIELD.USAGEID(+) AND CS.PICKTETHERUSAGE=TETHER.USAGEID(+) AND TO_CHAR(CS.RETAINERCLIPUSEID)=CLIP.OPTIONVALUE(+) AND CLIP.DATAITEMID(+)=3744 AND TO_CHAR(CS.LATCHUSEID)=LATCH.OPTIONVALUE(+) AND LATCH.DATAITEMID(+)=3740 AND TO_CHAR(CS.BELTROUTING)=BELT.OPTIONVALUE(+) AND BELT.DATAITEMID(+)=3782 AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, SUBSTR(DECODE(QSEX.OPTIONTEXT,NULL,'NOT CODED',QSEX.OPTIONTEXT),1,40) AS SEX, DECODE(PL.POSTUREDESC,NULL,'NOT CODED',PL.POSTUREDESC) AS POSTURE, SUBSTR(DECODE(QROLE.OPTIONTEXT,NULL,'NOT CODED',QROLE.OPTIONTEXT),1,40) ROLE,'ROW '||DECODE(LOWER(SEATROW),'O','CARGOAREA',NULL,'NOT CODED',SEATROW)||''||DECODE(LOWER(SEATLOCATION),'1',' LEFT','2',' MIDDLE','3',' RIGHT','4',' OTHER','O','NO SEAT',SEATLOCATION) AS SEATLOCATION, SUBSTR(DECODE(QSEATTYPE.OPTIONTEXT,NULL,'NOT CODED',QSEATTYPE.OPTIONTEXT),1,60) AS SEATTYPE, SUBSTR(DECODE(QMBTYPE.OPTIONTEXT,NULL,'NOT CODED',QMBTYPE.OPTIONTEXT),1,60) AS MANUALBELTTYPE, SUBSTR(DECODE(QMBCRASH.OPTIONTEXT,NULL,'NOT CODED',QMBCRASH.OPTIONTEXT),1,60) AS MANUALBELTCRASHUSE, SUBSTR(DECODE(QMBFAIL.OPTIONTEXT,NULL,'NOT CODED',QMBFAIL.OPTIONTEXT),1,60) AS MANUALBELTFAILURE, SUBSTR(DECODE(QMBDEVICE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVICE.OPTIONTEXT),1,60) AS BELTPOSITIONINGPRESENCE, SUBSTR(DECODE(QMBDEVUSE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVUSE.OPTIONTEXT),1,60) AS BELTPOSITIONINGUSE, SUBSTR(DECODE(QABTYPE.OPTIONTEXT,NULL,'NOT CODED',QABTYPE.OPTIONTEXT),1,100) AS AUTOMATICBELTTYPE, SUBSTR(DECODE(QABCRASH.OPTIONTEXT,NULL,'NOT CODED',QABCRASH.OPTIONTEXT),1,60) AS AUTOMATICBELTCRASHUSE, SUBSTR(DECODE(QABFAIL.OPTIONTEXT,NULL,'NOT CODED',QABFAIL.OPTIONTEXT),1,60) AS AUTOMATICBELTFAILURE, SUBSTR(AVAIL.OPTIONTEXT,1,30) AS CHILDSEATAVAILABLE, DECODE(CSMAKE.MAKEDESC,NULL,'NO CHILDSEAT',CSMAKE.MAKEDESC) AS CHILDSEAT_MAKE, DECODE(CSL.MODELDESC,NULL,'NO CHILDSEAT',CSL.MODELDESC) AS CHILDSEAT_MODEL, SUBSTR(DECODE(TYPE.OPTIONTEXT,NULL,'NO CHILDSEAT',TYPE.OPTIONTEXT),1,60) AS CHILDSEAT_TYPE, POSTURE.OPTIONTEXT, SUBSTR(DECODE(POSTURE.OPTIONTEXT,NULL,'NOT DEFINED',POSTURE.OPTIONTEXT),1,60) AS CHILDPOSTURE, DECODE(ORIENT.ORIENTDESC,NULL,'NO CHILDSEAT',ORIENT.ORIENTDESC) AS ORIENTATION, DECODE(HARNESS.USAGEDESC,NULL,'NO CHILDSEAT',HARNESS.USAGEDESC) AS HARNESSUSE, DECODE(SHIELD.USAGEDESC,NULL,'NO CHILDSEAT',SHIELD.USAGEDESC) AS SHIELDUSE, DECODE(TETHER.USAGEDESC,NULL,'NO CHILDSEAT',TETHER.USAGEDESC) AS TETHERUSE, SUBSTR(DECODE(CLIP.OPTIONTEXT,NULL,'NOT DEFINED',CLIP.OPTIONTEXT),1,60) AS RETAINERCLIPUSE, SUBSTR(DECODE(LATCH.OPTIONTEXT,NULL,'NOT DEFINED',LATCH.OPTIONTEXT),1,60) AS LATCHUSE, SUBSTR(DECODE(BELT.OPTIONTEXT,NULL,'NOT DEFINED',BELT.OPTIONTEXT),1,60) AS BELTROUTING, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.AUTOMATICBELTUSE AB, NASS.CHILDSEAT CS, NASS.CHILDSEATLOOKUP CSL, NASS.CHILDSEATMAKE CSMAKE, NASS.CHILDSEATORIENTLOOKUP ORIENT, NASS.CHILDSEATUSAGELOOKUP HARNESS, NASS.CHILDSEATUSAGELOOKUP SHIELD, NASS.CHILDSEATUSAGELOOKUP TETHER, NASS.MANUALBELTUSE MB, NASS.OCCUPANT O, NASS.POSTURELOOKUP PL, NASS.QUESTIONLOOKUP AVAIL, NASS.QUESTIONLOOKUP BELT, NASS.QUESTIONLOOKUP CLIP, NASS.QUESTIONLOOKUP LATCH, NASS.QUESTIONLOOKUP POSTURE, NASS.QUESTIONLOOKUP QABCRASH, NASS.QUESTIONLOOKUP QABFAIL, NASS.QUESTIONLOOKUP QABTYPE, NASS.QUESTIONLOOKUP QMBCRASH, NASS.QUESTIONLOOKUP QMBDEVICE, NASS.QUESTIONLOOKUP QMBDEVUSE, NASS.QUESTIONLOOKUP QMBFAIL, NASS.QUESTIONLOOKUP QMBTYPE, NASS.QUESTIONLOOKUP QROLE, NASS.QUESTIONLOOKUP QSEATTYPE, NASS.QUESTIONLOOKUP QSEX, NASS.QUESTIONLOOKUP TYPE, NASS.SEATLOC L, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND TO_CHAR(C.CRASHDATE,'YYYY')<'2010' AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEX=QSEX.OPTIONVALUE(+) AND QSEX.DATAITEMID(+)=1043 AND O.PICKPOSTURE=PL.POSTUREID(+) AND TO_CHAR(O.PICKROLE)=QROLE.OPTIONVALUE(+) AND QROLE.DATAITEMID(+)=1046 AND O.CASEID=L.CASEID(+) AND O.VEHICLEID=L.VEHICLEID(+) AND O.SEATLOCID=L.SEATLOCID(+)AND TO_CHAR(L.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) AND QSEATTYPE.DATAITEMID(+)=1280 AND O.CASEID=MB.CASEID(+) AND O.VEHICLEID=MB.VEHICLEID(+) AND O.OCCUPANTID=MB.OCCUPANTID(+) AND QMBCRASH.OPTIONVALUE(+)=TO_CHAR(MB.MANUALCRASHUSE) AND QMBCRASH.DATAITEMID(+)=1190 AND QMBTYPE.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTTYPEUSED) AND QMBTYPE.DATAITEMID(+)=1188 AND QMBFAIL.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTFAILURE) AND QMBFAIL.DATAITEMID(+)=1192 AND QMBDEVICE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEID) AND QMBDEVICE.DATAITEMID(+)=3786 AND QMBDEVUSE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEUSEID) AND QMBDEVUSE.DATAITEMID(+)=3787 AND O.CASEID=AB.CASEID(+) AND O.VEHICLEID=AB.VEHICLEID(+) AND O.OCCUPANTID=AB.OCCUPANTID(+) AND QABCRASH.OPTIONVALUE(+)=TO_CHAR(AB.AUTOCRASHUSE) AND QABCRASH.DATAITEMID(+)=1199 AND QABTYPE.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTTYPEUSED) AND QABTYPE.DATAITEMID(+)=1197 AND QABFAIL.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTFAILURE) AND QABFAIL.DATAITEMID(+)=1200 AND O.CHILDSEATAVAILABLE=AVAIL.OPTIONVALUE(+) AND AVAIL.DATAITEMID(+)=1790 AND O.CHILDSEATAVAILABLE=2 AND O.CASEID=CS.CASEID(+) AND O.VEHICLEID=CS.VEHICLEID(+) AND O.SEATLOCID=CS.SEATLOCID(+) AND CS.CHILDSEATMANID=CSMAKE.MAKEID(+) AND CS.PICKMODELID=CSL.MODELID(+) AND TO_CHAR(CSL.SEATTYPEID)=TYPE.OPTIONVALUE(+) AND TYPE.DATAITEMID(+)=3733 AND TO_CHAR(CS.POSTUREINUSEID)=POSTURE.OPTIONVALUE(+) AND POSTURE.DATAITEMID(+)=3748 AND CS.PICKORIENTATION=ORIENT.ORIENTID(+) AND CS.PICKHARNESSUSAGE=HARNESS.USAGEID(+) AND CS.PICKSHIELDUSAGE=SHIELD.USAGEID(+) AND CS.PICKTETHERUSAGE=TETHER.USAGEID(+) AND TO_CHAR(CS.RETAINERCLIPUSEID)=CLIP.OPTIONVALUE(+) AND CLIP.DATAITEMID(+)=3744 AND TO_CHAR(CS.LATCHUSEID)=LATCH.OPTIONVALUE(+) AND LATCH.DATAITEMID(+)=3740 AND TO_CHAR(CS.BELTROUTING)=BELT.OPTIONVALUE(+) AND BELT.DATAITEMID(+)=3782 AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, SUBSTR(DECODE(QSEX.OPTIONTEXT,NULL,'NOT CODED',QSEX.OPTIONTEXT),1,40) AS SEX, DECODE(PL.POSTUREDESC,NULL,'NOT CODED',PL.POSTUREDESC) AS POSTURE, SUBSTR(DECODE(QROLE.OPTIONTEXT,NULL,'NOT CODED',QROLE.OPTIONTEXT),1,40) ROLE,'ROW '||DECODE(LOWER(SEATROW),'O','CARGOAREA',NULL,'NOT CODED',SEATROW)||''||DECODE(LOWER(SEATLOCATION),'1',' LEFT','2',' MIDDLE','3',' RIGHT','4',' OTHER','O','NO SEAT',SEATLOCATION) AS SEATLOCATION, SUBSTR(DECODE(QSEATTYPE.OPTIONTEXT,NULL,'NOT CODED',QSEATTYPE.OPTIONTEXT),1,60) AS SEATTYPE, SUBSTR(DECODE(QMBTYPE.OPTIONTEXT,NULL,'NOT CODED',QMBTYPE.OPTIONTEXT),1,60) AS MANUALBELTTYPE, SUBSTR(DECODE(QMBCRASH.OPTIONTEXT,NULL,'NOT CODED',QMBCRASH.OPTIONTEXT),1,60) AS MANUALBELTCRASHUSE, SUBSTR(DECODE(QMBFAIL.OPTIONTEXT,NULL,'NOT CODED',QMBFAIL.OPTIONTEXT),1,60) AS MANUALBELTFAILURE, SUBSTR(DECODE(QMBDEVICE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVICE.OPTIONTEXT),1,60) AS BELTPOSITIONINGPRESENCE, SUBSTR(DECODE(QMBDEVUSE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVUSE.OPTIONTEXT),1,60) AS BELTPOSITIONINGUSE, SUBSTR(DECODE(QABTYPE.OPTIONTEXT,NULL,'NOT CODED',QABTYPE.OPTIONTEXT),1,100) AS AUTOMATICBELTTYPE, SUBSTR(DECODE(QABCRASH.OPTIONTEXT,NULL,'NOT CODED',QABCRASH.OPTIONTEXT),1,60) AS AUTOMATICBELTCRASHUSE, SUBSTR(DECODE(QABFAIL.OPTIONTEXT,NULL,'NOT CODED',QABFAIL.OPTIONTEXT),1,60) AS AUTOMATICBELTFAILURE, SUBSTR(AVAIL.OPTIONTEXT,1,30) AS CHILDSEATAVAILABLE, DECODE(CSMAKE.MAKEDESC,NULL,'NO CHILDSEAT',CSMAKE.MAKEDESC) AS CHILDSEAT_MAKE, DECODE(CSL.MODELDESC,NULL,'NO CHILDSEAT',CSL.MODELDESC) AS CHILDSEAT_MODEL, SUBSTR(DECODE(TYPE.OPTIONTEXT,NULL,'NO CHILDSEAT',TYPE.OPTIONTEXT),1,60) AS CHILDSEAT_TYPE, POSTURE.OPTIONTEXT, SUBSTR(DECODE(POSTURE.OPTIONTEXT,NULL,'NOT DEFINED',POSTURE.OPTIONTEXT),1,60) AS CHILDPOSTURE, DECODE(ORIENT.ORIENTDESC,NULL,'NO CHILDSEAT',ORIENT.ORIENTDESC) AS ORIENTATION, DECODE(HARNESS.USAGEDESC,NULL,'NO CHILDSEAT',HARNESS.USAGEDESC) AS HARNESSUSE, DECODE(SHIELD.USAGEDESC,NULL,'NO CHILDSEAT',SHIELD.USAGEDESC) AS SHIELDUSE, DECODE(TETHER.USAGEDESC,NULL,'NO CHILDSEAT',TETHER.USAGEDESC) AS TETHERUSE, SUBSTR(DECODE(CLIP.OPTIONTEXT,NULL,'NOT DEFINED',CLIP.OPTIONTEXT),1,60) AS RETAINERCLIPUSE, SUBSTR(DECODE(LATCH.OPTIONTEXT,NULL,'NOT DEFINED',LATCH.OPTIONTEXT),1,60) AS LATCHUSE, SUBSTR(DECODE(BELT.OPTIONTEXT,NULL,'NOT DEFINED',BELT.OPTIONTEXT),1,60) AS BELTROUTING, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.AUTOMATICBELTUSE AB, NASS.CHILDSEAT CS, NASS.CHILDSEATLOOKUP CSL, NASS.CHILDSEATMAKE CSMAKE, NASS.CHILDSEATUSAGELOOKUP HARNESS, NASS.CHILDSEATORIENTLOOKUP ORIENT, NASS.CHILDSEATUSAGELOOKUP SHIELD, NASS.CHILDSEATUSAGELOOKUP TETHER, NASS.MANUALBELTUSE MB, NASS.OCCUPANT O, NASS.POSTURELOOKUP PL, NASS.QUESTIONLOOKUP AVAIL, NASS.QUESTIONLOOKUP BELT, NASS.QUESTIONLOOKUP CLIP, NASS.QUESTIONLOOKUP HARNESS, NASS.QUESTIONLOOKUP LATCH, NASS.QUESTIONLOOKUP POSTURE, NASS.QUESTIONLOOKUP QABCRASH, NASS.QUESTIONLOOKUP QABFAIL, NASS.QUESTIONLOOKUP QABTYPE, NASS.QUESTIONLOOKUP QMBCRASH, NASS.QUESTIONLOOKUP QMBDEVICE, NASS.QUESTIONLOOKUP QMBDEVUSE, NASS.QUESTIONLOOKUP QMBFAIL, NASS.QUESTIONLOOKUP QMBTYPE, NASS.QUESTIONLOOKUP QROLE, NASS.QUESTIONLOOKUP QSEATTYPE, NASS.QUESTIONLOOKUP QSEX, NASS.QUESTIONLOOKUP TETHER, NASS.QUESTIONLOOKUP TYPE, NASS.SEATLOC L, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND TO_CHAR(C.CRASHDATE,'YYYY')>='2010' AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEX=QSEX.OPTIONVALUE(+) AND QSEX.DATAITEMID(+)=1043 AND O.PICKPOSTURE=PL.POSTUREID(+) AND TO_CHAR(O.PICKROLE)=QROLE.OPTIONVALUE(+) AND QROLE.DATAITEMID(+)=1046 AND O.CASEID=L.CASEID(+) AND O.VEHICLEID=L.VEHICLEID(+) AND O.SEATLOCID=L.SEATLOCID(+)AND TO_CHAR(L.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) AND QSEATTYPE.DATAITEMID(+)=1280 AND O.CASEID=MB.CASEID(+) AND O.VEHICLEID=MB.VEHICLEID(+) AND O.OCCUPANTID=MB.OCCUPANTID(+) AND QMBCRASH.OPTIONVALUE(+)=TO_CHAR(MB.MANUALCRASHUSE) AND QMBCRASH.DATAITEMID(+)=1190 AND QMBTYPE.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTTYPEUSED) AND QMBTYPE.DATAITEMID(+)=1188 AND QMBFAIL.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTFAILURE) AND QMBFAIL.DATAITEMID(+)=1192 AND QMBDEVICE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEID) AND QMBDEVICE.DATAITEMID(+)=3786 AND QMBDEVUSE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEUSEID) AND QMBDEVUSE.DATAITEMID(+)=3787 AND O.CASEID=AB.CASEID(+) AND O.VEHICLEID=AB.VEHICLEID(+) AND O.OCCUPANTID=AB.OCCUPANTID(+) AND QABCRASH.OPTIONVALUE(+)=TO_CHAR(AB.AUTOCRASHUSE) AND QABCRASH.DATAITEMID(+)=1199 AND QABTYPE.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTTYPEUSED) AND QABTYPE.DATAITEMID(+)=1197 AND QABFAIL.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTFAILURE) AND QABFAIL.DATAITEMID(+)=1200 AND O.CHILDSEATAVAILABLE=AVAIL.OPTIONVALUE(+) AND AVAIL.DATAITEMID(+)=1790 AND O.CHILDSEATAVAILABLE=2 AND O.CASEID=CS.CASEID(+) AND O.VEHICLEID=CS.VEHICLEID(+) AND O.SEATLOCID=CS.SEATLOCID(+) AND CS.CHILDSEATMAKEID=CSMAKE.MAKEID(+) AND CS.PICKMODELID=CSL.MODELID(+) AND TO_CHAR(CSL.SEATTYPEID)=TYPE.OPTIONVALUE(+) AND TYPE.DATAITEMID(+)=3733 AND TO_CHAR(CS.POSTUREINUSEID)=POSTURE.OPTIONVALUE(+) AND POSTURE.DATAITEMID(+)=3748 AND CS.PICKORIENTATION=ORIENT.ORIENTID(+) AND CS.PICKHARNESSUSAGE=HARNESS.OPTIONVALUE(+) AND HARNESS.DATAITEMID(+)=3742 AND CS.PICKSHIELDUSAGE=SHIELD.USAGEID(+) AND CS.PICKTETHERUSAGE=TETHER.OPTIONVALUE(+) AND TETHER.DATAITEMID(+)=3741 AND TO_CHAR(CS.RETAINERCLIPUSEID)=CLIP.OPTIONVALUE(+) AND CLIP.DATAITEMID(+)=3744 AND TO_CHAR(CS.LATCHUSEID)=LATCH.OPTIONVALUE(+) AND LATCH.DATAITEMID(+)=3740 AND TO_CHAR(CS.BELTROUTING)=BELT.OPTIONVALUE(+) AND BELT.DATAITEMID(+)=3782 AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, SUBSTR(DECODE(QSEX.OPTIONTEXT,NULL,'NOT CODED',QSEX.OPTIONTEXT),1,40) AS SEX, DECODE(PL.POSTUREDESC,NULL,'NOT CODED',PL.POSTUREDESC) AS POSTURE, SUBSTR(DECODE(QROLE.OPTIONTEXT,NULL,'NOT CODED',QROLE.OPTIONTEXT),1,40) ROLE,'ROW '||DECODE(LOWER(SEATROW),'O','CARGOAREA',NULL,'NOT CODED',SEATROW)||''||DECODE(LOWER(SEATLOCATION),'1',' LEFT','2',' MIDDLE','3',' RIGHT','4',' OTHER','O','NO SEAT',SEATLOCATION) AS SEATLOCATION, SUBSTR(DECODE(QSEATTYPE.OPTIONTEXT,NULL,'NOT CODED',QSEATTYPE.OPTIONTEXT),1,60) AS SEATTYPE, SUBSTR(DECODE(QMBTYPE.OPTIONTEXT,NULL,'NOT CODED',QMBTYPE.OPTIONTEXT),1,60) AS MANUALBELTTYPE, SUBSTR(DECODE(QMBCRASH.OPTIONTEXT,NULL,'NOT CODED',QMBCRASH.OPTIONTEXT),1,60) AS MANUALBELTCRASHUSE, SUBSTR(DECODE(QMBFAIL.OPTIONTEXT,NULL,'NOT CODED',QMBFAIL.OPTIONTEXT),1,60) AS MANUALBELTFAILURE, SUBSTR(DECODE(QMBDEVICE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVICE.OPTIONTEXT),1,60) AS BELTPOSITIONINGPRESENCE, SUBSTR(DECODE(QMBDEVUSE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVUSE.OPTIONTEXT),1,60) AS BELTPOSITIONINGUSE, SUBSTR(DECODE(QABTYPE.OPTIONTEXT,NULL,'NOT CODED',QABTYPE.OPTIONTEXT),1,100) AS AUTOMATICBELTTYPE, SUBSTR(DECODE(QABCRASH.OPTIONTEXT,NULL,'NOT CODED',QABCRASH.OPTIONTEXT),1,60) AS AUTOMATICBELTCRASHUSE, SUBSTR(DECODE(QABFAIL.OPTIONTEXT,NULL,'NOT CODED',QABFAIL.OPTIONTEXT),1,60) AS AUTOMATICBELTFAILURE, SUBSTR(AVAIL.OPTIONTEXT,1,30) AS CHILDSEATAVAILABLE, DECODE(CSMAKE.MAKEDESC,NULL,'NO CHILDSEAT',CSMAKE.MAKEDESC) AS CHILDSEAT_MAKE, DECODE(CSL.MODELDESC,NULL,'NO CHILDSEAT',CSL.MODELDESC) AS CHILDSEAT_MODEL, SUBSTR(DECODE(TYPE.OPTIONTEXT,NULL,'NO CHILDSEAT',TYPE.OPTIONTEXT),1,60) AS CHILDSEAT_TYPE, POSTURE.OPTIONTEXT, SUBSTR(DECODE(POSTURE.OPTIONTEXT,NULL,'NOT DEFINED',POSTURE.OPTIONTEXT),1,60) AS CHILDPOSTURE, DECODE(ORIENT.ORIENTDESC,NULL,'NO CHILDSEAT',ORIENT.ORIENTDESC) AS ORIENTATION, DECODE(HARNESS.USAGEDESC,NULL,'NO CHILDSEAT',HARNESS.USAGEDESC) AS HARNESSUSE, DECODE(SHIELD.USAGEDESC,NULL,'NO CHILDSEAT',SHIELD.USAGEDESC) AS SHIELDUSE, DECODE(TETHER.USAGEDESC,NULL,'NO CHILDSEAT',TETHER.USAGEDESC) AS TETHERUSE, SUBSTR(DECODE(CLIP.OPTIONTEXT,NULL,'NOT DEFINED',CLIP.OPTIONTEXT),1,60) AS RETAINERCLIPUSE, SUBSTR(DECODE(LATCH.OPTIONTEXT,NULL,'NOT DEFINED',LATCH.OPTIONTEXT),1,60) AS LATCHUSE, SUBSTR(DECODE(BELT.OPTIONTEXT,NULL,'NOT DEFINED',BELT.OPTIONTEXT),1,60) AS BELTROUTING, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.AUTOMATICBELTUSE AB, NASS.CHILDSEAT CS, NASS.CHILDSEATLOOKUP CSL, NASS.CHILDSEATMAKE CSMAKE, NASS.CHILDSEATORIENTLOOKUP ORIENT, NASS.CHILDSEATUSAGELOOKUP HARNESS, NASS.CHILDSEATUSAGELOOKUP SHIELD, NASS.CHILDSEATUSAGELOOKUP TETHER, NASS.MANUALBELTUSE MB, NASS.OCCUPANT O, NASS.POSTURELOOKUP PL, NASS.QUESTIONLOOKUP AVAIL, NASS.QUESTIONLOOKUP BELT, NASS.QUESTIONLOOKUP CLIP, NASS.QUESTIONLOOKUP LATCH, NASS.QUESTIONLOOKUP POSTURE, NASS.QUESTIONLOOKUP QABCRASH, NASS.QUESTIONLOOKUP QABFAIL, NASS.QUESTIONLOOKUP QABTYPE, NASS.QUESTIONLOOKUP QMBCRASH, NASS.QUESTIONLOOKUP QMBDEVICE, NASS.QUESTIONLOOKUP QMBDEVUSE, NASS.QUESTIONLOOKUP QMBFAIL, NASS.QUESTIONLOOKUP QMBTYPE, NASS.QUESTIONLOOKUP QROLE, NASS.QUESTIONLOOKUP QSEATTYPE, NASS.QUESTIONLOOKUP QSEX, NASS.QUESTIONLOOKUP TYPE, NASS.SEATLOC L, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEX=QSEX.OPTIONVALUE(+) AND QSEX.DATAITEMID(+)=1043 AND O.PICKPOSTURE=PL.POSTUREID(+) AND TO_CHAR(O.PICKROLE)=QROLE.OPTIONVALUE(+) AND QROLE.DATAITEMID(+)=1046 AND O.CASEID=L.CASEID(+) AND O.VEHICLEID=L.VEHICLEID(+) AND O.SEATLOCID=L.SEATLOCID(+)AND TO_CHAR(L.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) AND QSEATTYPE.DATAITEMID(+)=1280 AND O.CASEID=MB.CASEID(+) AND O.VEHICLEID=MB.VEHICLEID(+) AND O.OCCUPANTID=MB.OCCUPANTID(+) AND QMBCRASH.OPTIONVALUE(+)=TO_CHAR(MB.MANUALCRASHUSE) AND QMBCRASH.DATAITEMID(+)=1190 AND QMBTYPE.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTTYPEUSED) AND QMBTYPE.DATAITEMID(+)=1188 AND QMBFAIL.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTFAILURE) AND QMBFAIL.DATAITEMID(+)=1192 AND QMBDEVICE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEID) AND QMBDEVICE.DATAITEMID(+)=3786 AND QMBDEVUSE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEUSEID) AND QMBDEVUSE.DATAITEMID(+)=3787 AND O.CASEID=AB.CASEID(+) AND O.VEHICLEID=AB.VEHICLEID(+) AND O.OCCUPANTID=AB.OCCUPANTID(+) AND QABCRASH.OPTIONVALUE(+)=TO_CHAR(AB.AUTOCRASHUSE) AND QABCRASH.DATAITEMID(+)=1199 AND QABTYPE.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTTYPEUSED) AND QABTYPE.DATAITEMID(+)=1197 AND QABFAIL.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTFAILURE) AND QABFAIL.DATAITEMID(+)=1200 AND O.CHILDSEATAVAILABLE=AVAIL.OPTIONVALUE(+) AND AVAIL.DATAITEMID(+)=1790 AND O.CHILDSEATAVAILABLE=3 AND O.CASEID=CS.CASEID(+) AND O.VEHICLEID=CS.VEHICLEID(+) AND O.OCCUPANTID=CS.OCCUPANTID(+) AND CS.CHILDSEATMANID=CSMAKE.MAKEID(+) AND CS.PICKMODELID=CSL.MODELID(+) AND TO_CHAR(CSL.SEATTYPEID)=TYPE.OPTIONVALUE(+) AND TYPE.DATAITEMID(+)=3733 AND TO_CHAR(CS.POSTUREINUSEID)=POSTURE.OPTIONVALUE(+) AND POSTURE.DATAITEMID(+)=3748 AND CS.PICKORIENTATION=ORIENT.ORIENTID(+) AND CS.PICKHARNESSUSAGE=HARNESS.USAGEID(+) AND CS.PICKSHIELDUSAGE=SHIELD.USAGEID(+) AND CS.PICKTETHERUSAGE=TETHER.USAGEID(+) AND TO_CHAR(CS.RETAINERCLIPUSEID)=CLIP.OPTIONVALUE(+) AND CLIP.DATAITEMID(+)=3744 AND TO_CHAR(CS.LATCHUSEID)=LATCH.OPTIONVALUE(+) AND LATCH.DATAITEMID(+)=3740 AND TO_CHAR(CS.BELTROUTING)=BELT.OPTIONVALUE(+) AND BELT.DATAITEMID(+)=3782 AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, SUBSTR(DECODE(QSEX.OPTIONTEXT,NULL,'NOT CODED',QSEX.OPTIONTEXT),1,40) AS SEX, DECODE(PL.POSTUREDESC,NULL,'NOT CODED',PL.POSTUREDESC) AS POSTURE, SUBSTR(DECODE(QROLE.OPTIONTEXT,NULL,'NOT CODED',QROLE.OPTIONTEXT),1,40) ROLE,'ROW '||DECODE(LOWER(SEATROW),'O','CARGOAREA',NULL,'NOT CODED',SEATROW)||''||DECODE(LOWER(SEATLOCATION),'1',' LEFT','2',' MIDDLE','3',' RIGHT','4',' OTHER','O','NO SEAT',SEATLOCATION) AS SEATLOCATION, SUBSTR(DECODE(QSEATTYPE.OPTIONTEXT,NULL,'NOT CODED',QSEATTYPE.OPTIONTEXT),1,60) AS SEATTYPE, SUBSTR(DECODE(QMBTYPE.OPTIONTEXT,NULL,'NOT CODED',QMBTYPE.OPTIONTEXT),1,60) AS MANUALBELTTYPE, SUBSTR(DECODE(QMBCRASH.OPTIONTEXT,NULL,'NOT CODED',QMBCRASH.OPTIONTEXT),1,60) AS MANUALBELTCRASHUSE, SUBSTR(DECODE(QMBFAIL.OPTIONTEXT,NULL,'NOT CODED',QMBFAIL.OPTIONTEXT),1,60) AS MANUALBELTFAILURE, SUBSTR(DECODE(QMBDEVICE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVICE.OPTIONTEXT),1,60) AS BELTPOSITIONINGPRESENCE, SUBSTR(DECODE(QMBDEVUSE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVUSE.OPTIONTEXT),1,60) AS BELTPOSITIONINGUSE, SUBSTR(DECODE(QABTYPE.OPTIONTEXT,NULL,'NOT CODED',QABTYPE.OPTIONTEXT),1,100) AS AUTOMATICBELTTYPE, SUBSTR(DECODE(QABCRASH.OPTIONTEXT,NULL,'NOT CODED',QABCRASH.OPTIONTEXT),1,60) AS AUTOMATICBELTCRASHUSE, SUBSTR(DECODE(QABFAIL.OPTIONTEXT,NULL,'NOT CODED',QABFAIL.OPTIONTEXT),1,60) AS AUTOMATICBELTFAILURE, SUBSTR(AVAIL.OPTIONTEXT,1,30) AS CHILDSEATAVAILABLE, DECODE(CSMAKE.MAKEDESC,NULL,'NO CHILDSEAT',CSMAKE.MAKEDESC) AS CHILDSEAT_MAKE, DECODE(CSL.MODELDESC,NULL,'NO CHILDSEAT',CSL.MODELDESC) AS CHILDSEAT_MODEL, SUBSTR(DECODE(TYPE.OPTIONTEXT,NULL,'NO CHILDSEAT',TYPE.OPTIONTEXT),1,60) AS CHILDSEAT_TYPE, POSTURE.OPTIONTEXT, SUBSTR(DECODE(POSTURE.OPTIONTEXT,NULL,'NOT DEFINED',POSTURE.OPTIONTEXT),1,60) AS CHILDPOSTURE, DECODE(ORIENT.ORIENTDESC,NULL,'NO CHILDSEAT',ORIENT.ORIENTDESC) AS ORIENTATION, DECODE(HARNESS.USAGEDESC,NULL,'NO CHILDSEAT',HARNESS.USAGEDESC) AS HARNESSUSE, DECODE(SHIELD.USAGEDESC,NULL,'NO CHILDSEAT',SHIELD.USAGEDESC) AS SHIELDUSE, DECODE(TETHER.USAGEDESC,NULL,'NO CHILDSEAT',TETHER.USAGEDESC) AS TETHERUSE, SUBSTR(DECODE(CLIP.OPTIONTEXT,NULL,'NOT DEFINED',CLIP.OPTIONTEXT),1,60) AS RETAINERCLIPUSE, SUBSTR(DECODE(LATCH.OPTIONTEXT,NULL,'NOT DEFINED',LATCH.OPTIONTEXT),1,60) AS LATCHUSE, SUBSTR(DECODE(BELT.OPTIONTEXT,NULL,'NOT DEFINED',BELT.OPTIONTEXT),1,60) AS BELTROUTING, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.AUTOMATICBELTUSE AB, NASS.CHILDSEAT CS, NASS.CHILDSEATLOOKUP CSL, NASS.CHILDSEATMAKE CSMAKE, NASS.CHILDSEATORIENTLOOKUP ORIENT, NASS.CHILDSEATUSAGELOOKUP HARNESS, NASS.CHILDSEATUSAGELOOKUP SHIELD, NASS.CHILDSEATUSAGELOOKUP TETHER, NASS.MANUALBELTUSE MB, NASS.OCCUPANT O, NASS.POSTURELOOKUP PL, NASS.QUESTIONLOOKUP AVAIL, NASS.QUESTIONLOOKUP BELT, NASS.QUESTIONLOOKUP CLIP, NASS.QUESTIONLOOKUP LATCH, NASS.QUESTIONLOOKUP POSTURE, NASS.QUESTIONLOOKUP QABCRASH, NASS.QUESTIONLOOKUP QABFAIL, NASS.QUESTIONLOOKUP QABTYPE, NASS.QUESTIONLOOKUP QMBCRASH, NASS.QUESTIONLOOKUP QMBDEVICE, NASS.QUESTIONLOOKUP QMBDEVUSE, NASS.QUESTIONLOOKUP QMBFAIL, NASS.QUESTIONLOOKUP QMBTYPE, NASS.QUESTIONLOOKUP QROLE, NASS.QUESTIONLOOKUP QSEATTYPE, NASS.QUESTIONLOOKUP QSEX, NASS.QUESTIONLOOKUP TYPE, NASS.SEATLOC L, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=O.CASEID(+) AND C.VEHICLEID=O.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEX=QSEX.OPTIONVALUE(+) AND QSEX.DATAITEMID(+)=1043 AND O.PICKPOSTURE=PL.POSTUREID(+) AND TO_CHAR(O.PICKROLE)=QROLE.OPTIONVALUE(+) AND QROLE.DATAITEMID(+)=1046 AND O.CASEID=L.CASEID(+) AND O.VEHICLEID=L.VEHICLEID(+) AND O.SEATLOCID=L.SEATLOCID(+)AND TO_CHAR(L.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) AND QSEATTYPE.DATAITEMID(+)=1280 AND O.CASEID=MB.CASEID(+) AND O.VEHICLEID=MB.VEHICLEID(+) AND O.OCCUPANTID=MB.OCCUPANTID(+) AND QMBCRASH.OPTIONVALUE(+)=TO_CHAR(MB.MANUALCRASHUSE) AND QMBCRASH.DATAITEMID(+)=1190 AND QMBTYPE.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTTYPEUSED) AND QMBTYPE.DATAITEMID(+)=1188 AND QMBFAIL.OPTIONVALUE(+)=TO_CHAR(MB.MANUALBELTFAILURE) AND QMBFAIL.DATAITEMID(+)=1192 AND QMBDEVICE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEID) AND QMBDEVICE.DATAITEMID(+)=3786 AND QMBDEVUSE.OPTIONVALUE(+)=TO_CHAR(MB.BELTPOSDEVICEUSEID) AND QMBDEVUSE.DATAITEMID(+)=3787 AND O.CASEID=AB.CASEID(+) AND O.VEHICLEID=AB.VEHICLEID(+) AND O.OCCUPANTID=AB.OCCUPANTID(+) AND QABCRASH.OPTIONVALUE(+)=TO_CHAR(AB.AUTOCRASHUSE) AND QABCRASH.DATAITEMID(+)=1199 AND QABTYPE.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTTYPEUSED) AND QABTYPE.DATAITEMID(+)=1197 AND QABFAIL.OPTIONVALUE(+)=TO_CHAR(AB.AUTOBELTFAILURE) AND QABFAIL.DATAITEMID(+)=1200 AND O.CHILDSEATAVAILABLE=AVAIL.OPTIONVALUE(+) AND AVAIL.DATAITEMID(+)=1790 AND O.CHILDSEATAVAILABLE IS NULL AND O.CASEID=CS.CASEID(+) AND O.VEHICLEID=CS.VEHICLEID(+) AND O.OCCUPANTID=CS.OCCUPANTID(+) AND CS.CHILDSEATMANID=CSMAKE.MAKEID(+) AND CS.PICKMODELID=CSL.MODELID(+) AND TO_CHAR(CSL.SEATTYPEID)=TYPE.OPTIONVALUE(+) AND TYPE.DATAITEMID(+)=3733 AND TO_CHAR(CS.POSTUREINUSEID)=POSTURE.OPTIONVALUE(+) AND POSTURE.DATAITEMID(+)=3748 AND CS.PICKORIENTATION=ORIENT.ORIENTID(+) AND CS.PICKHARNESSUSAGE=HARNESS.USAGEID(+) AND CS.PICKSHIELDUSAGE=SHIELD.USAGEID(+) AND CS.PICKTETHERUSAGE=TETHER.USAGEID(+) AND TO_CHAR(CS.RETAINERCLIPUSEID)=CLIP.OPTIONVALUE(+) AND CLIP.DATAITEMID(+)=3744 AND TO_CHAR(CS.LATCHUSEID)=LATCH.OPTIONVALUE(+) AND LATCH.DATAITEMID(+)=3740 AND TO_CHAR(CS.BELTROUTING)=BELT.OPTIONVALUE(+) AND BELT.DATAITEMID(+)=3782 AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*Cardinality: 1-to-1 (tempo-define-template "sql-bgp_vehicle" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_VEHICLE; --CREATE OR REPLACE VIEW BGP_VEHICLE AS SELECT DISTINCT C.CIRENID, V.VEHICLENUMBER, DECODE(ML.MAKENAME,NULL,'NOT CODED',ML.MAKENAME) AS VEHICLE_MAKE, DECODE(MDL.MODELNAME,NULL,'NOT CODED',MDL.MODELNAME) AS VEHICLE_MODEL, V.MODELYEAR, DECODE(TO_CHAR(V.MODELYEAR),-9999,'UNKNOWN',NULL,'NOT CODED',V.MODELYEAR) AS VEHICLE_MODELYEAR, DECODE(BODY.BODYTYPEDESC,NULL,'NOT CODED',BODY.BODYTYPEDESC) BODY_TYPE, DECODE(BODYCAT.DESCRIPTION,NULL,'NOT CODED',BODYCAT.DESCRIPTION) BODY_CATEGORY, DECODE(VCLASS.DESCRIPTION,NULL,'NOT CODED',VCLASS.DESCRIPTION) VEHICLE_CLASS, DECODE(V.VIN,NULL,'NOT CODED',V.VIN) AS IDENTIFICATION_NUM, DECODE(V.INTRANSPORT,1,'IN TRANSPORT',0,'NOT IN TRANSPORT',NULL,'NOT CODED',V.INTRANSPORT) AS IN_TRANSPORT, DECODE(V.CURBWEIGHT,-9999,'UNKNOWN',NULL,'NOT CODED',V.CURBWEIGHT) AS CURB_WEIGHT, DECODE(TO_CHAR(V.CARGOWEIGHT),-9999,'UNKNOWN',NULL,'NOT CODED',V.CARGOWEIGHT) AS CARGO_WEIGHT, DECODE(V.WHEELBASE,-9999,'UNKNOWN',NULL,'NOT CODED',V.WHEELBASE) AS WHEELBASE, DECODE(V.OVERALLLENGTH,-9999,'UNKNOWN',NULL,'NOT CODED',V.OVERALLLENGTH) AS OVERALL_LENGTH, DECODE(V.MAXWIDTH,-9999,'UNKNOWN',NULL,'NOT CODED',V.MAXWIDTH) AS MAXIMUM_WIDTH, DECODE(V.AVGTRACK,-9999,'UNKNOWN',NULL,'NOT CODED',V.AVGTRACK) AS AVERAGE_TRACK, DECODE(V.FRONTOVERHANG,-9999,'UNKNOWN',NULL,'NOT CODED',V.FRONTOVERHANG) AS FRONTOVERHANG, DECODE(V.REAROVERHANG,-9999,'UNKNOWN',NULL,'NOT CODED',V.REAROVERHANG) AS REAROVERHANG, DECODE(V.ENDWIDTH,-9999,'UNKNOWN',NULL,'NOT CODED',V.ENDWIDTH) AS UNDEFORMEDENDWIDTH, DECODE(V.CYLINDERS,-9999,'UNKNOWN',NULL,'NOT CODED',V.CYLINDERS) AS CYLINDERS, DECODE(V.ENGINEL,-9999,'UNKNOWN',NULL,'NOT CODED',V.ENGINEL) AS DISPLACEMENT, SUBSTR(DECODE(DISPOS.OPTIONTEXT,NULL,'NOT CODED',DISPOS.OPTIONTEXT),1,60) AS VEHICLEDISPOSITION, SUBSTR(DECODE(MANUFACT.OPTIONTEXT,NULL,'NOT CODED',MANUFACT.OPTIONTEXT),1,60) AS CERTIFIEDALTEREDVEHICLE, SUBSTR(DECODE(JUNCT.OPTIONTEXT,NULL,'NOT CODED',JUNCT.OPTIONTEXT),1,60) AS JUNCTION, SUBSTR(DECODE(LANE.OPTIONTEXT,NULL,'NOT CODED',LANE.OPTIONTEXT),1,60) AS TRAVLELANES, SUBSTR(DECODE(FLOW.OPTIONTEXT,NULL,'NOT CODED',FLOW.OPTIONTEXT),1,60) AS FLOW, SUBSTR(DECODE(ALIGN.OPTIONTEXT,NULL,'NOT CODED',ALIGN.OPTIONTEXT),1,60) AS ALIGNMENT, SUBSTR(DECODE(PROFILE.OPTIONTEXT,NULL,'NOT CODED',PROFILE.OPTIONTEXT),1,60) AS PROFILE, SUBSTR(DECODE(SURF.OPTIONTEXT,NULL,'NOT CODED',SURF.OPTIONTEXT),1,60) AS SURFACETYPE, SUBSTR(DECODE(SURFCOND.OPTIONTEXT,NULL,'NOT CODED',SURFCOND.OPTIONTEXT),1,60) AS SURFACECONDITION, SUBSTR(DECODE(LIGHT.OPTIONTEXT,NULL,'NOT CODED',LIGHT.OPTIONTEXT),1,60) AS LIGHT, SUBSTR(DECODE(ATMOS.OPTIONTEXT,NULL,'NOT CODED',ATMOS.OPTIONTEXT),1,60) AS ATMOSPHERE, SUBSTR(DECODE(DEVICE.OPTIONTEXT,NULL,'NOT CODED',DEVICE.OPTIONTEXT),1,60) AS DEVICE, SUBSTR(DECODE(FUNC.OPTIONTEXT,NULL,'NOT CODED',FUNC.OPTIONTEXT),1,60) AS FUNCTIONING, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.VEHICLE V, NASS.MAKELOOKUP ML, NASS.MODELLOOKUP MDL, NASS.BODYTYPELOOKUP BODY, NASS.BODYCATEGORYLOOKUP BODYCAT, NASS.VEHICLECLASSLOOKUP VCLASS, NASS.QUESTIONLOOKUP DISPOS, NASS.QUESTIONLOOKUP MANUFACT, NASS.VEHICLEPRECRASH VPC, NASS.QUESTIONLOOKUP JUNCT, NASS.QUESTIONLOOKUP LANE, NASS.QUESTIONLOOKUP FLOW, NASS.QUESTIONLOOKUP ALIGN, NASS.QUESTIONLOOKUP PROFILE, NASS.QUESTIONLOOKUP SURF, NASS.QUESTIONLOOKUP SURFCOND, NASS.QUESTIONLOOKUP LIGHT, NASS.QUESTIONLOOKUP ATMOS, NASS.QUESTIONLOOKUP DEVICE, NASS.QUESTIONLOOKUP FUNC, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.CASEID=V.CASEID(+) AND C.VEHICLEID=V.VEHICLEID(+) AND V.MAKEID= ML.MAKEID(+) AND V.MODELID=MDL.MODELID(+) AND V.BODYTYPEID=BODY.BODYTYPEID(+) AND V.PICKVEHICLETYPE=BODYCAT.BODYCATEGORYID(+) AND V.PICKVEHICLECLASS=VCLASS.VEHICLECLASSID(+) AND TO_CHAR(V.RESEARCHVEHDISPOS)=DISPOS.OPTIONVALUE(+)AND DISPOS.DATAITEMID(+)=1335 AND TO_CHAR(V.MANUFACTURERCERTMODS)=MANUFACT.OPTIONVALUE(+) AND MANUFACT.DATAITEMID(+)=1336 AND V.CASEID=VPC.CASEID(+) AND V.VEHICLEID=VPC.VEHICLEID(+) AND TO_CHAR(VPC.NONINTERCHANGEJUNCTION)=JUNCT.OPTIONVALUE(+) AND JUNCT.DATAITEMID(+)=1442 AND TO_CHAR(VPC.NUMOFLANES)=LANE.OPTIONVALUE(+) AND LANE.DATAITEMID(+)=1464 AND TO_CHAR(VPC.PICKTRAFFICFLOW)=FLOW.OPTIONVALUE(+) AND FLOW.DATAITEMID(+)=1463 AND TO_CHAR(VPC.PICKROADWAYALIGNMENT)=ALIGN.OPTIONVALUE(+) AND ALIGN.DATAITEMID(+)=1465 AND TO_CHAR(VPC.PICKROADWAYPROFILE)=PROFILE.OPTIONVALUE(+) AND PROFILE.DATAITEMID(+)=1446 AND TO_CHAR(VPC.PICKROADWAYSURFACE)=SURF.OPTIONVALUE(+)AND SURF.DATAITEMID(+)=1447 AND TO_CHAR(VPC.PICKROADWAYSURFACECOND)=SURFCOND.OPTIONVALUE(+) AND SURFCOND.DATAITEMID(+)=1449 AND TO_CHAR(VPC.PICKLIGHTCONDITIONS)=LIGHT.OPTIONVALUE(+) AND LIGHT.DATAITEMID(+)=1451 AND TO_CHAR(VPC.PICKATMOSCONDITIONS)=ATMOS.OPTIONVALUE(+) AND ATMOS.DATAITEMID(+)=1456 AND TO_CHAR(VPC.PICKTRAFFICCTRLDEVICE)=DEVICE.OPTIONVALUE(+) AND DEVICE.DATAITEMID(+)=1458 AND TO_CHAR(VPC.PICKTRAFFICDEVICE)=FUNC.OPTIONVALUE(+) AND FUNC.DATAITEMID(+)=1460 AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation (tempo-define-template "sql-bgp_vitalsigns" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_VITALSIGNS; --CREATE OR REPLACE VIEW BGP_VITALSIGNS AS SELECT DISTINCT C.CIRENID, VS.VITALID, VS.VITALDATE, VS.VITALTIME, LOC.DESCRIPTION LOCATION, VS.SYSTOLIC, VS.DIASTOLIC, BP.DESCRIPTION BPMETHOD, VS.PULSE, PULSE.DESCRIPTION PULSEMETHOD, VS.TEMP, TEMP.DESCRIPTION TEMPMETHOD, VS.RESPRATE, RESP.DESCRIPTION RESPMETHOD, SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, CIREN.VITALSIGNS VS, NASS.BPMETHODLOOKUP BP, NASS.PULSEDESCLOOKUP PULSE, NASS.TEMPMETHODLOOKUP TEMP, NASS.RESPDESCLOOKUP RESP, NASS.LOCATIONLOOKUP LOC, NASS.ORGANIZATION NOR WHERE C.CIRENID=VS.CIRENID(+) AND VS.LOCATIONID=LOC.LOCATIONID(+) AND VS.BPMETHOD=BP.BPMETHODID(+) AND VS.PULSEDESCRIPID=PULSE.PULSEDESCRIPID(+) AND VS.TEMPMETHODID=TEMP.TEMPMETHODID(+) AND VS.RESPDESCRIPID=RESP.RESPDESCRIPID(+) AND NOR.ORGID=C.CENTERID ; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;; (tempo-define-template ;; "sql-bgp_mary-pat-mckay" ; template name ;; '("--*DOCUMENTATION-BLAH ;; --DROP VIEW BGP_ ;; --CREATE OR REPLACE VIEW BGP_ ;; SELECT ;; DISTINCT ;; /*+ ORDERED */ ;; CCC.CIRENID, ;; CCC.CIRENNUMBER, ;; CCC.CASEID, ;; BGP_MAXAIS.MAXAIS, ;; CCC.AGE, ;; SUBSTR(DECODE(CCC.FATALID,NULL,'NOT CODED','1','NOT FATAL','2','FATAL','3','FATAL BY DISEASE',CCC.FATALID),1,9) AS FATALITY, ;; DECODE(CCC.STATUSID,'2','COMPLETE','3','IN TRANSPORT','1','OPEN','0','PENDING','4','COPY','5','PRELIMINARY REVIEW','10','QC INCOMPLETE','15','QC REVIEW','17','UNKNOWN','16','QC COMPLETE') AS CASE_STATUS, ;; CCC.VEHICLEID AS VEHICLEID, ;; CCM.COMORBIDCOMMENT AS COMORBIDITY_DESCRIPTION, ;; CCM.COMORBIDID AS COMORBIDITY_ID, ;; CMVI.ISS AS ISS, ;; CVS.VITALID AS VITALSIGNS_ID, ;; CVS.BPMETHOD AS BLOOD_PRESSURE_METHOD, ;; CVS.DIASTOLIC AS DIASTOLIC_BLOOD_PRESSURE, ;; CVS.LOCATIONID AS VITALSIGNS_LOCATION_ID, ;; CVS.PULSE AS PULSE_RATE, ;; CVS.PULSEDESCRIPID AS PULSE_DESCRIPTION_ID, ;; CVS.RESPDESCRIPID AS RESPIRATION_DESCRIPTION_ID, ;; CVS.RESPRATE AS RESPIRATION_RATE, ;; CVS.SYSTOLIC AS SYSTOLIC_PRESSURE_METHOD, ;; CVS.TEMP AS VITALSIGNS_TEMPERATURE, ;; CVS.TEMPMETHODID AS TEMPERATURE_METHOD_ID, ;; CVS.TIMELAPSE AS VITALSIGNS_TIME_LAPSE, ;; CVS.VITALDATE AS VITALSIGNS_DATE, ;; CVS.VITALRANKID AS VITALSIGNS_RANK_ID, ;; CVS.VITALTIME AS VITALSIGNS_TIME, ;; D.DEFORMID AS DEFORMATION_ID, ;; SUBSTR(TO_CHAR(D.DIRECTIONOFFORCE),1,5) AS PDOF, ;; SUBSTR(DECODE(D.TOTALDELTAV,999,'UNKNOWN',D.TOTALDELTAV),1,15) AS DELTA_V, ;; DL.DELTAVBASISID AS DELTAV_BASIS_ID, ;; DECODE(DL.DELTAVBASISCATID,NULL,'NOT CODED','0','NOT INSPECTED','1','SMASH','2','NOT A SMASH') AS DELTA_V_CATEGORY, ;; DL.DESCRIPTION AS DELTA_V_DESCRIPTION, ;; DLO.CDCID, ;; DLO.IMPACTID, ;; E.EVENTSEQUENCEID AS EVENT_SEQUENCE_ID, ;; E.EVENTSEQUENCENUMBER AS EVENT_SEQUENCE_NUMBER, ;; NA.ACCIDENTDATETIME AS ACCIDENT_DATE, ;; NA.ACCIDENTTIME AS ACCIDENT_TIME, ;; NA.CONFIGTYPE AS ACCIDENT_CONFIG_TYPE_NUMBER, ;; NA.NUMOFEVENTS AS NUMBER_OF_ACCIDENT_EVENTS, ;; NA.NUMOFVEHICLES AS NUMBER_OF_ACCIDENT_VEHICLES, ;; NA.NIF AS NIF, ;; NA.PIF AS PIF, ;; NA.PSUWEIGHT AS PSU_WEIGHT, ;; NA.SPECIFYACCIDENTTYPE AS ACCIDENT_TYPE, ;; NA.SPECIFYCONFIG AS ACCIDENT_CONFIGURATION, ;; NA.VEHICLETYPE AS VEHICLE_TYPE, ;; NA.WEIGHTRATIO AS WEIGHT_RATIO, ;; NCS.EJECTIONID AS CHILDSEAT_EJECTION_ID, ;; NCS.SEATEJECTION AS CHILDSEAT_EJECTION, ;; NE.EJECTIONID AS EJECTION_ID, ;; NE.EJECTIONNUMBER AS EJECTION_NUMBER, ;; NE.PICKEJECTIONTYPE AS EJECTION_TYPE, ;; NE.PICKEJECTIONAREA AS EJECTION_AREA, ;; NE.OTHEREJECTIONAREA, ;; NE.PICKEJECTIONMEDIUM, ;; NE.SPECIFYEJECTIONMEDIUM, ;; NE.PICKEJECTIONMEDIUMSTATUS, ;; NE.PICKENTRAPMENT, ;; NE.SPECIFYENTRAPMENT, ;; NE.PICKEJECTIONTYPE AS EJECTION_TYPE, ;; NER.EMSID AS EMS_ID, ;; NER.EMSMODE AS ARRIVAL_MODE_FROM_SCENE, ;; NEX.EXTRICTTIME AS EXTRICATION_TIME, ;; SUBSTR(NMKL.MAKENAME,1,60) AS MAKE, ;; SUBSTR(NMDL.MODELNAME,1,60) AS MODEL, ;; NOC.SEATLOCID AS SEAT_LOCATION_ID, ;; SUBSTR(DECODE(QSEX.OPTIONTEXT,NULL,'NOT CODED',QSEX.OPTIONTEXT),1,6) AS SEX, ;; SUBSTR(DECODE(NOC.WEIGHT,-9999,'UNKNOWN',NOC.WEIGHT),1,8) AS WEIGHT, ;; SUBSTR(DECODE(NOC.HEIGHT,-9999,'UNKNOWN',NOC.HEIGHT),1,8) AS HEIGHT, ;; NOC.SPECIFYPOSTURE, ;; NSL.PICKTRACKPOSITION, ;; NV.CURBWEIGHT AS VEHICLE_MASS, ;; P.CRUSHID, ;; P.MAXCRUSH, ;; SUBSTR(DECODE(QABCRASH.OPTIONTEXT,NULL,'NOT CODED',QABCRASH.OPTIONTEXT),1,40) AS AUTOMATIC_BELT_CRASH, ;; SUBSTR(DECODE(QABFAIL.OPTIONTEXT,NULL,'NOT CODED',QABFAIL.OPTIONTEXT),1,40) AS AUTOMATIC_BELT_FAILURE, ;; SUBSTR(DECODE(QABTYPE.OPTIONTEXT,NULL,'NOT CODED',QABTYPE.OPTIONTEXT),1,65) AS AUTOMATIC_BELT_TYPE, ;; SUBSTR(DECODE(QMBCRASH.OPTIONTEXT,NULL,'NOT CODED',QMBCRASH.OPTIONTEXT),1,50) AS MANUAL_BELT_CRASH, ;; SUBSTR(DECODE(QMBDEVICE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVICE.OPTIONTEXT),1,30) AS BELT_DEVICE, ;; SUBSTR(DECODE(QMBDEVUSE.OPTIONTEXT,NULL,'NOT CODED',QMBDEVUSE.OPTIONTEXT),1,30) AS BELT_DEVICE_USE, ;; SUBSTR(DECODE(QMBFAIL.OPTIONTEXT,NULL,'NOT CODED',QMBFAIL.OPTIONTEXT),1,30) AS MANUAL_BELT_FAILURE, ;; SUBSTR(DECODE(QMBTYPE.OPTIONTEXT,NULL,'NOT CODED',QMBTYPE.OPTIONTEXT),1,50) AS MANUAL_BELT_TYPE, ;; SUBSTR(DECODE(QROLE.OPTIONTEXT,NULL,'NOT CODED',QROLE.OPTIONTEXT),1,15) AS ROLE,'ROW '||DECODE(LOWER(SEATROW),'O','CARGOAREA',SEATROW)||' '||DECODE(LOWER(SEATLOCATION),'1',' LEFT','2',' MIDDLE','3',' RIGHT','4',' OTHER','O','NO SEAT',SEATLOCATION) AS SEAT_LOCATION, ;; SUBSTR(DECODE(QSEATTYPE.OPTIONTEXT,NULL,'NOT CODED',QSEATTYPE.OPTIONTEXT),1,35) AS SEAT_TYPE, ;; SUBSTR(NOR.ORGTITLE,1,35) AS ORGANIZATION ;; FROM ;; CIREN.CIREN_CASE CCC, ;; CIREN.COMORBIDITY CCM, ;; CIREN.MV_ISS CMVI, ;; CIREN.VITALSIGNS CVS, ;; NASS.ACCIDENT NA, ;; NASS.AUTOMATICBELTUSE NAB, ;; NASS.CDCLOOKUP C1, ;; NASS.CDCLOOKUP C2, ;; NASS.CDCLOOKUP C3, ;; NASS.CDCLOOKUP C4, ;; NASS.CDCLOOKUP C5, ;; NASS.CHILDSEAT NCS, ;; NASS.DELTAVBASISLOOKUP DL, ;; NASS.DAMAGELOCATOR DLO, ;; NASS.CRUSHPROFILE P, ;; NASS.VEHICLEDEFORMATION D, ;; NASS.EJECTION NE, ;; NASS.EVENTS E, ;; NASS.EXTRICATION NEX, ;; NASS.EMSRESPONSE NER, ;; NASS.MAKELOOKUP NMKL, ;; NASS.MANUALBELTUSE NMB, ;; NASS.MODELLOOKUP NMDL, ;; NASS.OCCUPANT NOC, ;; NASS.ORGANIZATION NOR, ;; NASS.QUESTIONLOOKUP Q, ;; NASS.QUESTIONLOOKUP QABCRASH, ;; NASS.QUESTIONLOOKUP QABFAIL, ;; NASS.QUESTIONLOOKUP QABTYPE, ;; NASS.QUESTIONLOOKUP QMBCRASH, ;; NASS.QUESTIONLOOKUP QMBDEVICE, ;; NASS.QUESTIONLOOKUP QMBDEVUSE, ;; NASS.QUESTIONLOOKUP QMBFAIL, ;; NASS.QUESTIONLOOKUP QMBTYPE, ;; NASS.QUESTIONLOOKUP QROLE, ;; NASS.QUESTIONLOOKUP QSEATTYPE, ;; NASS.QUESTIONLOOKUP QSEX, ;; NASS.SEATLOC NSL, ;; NASS.VEHICLE NV, ;; POWELLB.BGP_MAXAIS BGP_MAXAIS ;; WHERE CCC.AGE > -1 AND CCC.AGE < 12 ;; AND DLO.CASEID=P.CASEID ;; AND DLO.VEHICLEID=P.VEHICLEID ;; AND DLO.IMPACTID=P.IMPACTID ;; AND D.CASEID=DLO.CASEID ;; AND D.VEHICLEID=DLO.VEHICLEID ;; AND D.DEFORMID=DLO.CDCID ;; AND CCC.CIRENID=BGP_MAXAIS.CIRENID(+) ;; AND CCC.CIRENID=CMVI.CIRENID(+) ;; AND CCC.CASEID=D.CASEID(+) ;; AND CCC.CASEID=E.CASEID(+) ;; AND CCC.CASEID=NA.CASEID(+) ;; AND CCC.CASEID=NCS.CASEID(+) ;; AND CCC.CASEID=NE.CASEID(+) ;; AND CCC.CASEID=NER.CASEID(+) ;; AND CCC.CASEID=NEX.CASEID(+) ;; AND CCC.CASEID=NMB.CASEID(+) ;; AND CCC.CASEID=NOC.CASEID(+) ;; AND CCC.CASEID=NSL.CASEID ;; AND CCC.CASEID=NV.CASEID(+) ;; AND CCC.CENTERID=NOR.ORGID ;; AND CCC.CIRENID=BGP_MAXAIS.CIRENID(+) ;; AND CCC.CIRENID=CCM.CIRENID(+) ;; AND CCC.CIRENID=CVS.CIRENID(+) ;; AND CCC.VEHICLEID=D.VEHICLEID(+) ;; AND CCC.VEHICLEID=E.VEHICLEID(+) ;; AND CCC.OCCUPANTID=NCS.OCCUPANTID(+) ;; AND CCC.CASEID=NAB.CASEID(+) ;; AND CCC.OCCUPANTID=NMB.OCCUPANTID(+) ;; AND CCC.OCCUPANTID=NOC.OCCUPANTID(+) ;; AND CCC.OCCUPANTID=NAB.OCCUPANTID(+) ;; AND CCC.VEHICLEID=NCS.VEHICLEID(+) ;; AND CCC.VEHICLEID=NAB.VEHICLEID(+) ;; AND CCC.VEHICLEID=NE.VEHICLEID(+) ;; AND CCC.VEHICLEID=NEX.VEHICLEID(+) ;; AND CCC.VEHICLEID=NMB.VEHICLEID(+) ;; AND CCC.VEHICLEID=NOC.VEHICLEID(+) ;; AND D.DAMAGEDISTRIBUTION=C4.CDCID ;; AND D.DAMAGEEXTENT=C5.CDCID ;; AND D.DEFORMATIONLOCATION=C1.CDCID ;; AND D.ESTIMATEDDELTAV=Q.OPTIONVALUE ;; AND D.EVENTSEQUENCEID=E.EVENTSEQUENCEID ;; AND D.LONGLATLOCATION=C2.CDCID ;; AND D.PICKDELTAVBASIS=DL.DELTAVBASISID ;; AND D.RANKING=1 ;; AND D.VERTLATLOCATION=C3.CDCID ;; AND E.CASEID=D.CASEID ;; AND E.EVENTSEQUENCEID=D.EVENTSEQUENCEID ;; AND E.VEHICLEID=D.VEHICLEID ;; AND NMKL.MAKEID=NV.MAKEID ;; AND NMDL.MODELID=NV.MODELID ;; AND NOC.SEATLOCID=NSL.SEATLOCID(+) ;; AND Q.DATAITEMID=1566 ;; AND QABCRASH.DATAITEMID(+)=1199 ;; AND QABCRASH.OPTIONVALUE(+)=TO_CHAR(NAB.AUTOCRASHUSE) ;; AND QABFAIL.DATAITEMID(+)=1200 ;; AND QABFAIL.OPTIONVALUE(+)=TO_CHAR(NAB.AUTOBELTFAILURE) ;; AND QABTYPE.DATAITEMID(+)=1197 ;; AND QABTYPE.OPTIONVALUE(+)=TO_CHAR(NAB.AUTOBELTTYPEUSED) ;; AND QMBCRASH.DATAITEMID(+)=1190 ;; AND QMBCRASH.OPTIONVALUE(+)=TO_CHAR(NMB.MANUALCRASHUSE) ;; AND QMBDEVICE.DATAITEMID(+)=3786 ;; AND QMBDEVICE.OPTIONVALUE(+)=TO_CHAR(NMB.BELTPOSDEVICEID) ;; AND QMBDEVUSE.DATAITEMID(+)=3787 ;; AND QMBDEVUSE.OPTIONVALUE(+)=TO_CHAR(NMB.BELTPOSDEVICEUSEID) ;; AND QMBFAIL.DATAITEMID(+)=1192 ;; AND QMBFAIL.OPTIONVALUE(+)=TO_CHAR(NMB.MANUALBELTFAILURE) ;; AND QMBTYPE.DATAITEMID(+)=1188 ;; AND QMBTYPE.OPTIONVALUE(+)=TO_CHAR(NMB.MANUALBELTTYPEUSED) ;; AND QROLE.DATAITEMID(+)=1046 ;; AND QSEATTYPE.DATAITEMID(+)=1280 ;; AND NOC.SEX=QSEX.OPTIONVALUE(+) ;; AND QSEX.DATAITEMID(+)=1043 ;; AND TO_CHAR(NOC.PICKROLE)=QROLE.OPTIONVALUE(+) ;; AND TO_CHAR(NSL.PICKSEATTYPE)=QSEATTYPE.OPTIONVALUE(+) ;; ; ;; ") ; definition ;; "s-jjj" ; abbreviation ;; "Inserts an SQL program command") ; documentation ;*Don't forget that these tables are available too: ;; d:/cygwin/root/n/n/etc/i-want-pieces-of-just-about-every-table-project: ;; total 41561 free 2096832 ;; -rw-rw-rw- 1 root root 1831 Nov 27 13:26 #README# ;; -rw-rw-rw- 1 root root 0 Nov 27 15:30 #j.j# ;; -rw-rw-rw- 1 root root 0 Nov 27 15:33 #j2.sql# ;; -rw-rw-rw- 1 root root 399591 Nov 27 13:45 #wuj.mv_admission# ;; -rw-rw-rw- 1 root root 399591 Nov 27 13:48 #wuj.mv_admission.out# ;; drwxrwxrwx 2 root root 0 Nov 20 12:37 . ;; drwxrwxrwx 2 root root 0 Mar 20 2002 .. ;; -rw-rw-rw- 1 root root 76561 Dec 4 11:19 root.txt ;; -rw-rw-rw- 1 root root 76561 Dec 4 11:19 1.txt.bak ;; -rw-rw-rw- 1 root root 148528 Nov 20 12:54 CIREN.COMPLICATIONS ;; -rw-rw-rw- 1 root root 402109 Nov 27 15:46 MV_ADMISSION.bak ;; -rw-rw-rw- 1 root root 3926049 Nov 27 15:46 MV_AIRBAG.bak ;; -rw-rw-rw- 1 root root 41316 Nov 27 15:46 MV_AIRBAGID.bak ;; -rw-rw-rw- 1 root root 393535 Nov 27 15:46 MV_AIRBAG_VALUE.bak ;; -rw-rw-rw- 1 root root 231558 Nov 27 15:46 MV_ANTHRO.bak ;; -rw-rw-rw- 1 root root 88604 Nov 27 15:47 MV_ANTHRO_VALUE.bak ;; -rw-rw-rw- 1 root root 451757 Nov 27 15:47 MV_CHARGES.bak ;; -rw-rw-rw- 1 root root 180064 Nov 27 15:47 MV_CHARGES_VALUE.bak ;; -rw-rw-rw- 1 root root 5444134 Nov 27 15:48 MV_CIRENINJURY.bak ;; -rw-rw-rw- 1 root root 1546244 Nov 27 15:48 MV_CIRENINJURY_VALUE.bak ;; -rw-rw-rw- 1 root root 133663 Nov 27 15:49 MV_CLOTHING.bak ;; -rw-rw-rw- 1 root root 129223 Nov 27 15:49 MV_CLOTHING_VALUE.bak ;; -rw-rw-rw- 1 root root 144127 Nov 27 15:49 MV_COMORBIDITY.bak ;; -rw-rw-rw- 1 root root 71241 Nov 27 15:49 MV_COMORBIDITY_VALUE.bak ;; -rw-rw-rw- 1 root root 120096 Nov 27 15:49 MV_COMPLICATION.bak ;; -rw-rw-rw- 1 root root 390781 Nov 27 15:49 MV_CRASHDERIVED.bak ;; -rw-rw-rw- 1 root root 140952 Nov 27 15:49 MV_CRASHDERIVED_VALUE.bak ;; -rw-rw-rw- 1 root root 457551 Nov 27 15:50 MV_DEMOINFO.bak ;; -rw-rw-rw- 1 root root 167647 Nov 27 15:50 MV_DEMOINFO_VALUE.bak ;; -rw-rw-rw- 1 root root 815260 Nov 27 15:50 MV_DISCHARGEICDM.bak ;; -rw-rw-rw- 1 root root 1192894 Nov 27 15:50 MV_DXPROCEDURE.bak ;; -rw-rw-rw- 1 root root 77674 Nov 27 15:50 MV_EJECTION.bak ;; -rw-rw-rw- 1 root root 307327 Nov 27 15:50 MV_EMSRESPONSE.bak ;; -rw-rw-rw- 1 root root 126229 Nov 27 15:51 MV_EMSRESPONSE_VALUE.bak ;; -rw-rw-rw- 1 root root 48272 Nov 27 15:51 MV_EVENTNUMBER.bak ;; -rw-rw-rw- 1 root root 986886 Nov 27 15:51 MV_EVENTS.bak ;; -rw-rw-rw- 1 root root 328381 Nov 27 15:51 MV_eEVENTS_VALUE.bak ;; -rw-rw-rw- 1 root root 132916 Nov 27 15:51 MV_EXTRICATION.bak ;; -rw-rw-rw- 1 root root 380827 Nov 27 15:51 MV_GCS.bak ;; -rw-rw-rw- 1 root root 144429 Nov 27 15:51 MV_GCS_VALUE.bak ;; -rw-rw-rw- 1 root root 1512266 Nov 27 15:52 MV_IMPACT.bak ;; -rw-rw-rw- 1 root root 268398 Nov 27 15:52 MV_IMPACT_VALUE.bak ;; -rw-rw-rw- 1 root root 868935 Nov 27 15:52 MV_INJURYCONTACT.bak ;; -rw-rw-rw- 1 root root 449415 Nov 27 15:52 MV_INJURYCONTACT_VALUE.bak ;; -rw-rw-rw- 1 root root 502421 Nov 27 15:52 MV_INJURYICDM.bak ;; -rw-rw-rw- 1 root root 968283 Nov 27 15:53 MV_INJURYINTRUSION.bak ;; -rw-rw-rw- 1 root root 343107 Nov 27 15:53 MV_INJURYINTRUSION_VALUE.bak ;; -rw-rw-rw- 1 root root 647636 Nov 27 15:53 MV_INTRUSION.bak ;; -rw-rw-rw- 1 root root 442 Nov 27 15:53 MV_ISS.bak ;; -rw-rw-rw- 1 root root 466 Nov 27 15:53 MV_LU_ABDEPLOY.bak ;; -rw-rw-rw- 1 root root 466 Nov 27 15:53 MV_LU_AUTOBELT.bak ;; -rw-rw-rw- 1 root root 460 Nov 27 15:53 MV_LU_DEFLOC.bak ;; -rw-rw-rw- 1 root root 469 Nov 27 15:53 MV_LU_LATLONLOC.bak ;; -rw-rw-rw- 1 root root 463 Nov 27 15:53 MV_LU_MANBELT.bak ;; -rw-rw-rw- 1 root root 451 Nov 27 15:53 MV_LU_SEX.bak ;; -rw-rw-rw- 1 root root 445 Nov 27 15:53 MV_MAKE.bak ;; -rw-rw-rw- 1 root root 102695 Nov 27 15:53 MV_MAXCRUSH.bak ;; -rw-rw-rw- 1 root root 448 Nov 27 15:53 MV_MODEL.bak ;; -rw-rw-rw- 1 root root 460 Nov 27 15:54 MV_MODELYEAR.bak ;; -rw-rw-rw- 1 root root 2451 Nov 27 15:54 MV_NASSINJURY.bak ;; -rw-rw-rw- 1 root root 5783352 Nov 27 15:54 MV_OCCUPANT.bak ;; -rw-rw-rw- 1 root root 377964 Nov 27 15:54 MV_OCCUPANT_VALUE.bak ;; -rw-rw-rw- 1 root root 560200 Nov 27 15:54 MV_OPPROCEDURE.bak ;; -rw-rw-rw- 1 root root 311593 Nov 27 15:54 MV_STRIKING_STRUCK.bak ;; -rw-rw-rw- 1 root root 5613228 Nov 27 15:55 MV_VEHICLE.bak ;; -rw-rw-rw- 1 root root 459079 Nov 27 15:55 MV_VEHICLE_VALUE.bak ;; -rw-rw-rw- 1 root root 1527494 Nov 27 15:55 MV_VITALSIGNS.bak ;; -rw-rw-rw- 1 root root 682227 Nov 27 15:55 MV_VITALSIGNS_VALUE.bak ;; -rw-rw-rw- 1 root root 2020 Nov 27 13:19 README ;; -rw-rw-rw- 1 root root 1349 Nov 27 12:36 README~ ;; -rw-rw-rw- 1 root root 686 Dec 2 15:51 before-join-with-pipes.sh ;; -rw-rw-rw- 1 root root 0 Nov 27 15:55 caseid-cirenid-ISNT-POSSIBLE-DAMIT!! ;; -rw-rw-rw- 1 root root 0 Dec 2 17:02 cirenid-caseid_hash.txt ;; -rw-rw-rw- 1 root root 26605 Dec 2 15:30 cirenid-caseid_hash.txt.bak ;; -rw-rw-rw- 1 root root 97934 Dec 2 15:52 cirenid-caseid_hash.txt~ ;; -rw-rw-rw- 1 root root 80384 Dec 2 15:29 cirenid-caseid_hash.xls ;; -rw-rw-rw- 1 root root 114197 Dec 2 15:57 cirenid-to-caseid_hash.sh ;; -rw-rw-rw- 1 root root 437 Nov 27 15:42 j.j ;; -rw-rw-rw- 1 root root 437 Nov 27 15:41 j.j~ ;; -rw-rw-rw- 1 root root 144127 Nov 27 13:59 j.out ;; -rw-rw-rw- 1 root root 33 Nov 27 13:38 j.sql ;; -rw-rw-rw- 1 root root 670870 Dec 2 16:00 j.txt ;; -rw-rw-rw- 1 root root 410 Nov 27 15:55 jjj.sql ;; -rw-rw-rw- 1 root root 410 Nov 27 15:33 jjj.sql.bak ;; -rw-rw-rw- 1 root root 410 Nov 27 15:38 jjj.sql~ ;; -rw-rw-rw- 1 root root 152 Nov 27 14:05 k.out ;; -rw-rw-rw- 1 root root 410 Nov 27 15:07 kkk.sql ;; -rw-rw-rw- 1 root root 410 Nov 27 14:48 kkk.sql~ ;; -rw-rw-rw- 1 root root 0 Nov 27 15:55 lll.sql ;; -rw-rw-rw- 1 root root 9915 Nov 27 15:45 mv_blah-table-creator.sh ;; -rw-rw-rw- 1 root root 8755 Nov 27 15:44 mv_blah-table-creator.sh~ ;; -rw-rw-rw- 1 root root 2016 Dec 2 12:42 old-j.sql ;; -rw-rw-rw- 1 root root 0 Nov 27 15:22 out.n ;; -rw-rw-rw- 1 root root 76643 Dec 2 15:26 root.txt.bak ;; -rw-rw-rw- 1 root root 76561 Dec 2 15:27 root.txt~ ;; -rw-rw-rw- 1 root root 76561 Dec 4 11:19 sort.j ;; -rw-rw-rw- 1 root root 343 Nov 27 13:37 ttt.sql ;; -rw-rw-rw- 1 root root 33 Nov 27 13:34 wuj.mv_admission.sql ;*INJURIES-AISCODES-DESCRIPTIONS (tempo-define-template "sql-bgp_injuries-aisc-text" ; template name '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_INJURIES_AISC_TEXT; --CREATE OR REPLACE VIEW BGP_INJURIES_AISC_TEXT AS SELECT DISTINCT /*+ ORDERED */ CCC.CIRENID, CCI.AISCODE, NAC.DESCRIPTION, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE CCC, CIREN.CIRENINJURY CCI, NASS.AISCODES NAC, NASS.ORGANIZATION NOR WHERE CCI.AISCODE=NAC.NASSCODE AND CCC.CIRENID=CCI.CIRENID(+) AND NOR.ORGID=CCC.CENTERID ; DROP TABLE BGP_INJURIES_AISC_DESC CASCADE CONSTRAINTS ; --*Example of creating and dropping a table and checking my priveleges to do so --CREATE TABLE BGP_INJURIES_AISC_DESC --(CIRENID NUMBER (9) PRIMARY KEY, --INJURIES_AISC VARCHAR2(4000), --INJURIES_DESC VARCHAR2(4000) --) --; --INSERT INTO BGP_INJURIES_AISC_DESC ( CIRENID, INJURIES_AISC, INJURIES_DESC ) VALUES (123456789, '1212312, 123123131, 1231231', 'blah injury, blah other injury, quux injury') --; --SELECT * FROM BGP_INJURIES_AISC_DESC --; --DROP TABLE BGP_INJURIES_AISC_DESC CASCADE CONSTRAINTS --; ") ; definition "s-belt" ; abbreviation "Inserts an SQL program command") ; documentation ;*But what about NASS.VEHICLEDEFORMATION--isn't it better? IT doesn't rely on "table V"--and table V doesn't have the data point John seeks--table V is outdated--"BGP_AIRBAG" and any other table which uses it needs to be redone/a workaround must be found ;**Here is the header of "CIREN_WH.C_IMPACT"--aka "table V" ;select * from CIREN_WH.C_IMPACT; ; CIRENID|CIRENNUMBE|CENTERNAME |DEFORMID | EVENTID| EVENTNO|OBJECTCLASS |OBJECT |IMPACTTYPE |MAXCRUSH |MAXCRUSHLOCATION |PDOF |DEFORMATIONLOCATION |LONGLATERAL |VERTICALLATERAL |DISTRIBUTION |EXTENT |TOTAL |LONGTDL |LATERAL |ENERGY |IMPACT |BARRIER |ESTIMATED |BASIS ;*But here is the NASS.VEHICLEDEFORMATION header: ; CASEID| VEHICLEID| DEFORMID|EVENTSEQUENCEID|DAMAGEDISTRIBUTION|DAMAGEEXTENT|DEFORMATIONLOCATION|DIRECTIONOFFORCE|LONGLATLOCATION|VERTLATLOCATION|LASTUPDATEID|LASTUPDAT|LONGDELTAV| LATDELTAV|IMPACTDELTAV|ENERGYDELTAV|BARRIERDELTAV|TOTALDELTAV|ESTIMATEDDELTAV| RANKING|CLOCK|PICKOVERRIDE|SHIFTINCREMENT|OTHEROVERRIDE |PICKDELTAVBASIS|SPECIFYDELTAVBASIS |INACTIVEIND| TRAILERID ;; *Sorted here are CIREN_WH.C_IMPACT and NASS.VEHICLEDEFORMATION ;; **CIREN_WH.C_IMPACT ;; BARRIER ;; BASIS ;; CENTERNAME ;; CIRENID ;; CIRENNUMBE ;; DEFORMATIONLOCATION ;; DEFORMID ;; DISTRIBUTION ;; ENERGY ;; ESTIMATED ;; EVENTID ;; EVENTNO ;; EXTENT ;; IMPACT ;; IMPACTTYPE ;; LATERAL ;; LONGLATERAL ;; LONGTDL ;; MAXCRUSH ;; MAXCRUSHLOCATION ;; OBJECT ;; OBJECTCLASS ;; PDOF ;; TOTAL ;; VERTICALLATERAL ;; **NASS.VEHICLEDEFORMATION ;; BARRIERDELTAV ;; CASEID ;; CLOCK ;; DAMAGEDISTRIBUTION ;; DAMAGEEXTENT ;; DEFORMATIONLOCATION ;; DEFORMID ;; DIRECTIONOFFORCE ;; ENERGYDELTAV ;; ESTIMATEDDELTAV ;; EVENTSEQUENCEID ;; IMPACTDELTAV ;; INACTIVEIND ;; LASTUPDAT ;; LASTUPDATEID ;; LATDELTAV ;; LONGDELTAV ;; LONGLATLOCATION ;; OTHEROVERRIDE ;; PICKDELTAVBASIS ;; PICKOVERRIDE ;; RANKING ;; SHIFTINCREMENT ;; SPECIFYDELTAVBASIS ;; TOTALDELTAV ;; TRAILERID ;; VEHICLEID ;; VERTLATLOCATION ;*Cardinality: 1-to-many--1-CIRENID-to-many-AIRBAGIDs ;*Cardinality of C.CIRENID to S.SEATLOCID: 1-to-1 (tempo-define-template "sql-bgp_airbag" ; TEMPLATE NAME '("--*DOCUMENTATION-BLAH --DROP VIEW BGP_AIRBAG; --CREATE OR REPLACE VIEW BGP_AIRBAG AS SELECT DISTINCT C.CIRENID, ABG.AIRBAGID, ABG.AIRBAGNUM, SUBSTR(QAVAIL.OPTIONTEXT,1,30) AS AIRBAGEVERAVAILABLE, QLOCATION.OPTIONTEXT, SUBSTR(DECODE(QLOCATION.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QLOCATION.OPTIONTEXT),1,60) AS LOCATION, QFUNC.OPTIONTEXT, SUBSTR(DECODE(QFUNC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFUNC.OPTIONTEXT),1,60) AS STATUS, ABGTYPE.AIRBAGNAME, DECODE(ABGTYPE.AIRBAGNAME,NULL,'NO AIRBAG AVAILABLE',ABGTYPE.AIRBAGNAME) AS TYPEOFAIRBAG, DECODE(DEPOWER.DESCRIPTION,NULL,'NO AIRBAG AVAILABLE',DEPOWER.DESCRIPTION) AS REDESIGNEDCLASS, SUBSTR(DECODE(QDEPLOY.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDEPLOY.OPTIONTEXT),1,60) AS SYSTEMDEPLOYMENT, SUBSTR(DECODE(QFAIL.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFAIL.OPTIONTEXT),1,60) AS INDICATIONSOFFAILURE, SUBSTR(DECODE(QSWITCHTYPE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHTYPE.OPTIONTEXT),1,60) AS SWITCHTYPE, SUBSTR(DECODE(QSWITCHST.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHST.OPTIONTEXT),1,60) AS SWITCHSTATUS, SUBSTR(DECODE(QFLAPO.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPO.OPTIONTEXT),1,60) AS MODULECOVERFLAPOPENATTEAR, SUBSTR(DECODE(QFLAPD.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPD.OPTIONTEXT),1,60) AS MODULECOVERFLAPDAMAGED, QDAMAGE.OPTIONTEXT, SUBSTR(DECODE(QDAMAGE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDAMAGE.OPTIONTEXT),1,60) AS DAMAGETOAIRBAG, QSOURCE.OPTIONTEXT, SUBSTR(DECODE(QSOURCE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSOURCE.OPTIONTEXT),1,60) AS SOURCEOFDAMAGE, ABG.NUMOFTETHERSTRAPS, DECODE(ABG.NUMOFTETHERSTRAPS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFTETHERSTRAPS) AS NUMOFTETHERS, ABG.NUMOFVENTPORTS, DECODE(ABG.NUMOFVENTPORTS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFVENTPORTS) AS NUMOFVENTPORTS, QACC.OPTIONTEXT, SUBSTR(DECODE(QACC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QACC.OPTIONTEXT),1,60) AS VEHICLEPREVIOUSACCIDENTS, QMAINT.OPTIONTEXT, SUBSTR(DECODE(QMAINT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QMAINT.OPTIONTEXT),1,60) AS PRIORMAINTENANCESERVICE, DECODE(TO_CHAR(V.EVENTID),NULL,'NO AIRBAG AVAILABLE',V.EVENTID) AS DEPLOYEVENTID, DECODE(TO_CHAR(V.EVENTNO),NULL,'NO AIRBAG AVAILABLE',V.EVENTNO) AS DEPLOYEVENTNO, V.TOTAL, DECODE(V.TOTAL,NULL,'NO AIRBAG AVAILABLE',V.TOTAL) AS DELTAV_TOTAL, V.LONGTDL, DECODE(V.LONGTDL,NULL,'NO AIRBAG AVAILABLE',V.LONGTDL) AS DELTAV_LONGTDL, V.LATERAL, DECODE(V.LATERAL,NULL,'NO AIRBAG AVAILABLE',V.LATERAL) AS DELTAV_LATERAL, V.ENERGY, DECODE(V.ENERGY,NULL,'NO AIRBAG AVAILABLE',V.ENERGY) AS DELTAV_ENERGY, V.IMPACT, DECODE(V.IMPACT,NULL,'NO AIRBAG AVAILABLE',V.IMPACT) AS DELTAV_IMPACT, V.BARRIER, DECODE(V.BARRIER,NULL,'NO AIRBAG AVAILABLE',V.BARRIER) AS DELTAV_BARRIER, V.ESTIMATED, SUBSTR(DECODE(V.ESTIMATED,NULL,'NO AIRBAG AVAILABLE',V.ESTIMATED),1,60) AS DELTAV_ESTIMATED, QDELTAV.OPTIONTEXT, SUBSTR(DECODE(QDELTAV.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDELTAV.OPTIONTEXT),1,60) AS CDCFORDEPLOYMENTIMPACT, QCONTACT.OPTIONTEXT, SUBSTR(DECODE(QCONTACT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QCONTACT.OPTIONTEXT),1,60) AS CONTACTEDOTHEROCCUPANT, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, NASS.SEATLOC S, NASS.AIRBAG ABG, NASS.QUESTIONLOOKUP QLOCATION, NASS.AIRBAGTYPELOOKUP ABGTYPE, NASS.QUESTIONLOOKUP QAVAIL, NASS.QUESTIONLOOKUP QDAMAGE, NASS.QUESTIONLOOKUP QDEPLOY, NASS.QUESTIONLOOKUP QFAIL, NASS.QUESTIONLOOKUP QDELTAV, NASS.QUESTIONLOOKUP QCONTACT, NASS.QUESTIONLOOKUP QFLAPD, NASS.QUESTIONLOOKUP QFLAPO, NASS.QUESTIONLOOKUP QSOURCE, NASS.QUESTIONLOOKUP QACC, NASS.QUESTIONLOOKUP QMAINT, NASS.QUESTIONLOOKUP QFUNC, NASS.DEPOWERLOOKUP DEPOWER, NASS.QUESTIONLOOKUP QSWITCHTYPE, NASS.QUESTIONLOOKUP QSWITCHST, CIREN_WH.C_IMPACT V, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=S.CASEID(+) AND C.VEHICLEID=S.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEATLOCID=S.SEATLOCID AND S.CASEID=ABG.CASEID(+) AND S.VEHICLEID=ABG.VEHICLEID(+) AND S.SEATLOCID=ABG.SEATLOCID(+) AND QLOCATION.OPTIONVALUE(+)=TO_CHAR(ABG.PICKLOCATION) AND QLOCATION.DATAITEMID(+)=1228 AND ABGTYPE.AIRBAGCLASSID(+)=ABG.PICKAIRBAGCLASSID AND QAVAIL.OPTIONVALUE(+)=TO_CHAR(S.AIRBAGAVAIL) AND QAVAIL.DATAITEMID(+)=1790 AND S.AIRBAGAVAIL=1 AND QDAMAGE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDAMAGE) AND QDAMAGE.DATAITEMID(+)=1226 AND QDEPLOY.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDEPLOY) AND QDEPLOY.DATAITEMID(+)=1216 AND QFAIL.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFAILURE) AND QFAIL.DATAITEMID(+)=1221 AND QDELTAV.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCDCIMPACTDELTAV) AND QDELTAV.DATAITEMID(+)=1218 AND QCONTACT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCONTACTOTHEROCCUPANT) AND QCONTACT.DATAITEMID(+)=1241 AND QFLAPD.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSDAMAGE) AND QFLAPD.DATAITEMID(+)=1224 AND QFLAPO.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSOPEN) AND QFLAPO.DATAITEMID(+)=1222 AND QSOURCE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKSOURCEOFDAMAGE) AND QSOURCE.DATAITEMID(+)=1227 AND QACC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORACCIDENT) AND QACC.DATAITEMID(+)=1232 AND QMAINT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORMAINTENANCE) AND QMAINT.DATAITEMID(+)=1234 AND QFUNC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFUNCTION) AND QFUNC.DATAITEMID(+)=1215 AND DEPOWER.DEPOWERID(+)=ABG.DEPOWERID AND QSWITCHTYPE.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHTYPE) AND QSWITCHTYPE.DATAITEMID(+)=3021 AND QSWITCHST.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHSTATUS) AND QSWITCHST.DATAITEMID(+)=3022 AND ABG.DEPLOYMENTEVENTID=V.EVENTID(+) AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, ABG.AIRBAGID, ABG.AIRBAGNUM, SUBSTR(QAVAIL.OPTIONTEXT,1,30) AS AIRBAGEVERAVAILABLE, QLOCATION.OPTIONTEXT, SUBSTR(DECODE(QLOCATION.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QLOCATION.OPTIONTEXT),1,60) AS LOCATION, QFUNC.OPTIONTEXT, SUBSTR(DECODE(QFUNC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFUNC.OPTIONTEXT),1,60) AS STATUS, ABGTYPE.AIRBAGNAME, DECODE(ABGTYPE.AIRBAGNAME,NULL,'NO AIRBAG AVAILABLE',ABGTYPE.AIRBAGNAME) AS TYPEOFAIRBAG, DECODE(DEPOWER.DESCRIPTION,NULL,'NO AIRBAG AVAILABLE',DEPOWER.DESCRIPTION) AS REDESIGNEDCLASS, SUBSTR(DECODE(QDEPLOY.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDEPLOY.OPTIONTEXT),1,60) AS SYSTEMDEPLOYMENT, SUBSTR(DECODE(QFAIL.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFAIL.OPTIONTEXT),1,60) AS INDICATIONSOFFAILURE, SUBSTR(DECODE(QSWITCHTYPE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHTYPE.OPTIONTEXT),1,60) AS SWITCHTYPE, SUBSTR(DECODE(QSWITCHST.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHST.OPTIONTEXT),1,60) AS SWITCHSTATUS, SUBSTR(DECODE(QFLAPO.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPO.OPTIONTEXT),1,60) AS MODULECOVERFLAPOPENATTEAR, SUBSTR(DECODE(QFLAPD.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPD.OPTIONTEXT),1,60) AS MODULECOVERFLAPDAMAGED, QDAMAGE.OPTIONTEXT, SUBSTR(DECODE(QDAMAGE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDAMAGE.OPTIONTEXT),1,60) AS DAMAGETOAIRBAG, QSOURCE.OPTIONTEXT, SUBSTR(DECODE(QSOURCE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSOURCE.OPTIONTEXT),1,60) AS SOURCEOFDAMAGE, ABG.NUMOFTETHERSTRAPS, DECODE(ABG.NUMOFTETHERSTRAPS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFTETHERSTRAPS) AS NUMOFTETHERS, ABG.NUMOFVENTPORTS, DECODE(ABG.NUMOFVENTPORTS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFVENTPORTS) AS NUMOFVENTPORTS, QACC.OPTIONTEXT, SUBSTR(DECODE(QACC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QACC.OPTIONTEXT),1,60) AS VEHICLEPREVIOUSACCIDENTS, QMAINT.OPTIONTEXT, SUBSTR(DECODE(QMAINT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QMAINT.OPTIONTEXT),1,60) AS PRIORMAINTENANCESERVICE, DECODE(TO_CHAR(V.EVENTID),NULL,'NO AIRBAG AVAILABLE',V.EVENTID) AS DEPLOYEVENTID, DECODE(TO_CHAR(V.EVENTNO),NULL,'NO AIRBAG AVAILABLE',V.EVENTNO) AS DEPLOYEVENTNO, V.TOTAL, DECODE(V.TOTAL,NULL,'NO AIRBAG AVAILABLE',V.TOTAL) AS DELTAV_TOTAL, V.LONGTDL, DECODE(V.LONGTDL,NULL,'NO AIRBAG AVAILABLE',V.LONGTDL) AS DELTAV_LONGTDL, V.LATERAL, DECODE(V.LATERAL,NULL,'NO AIRBAG AVAILABLE',V.LATERAL) AS DELTAV_LATERAL, V.ENERGY, DECODE(V.ENERGY,NULL,'NO AIRBAG AVAILABLE',V.ENERGY) AS DELTAV_ENERGY, V.IMPACT, DECODE(V.IMPACT,NULL,'NO AIRBAG AVAILABLE',V.IMPACT) AS DELTAV_IMPACT, V.BARRIER, DECODE(V.BARRIER,NULL,'NO AIRBAG AVAILABLE',V.BARRIER) AS DELTAV_BARRIER, V.ESTIMATED, SUBSTR(DECODE(V.ESTIMATED,NULL,'NO AIRBAG AVAILABLE',V.ESTIMATED),1,60) AS DELTAV_ESTIMATED, QDELTAV.OPTIONTEXT, SUBSTR(DECODE(QDELTAV.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDELTAV.OPTIONTEXT),1,60) AS CDCFORDEPLOYMENTIMPACT, QCONTACT.OPTIONTEXT, SUBSTR(DECODE(QCONTACT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QCONTACT.OPTIONTEXT),1,60) AS CONTACTEDOTHEROCCUPANT, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, NASS.SEATLOC S, NASS.AIRBAG ABG, NASS.QUESTIONLOOKUP QLOCATION, NASS.AIRBAGTYPELOOKUP ABGTYPE, NASS.QUESTIONLOOKUP QAVAIL, NASS.QUESTIONLOOKUP QDAMAGE, NASS.QUESTIONLOOKUP QDEPLOY, NASS.QUESTIONLOOKUP QFAIL, NASS.QUESTIONLOOKUP QDELTAV, NASS.QUESTIONLOOKUP QCONTACT, NASS.QUESTIONLOOKUP QFLAPD, NASS.QUESTIONLOOKUP QFLAPO, NASS.QUESTIONLOOKUP QSOURCE, NASS.QUESTIONLOOKUP QACC, NASS.QUESTIONLOOKUP QMAINT, NASS.QUESTIONLOOKUP QFUNC, NASS.DEPOWERLOOKUP DEPOWER, NASS.QUESTIONLOOKUP QSWITCHTYPE, NASS.QUESTIONLOOKUP QSWITCHST, CIREN_WH.C_IMPACT V, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=S.CASEID(+) AND C.VEHICLEID=S.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEATLOCID=S.SEATLOCID AND S.CASEID=ABG.CASEID(+) AND S.VEHICLEID=ABG.VEHICLEID(+) AND S.SEATLOCID=ABG.SEATLOCID(+) AND QLOCATION.OPTIONVALUE(+)=TO_CHAR(ABG.PICKLOCATION) AND QLOCATION.DATAITEMID(+)=1228 AND ABGTYPE.AIRBAGCLASSID(+)=ABG.PICKAIRBAGCLASSID AND QAVAIL.OPTIONVALUE(+)=TO_CHAR(S.AIRBAGAVAIL) AND QAVAIL.DATAITEMID(+)=1790 AND S.AIRBAGAVAIL=2 AND QDAMAGE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDAMAGE) AND QDAMAGE.DATAITEMID(+)=1226 AND QDEPLOY.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDEPLOY) AND QDEPLOY.DATAITEMID(+)=1216 AND QFAIL.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFAILURE) AND QFAIL.DATAITEMID(+)=1221 AND QDELTAV.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCDCIMPACTDELTAV) AND QDELTAV.DATAITEMID(+)=1218 AND QCONTACT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCONTACTOTHEROCCUPANT) AND QCONTACT.DATAITEMID(+)=1241 AND QFLAPD.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSDAMAGE) AND QFLAPD.DATAITEMID(+)=1224 AND QFLAPO.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSOPEN) AND QFLAPO.DATAITEMID(+)=1222 AND QSOURCE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKSOURCEOFDAMAGE) AND QSOURCE.DATAITEMID(+)=1227 AND QACC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORACCIDENT) AND QACC.DATAITEMID(+)=1232 AND QMAINT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORMAINTENANCE) AND QMAINT.DATAITEMID(+)=1234 AND QFUNC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFUNCTION) AND QFUNC.DATAITEMID(+)=1215 AND DEPOWER.DEPOWERID(+)=ABG.DEPOWERID AND QSWITCHTYPE.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHTYPE) AND QSWITCHTYPE.DATAITEMID(+)=3021 AND QSWITCHST.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHSTATUS) AND QSWITCHST.DATAITEMID(+)=3022 AND ABG.DEPLOYMENTEVENTID=V.EVENTID(+) AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, ABG.AIRBAGID, ABG.AIRBAGNUM, SUBSTR(QAVAIL.OPTIONTEXT,1,30) AS AIRBAGEVERAVAILABLE, QLOCATION.OPTIONTEXT, SUBSTR(DECODE(QLOCATION.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QLOCATION.OPTIONTEXT),1,60) AS LOCATION, QFUNC.OPTIONTEXT, SUBSTR(DECODE(QFUNC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFUNC.OPTIONTEXT),1,60) AS STATUS, ABGTYPE.AIRBAGNAME, DECODE(ABGTYPE.AIRBAGNAME,NULL,'NO AIRBAG AVAILABLE',ABGTYPE.AIRBAGNAME) AS TYPEOFAIRBAG, DECODE(DEPOWER.DESCRIPTION,NULL,'NO AIRBAG AVAILABLE',DEPOWER.DESCRIPTION) AS REDESIGNEDCLASS, SUBSTR(DECODE(QDEPLOY.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDEPLOY.OPTIONTEXT),1,60) AS SYSTEMDEPLOYMENT, SUBSTR(DECODE(QFAIL.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFAIL.OPTIONTEXT),1,60) AS INDICATIONSOFFAILURE, SUBSTR(DECODE(QSWITCHTYPE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHTYPE.OPTIONTEXT),1,60) AS SWITCHTYPE, SUBSTR(DECODE(QSWITCHST.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHST.OPTIONTEXT),1,60) AS SWITCHSTATUS, SUBSTR(DECODE(QFLAPO.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPO.OPTIONTEXT),1,60) AS MODULECOVERFLAPOPENATTEAR, SUBSTR(DECODE(QFLAPD.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPD.OPTIONTEXT),1,60) AS MODULECOVERFLAPDAMAGED, QDAMAGE.OPTIONTEXT, SUBSTR(DECODE(QDAMAGE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDAMAGE.OPTIONTEXT),1,60) AS DAMAGETOAIRBAG, QSOURCE.OPTIONTEXT, SUBSTR(DECODE(QSOURCE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSOURCE.OPTIONTEXT),1,60) AS SOURCEOFDAMAGE, ABG.NUMOFTETHERSTRAPS, DECODE(ABG.NUMOFTETHERSTRAPS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFTETHERSTRAPS) AS NUMOFTETHERS, ABG.NUMOFVENTPORTS, DECODE(ABG.NUMOFVENTPORTS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFVENTPORTS) AS NUMOFVENTPORTS, QACC.OPTIONTEXT, SUBSTR(DECODE(QACC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QACC.OPTIONTEXT),1,60) AS VEHICLEPREVIOUSACCIDENTS, QMAINT.OPTIONTEXT, SUBSTR(DECODE(QMAINT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QMAINT.OPTIONTEXT),1,60) AS PRIORMAINTENANCESERVICE, DECODE(TO_CHAR(V.EVENTID),NULL,'NO AIRBAG AVAILABLE',V.EVENTID) AS DEPLOYEVENTID, DECODE(TO_CHAR(V.EVENTNO),NULL,'NO AIRBAG AVAILABLE',V.EVENTNO) AS DEPLOYEVENTNO, V.TOTAL, DECODE(V.TOTAL,NULL,'NO AIRBAG AVAILABLE',V.TOTAL) AS DELTAV_TOTAL, V.LONGTDL, DECODE(V.LONGTDL,NULL,'NO AIRBAG AVAILABLE',V.LONGTDL) AS DELTAV_LONGTDL, V.LATERAL, DECODE(V.LATERAL,NULL,'NO AIRBAG AVAILABLE',V.LATERAL) AS DELTAV_LATERAL, V.ENERGY, DECODE(V.ENERGY,NULL,'NO AIRBAG AVAILABLE',V.ENERGY) AS DELTAV_ENERGY, V.IMPACT, DECODE(V.IMPACT,NULL,'NO AIRBAG AVAILABLE',V.IMPACT) AS DELTAV_IMPACT, V.BARRIER, DECODE(V.BARRIER,NULL,'NO AIRBAG AVAILABLE',V.BARRIER) AS DELTAV_BARRIER, V.ESTIMATED, SUBSTR(DECODE(V.ESTIMATED,NULL,'NO AIRBAG AVAILABLE',V.ESTIMATED),1,60) AS DELTAV_ESTIMATED, QDELTAV.OPTIONTEXT, SUBSTR(DECODE(QDELTAV.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDELTAV.OPTIONTEXT),1,60) AS CDCFORDEPLOYMENTIMPACT, QCONTACT.OPTIONTEXT, SUBSTR(DECODE(QCONTACT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QCONTACT.OPTIONTEXT),1,60) AS CONTACTEDOTHEROCCUPANT, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, NASS.SEATLOC S, NASS.AIRBAG ABG, NASS.QUESTIONLOOKUP QLOCATION, NASS.AIRBAGTYPELOOKUP ABGTYPE, NASS.QUESTIONLOOKUP QAVAIL, NASS.QUESTIONLOOKUP QDAMAGE, NASS.QUESTIONLOOKUP QDEPLOY, NASS.QUESTIONLOOKUP QFAIL, NASS.QUESTIONLOOKUP QDELTAV, NASS.QUESTIONLOOKUP QCONTACT, NASS.QUESTIONLOOKUP QFLAPD, NASS.QUESTIONLOOKUP QFLAPO, NASS.QUESTIONLOOKUP QSOURCE, NASS.QUESTIONLOOKUP QACC, NASS.QUESTIONLOOKUP QMAINT, NASS.QUESTIONLOOKUP QFUNC, NASS.DEPOWERLOOKUP DEPOWER, NASS.QUESTIONLOOKUP QSWITCHTYPE, NASS.QUESTIONLOOKUP QSWITCHST, CIREN_WH.C_IMPACT V, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=S.CASEID(+) AND C.VEHICLEID=S.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEATLOCID=S.SEATLOCID AND S.CASEID=ABG.CASEID(+) AND S.VEHICLEID=ABG.VEHICLEID(+) AND S.SEATLOCID=ABG.SEATLOCID(+) AND QLOCATION.OPTIONVALUE(+)=TO_CHAR(ABG.PICKLOCATION) AND QLOCATION.DATAITEMID(+)=1228 AND ABGTYPE.AIRBAGCLASSID(+)=ABG.PICKAIRBAGCLASSID AND QAVAIL.OPTIONVALUE(+)=TO_CHAR(S.AIRBAGAVAIL) AND QAVAIL.DATAITEMID(+)=1790 AND S.AIRBAGAVAIL=3 AND QDAMAGE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDAMAGE) AND QDAMAGE.DATAITEMID(+)=1226 AND QDEPLOY.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDEPLOY) AND QDEPLOY.DATAITEMID(+)=1216 AND QFAIL.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFAILURE) AND QFAIL.DATAITEMID(+)=1221 AND QDELTAV.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCDCIMPACTDELTAV) AND QDELTAV.DATAITEMID(+)=1218 AND QCONTACT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCONTACTOTHEROCCUPANT) AND QCONTACT.DATAITEMID(+)=1241 AND QFLAPD.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSDAMAGE) AND QFLAPD.DATAITEMID(+)=1224 AND QFLAPO.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSOPEN) AND QFLAPO.DATAITEMID(+)=1222 AND QSOURCE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKSOURCEOFDAMAGE) AND QSOURCE.DATAITEMID(+)=1227 AND QACC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORACCIDENT) AND QACC.DATAITEMID(+)=1232 AND QMAINT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORMAINTENANCE) AND QMAINT.DATAITEMID(+)=1234 AND QFUNC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFUNCTION) AND QFUNC.DATAITEMID(+)=1215 AND DEPOWER.DEPOWERID(+)=ABG.DEPOWERID AND QSWITCHTYPE.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHTYPE) AND QSWITCHTYPE.DATAITEMID(+)=3021 AND QSWITCHST.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHSTATUS) AND QSWITCHST.DATAITEMID(+)=3022 AND ABG.DEPLOYMENTEVENTID=V.EVENTID(+) AND NOR.ORGID=C.CENTERID UNION SELECT DISTINCT C.CIRENID, ABG.AIRBAGID, ABG.AIRBAGNUM, SUBSTR(QAVAIL.OPTIONTEXT,1,30) AS AIRBAGEVERAVAILABLE, QLOCATION.OPTIONTEXT, SUBSTR(DECODE(QLOCATION.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QLOCATION.OPTIONTEXT),1,60) AS LOCATION, QFUNC.OPTIONTEXT, SUBSTR(DECODE(QFUNC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFUNC.OPTIONTEXT),1,60) AS STATUS, ABGTYPE.AIRBAGNAME, DECODE(ABGTYPE.AIRBAGNAME,NULL,'NO AIRBAG AVAILABLE',ABGTYPE.AIRBAGNAME) AS TYPEOFAIRBAG, DECODE(DEPOWER.DESCRIPTION,NULL,'NO AIRBAG AVAILABLE',DEPOWER.DESCRIPTION) AS REDESIGNEDCLASS, SUBSTR(DECODE(QDEPLOY.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDEPLOY.OPTIONTEXT),1,60) AS SYSTEMDEPLOYMENT, SUBSTR(DECODE(QFAIL.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFAIL.OPTIONTEXT),1,60) AS INDICATIONSOFFAILURE, SUBSTR(DECODE(QSWITCHTYPE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHTYPE.OPTIONTEXT),1,60) AS SWITCHTYPE, SUBSTR(DECODE(QSWITCHST.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSWITCHST.OPTIONTEXT),1,60) AS SWITCHSTATUS, SUBSTR(DECODE(QFLAPO.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPO.OPTIONTEXT),1,60) AS MODULECOVERFLAPOPENATTEAR, SUBSTR(DECODE(QFLAPD.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QFLAPD.OPTIONTEXT),1,60) AS MODULECOVERFLAPDAMAGED, QDAMAGE.OPTIONTEXT, SUBSTR(DECODE(QDAMAGE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDAMAGE.OPTIONTEXT),1,60) AS DAMAGETOAIRBAG, QSOURCE.OPTIONTEXT, SUBSTR(DECODE(QSOURCE.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QSOURCE.OPTIONTEXT),1,60) AS SOURCEOFDAMAGE, ABG.NUMOFTETHERSTRAPS, DECODE(ABG.NUMOFTETHERSTRAPS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFTETHERSTRAPS) AS NUMOFTETHERS, ABG.NUMOFVENTPORTS, DECODE(ABG.NUMOFVENTPORTS,-8888,'NA',-9999,'UNKNOWN',NULL,'NO AIRBAG AVAILABLE',ABG.NUMOFVENTPORTS) AS NUMOFVENTPORTS, QACC.OPTIONTEXT, SUBSTR(DECODE(QACC.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QACC.OPTIONTEXT),1,60) AS VEHICLEPREVIOUSACCIDENTS, QMAINT.OPTIONTEXT, SUBSTR(DECODE(QMAINT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QMAINT.OPTIONTEXT),1,60) AS PRIORMAINTENANCESERVICE, DECODE(TO_CHAR(V.EVENTID),NULL,'NO AIRBAG AVAILABLE',V.EVENTID) AS DEPLOYEVENTID, DECODE(TO_CHAR(V.EVENTNO),NULL,'NO AIRBAG AVAILABLE',V.EVENTNO) AS DEPLOYEVENTNO, V.TOTAL, DECODE(V.TOTAL,NULL,'NO AIRBAG AVAILABLE',V.TOTAL) AS DELTAV_TOTAL, V.LONGTDL, DECODE(V.LONGTDL,NULL,'NO AIRBAG AVAILABLE',V.LONGTDL) AS DELTAV_LONGTDL, V.LATERAL, DECODE(V.LATERAL,NULL,'NO AIRBAG AVAILABLE',V.LATERAL) AS DELTAV_LATERAL, V.ENERGY, DECODE(V.ENERGY,NULL,'NO AIRBAG AVAILABLE',V.ENERGY) AS DELTAV_ENERGY, V.IMPACT, DECODE(V.IMPACT,NULL,'NO AIRBAG AVAILABLE',V.IMPACT) AS DELTAV_IMPACT, V.BARRIER, DECODE(V.BARRIER,NULL,'NO AIRBAG AVAILABLE',V.BARRIER) AS DELTAV_BARRIER, V.ESTIMATED, SUBSTR(DECODE(V.ESTIMATED,NULL,'NO AIRBAG AVAILABLE',V.ESTIMATED),1,60) AS DELTAV_ESTIMATED, QDELTAV.OPTIONTEXT, SUBSTR(DECODE(QDELTAV.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QDELTAV.OPTIONTEXT),1,60) AS CDCFORDEPLOYMENTIMPACT, QCONTACT.OPTIONTEXT, SUBSTR(DECODE(QCONTACT.OPTIONTEXT,NULL,'NO AIRBAG AVAILABLE',QCONTACT.OPTIONTEXT),1,60) AS CONTACTEDOTHEROCCUPANT, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, NASS.SEATLOC S, NASS.AIRBAG ABG, NASS.QUESTIONLOOKUP QLOCATION, NASS.AIRBAGTYPELOOKUP ABGTYPE, NASS.QUESTIONLOOKUP QAVAIL, NASS.QUESTIONLOOKUP QDAMAGE, NASS.QUESTIONLOOKUP QDEPLOY, NASS.QUESTIONLOOKUP QFAIL, NASS.QUESTIONLOOKUP QDELTAV, NASS.QUESTIONLOOKUP QCONTACT, NASS.QUESTIONLOOKUP QFLAPD, NASS.QUESTIONLOOKUP QFLAPO, NASS.QUESTIONLOOKUP QSOURCE, NASS.QUESTIONLOOKUP QACC, NASS.QUESTIONLOOKUP QMAINT, NASS.QUESTIONLOOKUP QFUNC, NASS.DEPOWERLOOKUP DEPOWER, NASS.QUESTIONLOOKUP QSWITCHTYPE, NASS.QUESTIONLOOKUP QSWITCHST, CIREN_WH.C_IMPACT V, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=S.CASEID(+) AND C.VEHICLEID=S.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEATLOCID=S.SEATLOCID AND S.CASEID=ABG.CASEID(+) AND S.VEHICLEID=ABG.VEHICLEID(+) AND S.SEATLOCID=ABG.SEATLOCID(+) AND QLOCATION.OPTIONVALUE(+)=TO_CHAR(ABG.PICKLOCATION) AND QLOCATION.DATAITEMID(+)=1228 AND ABGTYPE.AIRBAGCLASSID(+)=ABG.PICKAIRBAGCLASSID AND QAVAIL.OPTIONVALUE(+)=TO_CHAR(S.AIRBAGAVAIL) AND QAVAIL.DATAITEMID(+)=1790 AND S.AIRBAGAVAIL IS NULL AND QDAMAGE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDAMAGE) AND QDAMAGE.DATAITEMID(+)=1226 AND QDEPLOY.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDEPLOY) AND QDEPLOY.DATAITEMID(+)=1216 AND QFAIL.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFAILURE) AND QFAIL.DATAITEMID(+)=1221 AND QDELTAV.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCDCIMPACTDELTAV) AND QDELTAV.DATAITEMID(+)=1218 AND QCONTACT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCONTACTOTHEROCCUPANT) AND QCONTACT.DATAITEMID(+)=1241 AND QFLAPD.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSDAMAGE) AND QFLAPD.DATAITEMID(+)=1224 AND QFLAPO.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSOPEN) AND QFLAPO.DATAITEMID(+)=1222 AND QSOURCE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKSOURCEOFDAMAGE) AND QSOURCE.DATAITEMID(+)=1227 AND QACC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORACCIDENT) AND QACC.DATAITEMID(+)=1232 AND QMAINT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORMAINTENANCE) AND QMAINT.DATAITEMID(+)=1234 AND QFUNC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFUNCTION) AND QFUNC.DATAITEMID(+)=1215 AND DEPOWER.DEPOWERID(+)=ABG.DEPOWERID AND QSWITCHTYPE.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHTYPE) AND QSWITCHTYPE.DATAITEMID(+)=3021 AND QSWITCHST.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHSTATUS) AND QSWITCHST.DATAITEMID(+)=3022 AND ABG.DEPLOYMENTEVENTID=V.EVENTID(+) AND NOR.ORGID=C.CENTERID ; ") ; DEFINITION "S-BGP_AIRBAG" ; ABBREVIATION "INSERTS AN SQL PROGRAM STUB COMMAND") ; DOCUMENTATION (tempo-define-template "sql-bgp_airbag_nondeployed_optiontext_revelation" ; TEMPLATE NAME '("--*BGP_AIRBAG_NONDEPLOYED_OPTIONTEXT_REVELATION IS HUGELY IMPORTANT SINCE I FOUND I COULD SHTICK IN OPTIONTEXT ON-THE-FLY--INSTEAD OF OPTIONVALUE--IN SOME CASE AT LEAST I GUESS... --CREATE OR REPLACE VIEW BGP_AIRBAG_NONDEPLOYED_OPTIONTEXT_REVELATION AS --*NOTICE THE REALLY EXCITING LAST TWO LINES OF THIS PROGRAM--THE OPTIONVALUE CONSTRAINT IS 2 AND THEN I USE THE OPTIONTEXT CONSTRAINT METHOD TOO--VERY INSTRUCTIVE. SELECT DISTINCT C.CIRENID, C.VEHICLEID, ABG.PICKAIRBAGDEPLOY, UPPER(SUBSTR(QDEPLOY.OPTIONTEXT,1,80)) AS PICKAIRBAGDEPLOY_OPTIONTEXT, C.CASEID, C.CIRENNUMBER CIRENNUMBER, S.SEATLOCID SEATLOCID, ABG.AIRBAGID AIRBAGID, ABG.AIRBAGNUM AIRBAG, SUBSTR(QAVAIL.OPTIONTEXT,1,30) AS AIRBAGEVERAVAILABLE_OPTIONTEXT, SUBSTR(ORGTITLE,1,35) AS ORGANIZATION FROM CIREN.CIREN_CASE C, NASS.OCCUPANT O, NASS.SEATLOC S, NASS.AIRBAG ABG, NASS.QUESTIONLOOKUP QLOCATION, NASS.AIRBAGTYPELOOKUP ABGTYPE, NASS.QUESTIONLOOKUP QAVAIL, NASS.QUESTIONLOOKUP QDAMAGE, NASS.QUESTIONLOOKUP QDEPLOY, NASS.QUESTIONLOOKUP QFAIL, NASS.QUESTIONLOOKUP QDELTAV, NASS.QUESTIONLOOKUP QCONTACT, NASS.QUESTIONLOOKUP QFLAPD, NASS.QUESTIONLOOKUP QFLAPO, NASS.QUESTIONLOOKUP QSOURCE, NASS.QUESTIONLOOKUP QACC, NASS.QUESTIONLOOKUP QMAINT, NASS.QUESTIONLOOKUP QFUNC, NASS.DEPOWERLOOKUP DEPOWER, NASS.QUESTIONLOOKUP QSWITCHTYPE, NASS.QUESTIONLOOKUP QSWITCHST, CIREN_WH.C_IMPACT V, NASS.ORGANIZATION NOR WHERE C.CASEID > 0 AND C.OCCUPANTID > 0 AND C.CASEID=S.CASEID(+) AND C.VEHICLEID=S.VEHICLEID(+) AND C.OCCUPANTID=O.OCCUPANTID(+) AND O.SEATLOCID=S.SEATLOCID AND S.CASEID=ABG.CASEID(+) AND S.VEHICLEID=ABG.VEHICLEID(+) AND S.SEATLOCID=ABG.SEATLOCID(+) AND QLOCATION.OPTIONVALUE(+)=TO_CHAR(ABG.PICKLOCATION) AND QLOCATION.DATAITEMID(+)=1228 AND ABGTYPE.AIRBAGCLASSID(+)=ABG.PICKAIRBAGCLASSID AND QAVAIL.OPTIONVALUE(+)=TO_CHAR(S.AIRBAGAVAIL) AND QAVAIL.DATAITEMID(+)=1790 AND QDAMAGE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDAMAGE) AND QDAMAGE.DATAITEMID(+)=1226 AND QDEPLOY.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGDEPLOY) AND QDEPLOY.DATAITEMID(+)=1216 AND QFAIL.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFAILURE) AND QFAIL.DATAITEMID(+)=1221 AND QDELTAV.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCDCIMPACTDELTAV) AND QDELTAV.DATAITEMID(+)=1218 AND QCONTACT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCONTACTOTHEROCCUPANT) AND QCONTACT.DATAITEMID(+)=1241 AND QFLAPD.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSDAMAGE) AND QFLAPD.DATAITEMID(+)=1224 AND QFLAPO.OPTIONVALUE(+)=TO_CHAR(ABG.PICKCOVERFLAPSOPEN) AND QFLAPO.DATAITEMID(+)=1222 AND QSOURCE.OPTIONVALUE(+)=TO_CHAR(ABG.PICKSOURCEOFDAMAGE) AND QSOURCE.DATAITEMID(+)=1227 AND QACC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORACCIDENT) AND QACC.DATAITEMID(+)=1232 AND QMAINT.OPTIONVALUE(+)=TO_CHAR(ABG.PICKPRIORMAINTENANCE) AND QMAINT.DATAITEMID(+)=1234 AND QFUNC.OPTIONVALUE(+)=TO_CHAR(ABG.PICKAIRBAGFUNCTION) AND QFUNC.DATAITEMID(+)=1215 AND DEPOWER.DEPOWERID(+)=ABG.DEPOWERID AND QSWITCHTYPE.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHTYPE) AND QSWITCHTYPE.DATAITEMID(+)=3021 AND QSWITCHST.OPTIONVALUE(+)=TO_CHAR(ABG.SWITCHSTATUS) AND QSWITCHST.DATAITEMID(+)=3022 AND ABG.DEPLOYMENTEVENTID=V.EVENTID(+) AND NOR.ORGID=C.CENTERID AND S.AIRBAGAVAIL=2 AND UPPER(QDEPLOY.OPTIONTEXT) LIKE '%NONDEPLOY%' ; ") ; definition "sql-bgp_airbag_nondeployed_optiontext_revelation" ; abbreviation "Inserts an SQL program stub command") ; documentation (tempo-define-template "sql-bgp_drop-all-table-views" ; template name '("--*DOCUMENTATION-BLAH DROP VIEW BGP_ADMISSIONS; DROP VIEW BGP_AIRBAG; DROP VIEW BGP_ANTHRO DROP VIEW BGP_ANTHROID; DROP VIEW BGP_BELT_TYPE DROP VIEW BGP_BGP_ROOT_MIAMI_COMPLETED_CASES; DROP VIEW BGP_BOILERPLATE; DROP VIEW BGP_CASE_AUDIT; DROP VIEW BGP_CAUSE_OF_DEATH; DROP VIEW BGP_CHARGES; DROP VIEW BGP_CIRENID_CIRENNUMBER_CASEID; DROP VIEW BGP_CLOTHING; DROP VIEW BGP_COMORBIDITY; DROP VIEW BGP_COMPELLING_INJURIES; DROP VIEW BGP_CRASHDERIVED; DROP VIEW BGP_CRITERIA; DROP VIEW BGP_CRUSHPROFILE; DROP VIEW BGP_DAMAGELOCATOR; DROP VIEW BGP_DELTAV; DROP VIEW BGP_DEMOINFO; DROP VIEW BGP_EJECTION; DROP VIEW BGP_EJECTION_ENTRAPMENT; DROP VIEW BGP_EMSRESPONSE; DROP VIEW BGP_EMS_RSPNS_ACCDNT_MDCL; DROP VIEW BGP_EVENTS; DROP VIEW BGP_FEOL_AND_VOL DROP VIEW BGP_GCS; DROP VIEW BGP_GENERIC; DROP VIEW BGP_IMPACTS_ALL; DROP VIEW BGP_IMPACTS_ALL_FRONTALS; DROP VIEW BGP_IMPACTS_WORST; DROP VIEW BGP_INJURIES_AISCODES_AND_BODY_REGIONS; DROP VIEW BGP_INJURIES_AISC_TEXT; DROP VIEW BGP_INJURIES_AND_DESCRIPTIONS; DROP VIEW BGP_INJURY_CONTACT; DROP VIEW BGP_INJURY_INTRUSION; DROP VIEW BGP_INJURY_SEVERITY_CONTACT_COMPLETED_CASES_ONLY; DROP VIEW BGP_INJURY_SOURCE; DROP VIEW BGP_MAXAIS; DROP VIEW BGP_NASS-MV-MAXCRUSH; DROP VIEW BGP_OCCUPANT; DROP VIEW BGP_OUTCOME; DROP VIEW BGP_OVERLAP; DROP VIEW BGP_RESEARCHERS; DROP VIEW BGP_ROOT; DROP VIEW BGP_SEATLOC; DROP VIEW BGP_SUMMARIES; DROP VIEW BGP_VEHICLE; DROP VIEW BGP_VEHICLEROLLOVER; DROP VIEW BGP_VITALSIGNS; ") ; definition "s-jjj" ; abbreviation "Inserts an SQL program command") ; documentation ;*This is mainly a reminder program (uncomment it and use it iff you really get the hang of it) that may be useful too for reuse--its Class-Prototype.pm the idea is similar to the one I made above "BlahClass.pm"--the idea is to have a perl module that you reuse and is a quick and easy and excellent in the Damian conway tradition (see authors notes) that creates an excellent generic object oriented class in a standard/reusable/tempo-template sort-of-way. Keep this commented out unless you can find a way to make it useful in a tempo-template sort-of-way---but keep it in this file as a reminder that this sort of file is extremely useful (I made my own and so did the author of this module. ;; (tempo-define-template ;; "perl-bgp_Class-Prototype.pm" ; template name ;; '("--*DOCUMENTATION-BLAH ;; #===================================================================== ;; package Class::Prototype; ;; #===================================================================== ;; use strict; ;; use warnings; # turn off when you\'re ready ;; use Carp; ;; #===================================================================== ;; # Class::Prototype DATA ;; #===================================================================== ;; my $VERSION = 0.03; ;; { # keep the methods at Class::Prototype access level ;; #===================================================================== ;; # FAMILY WIDE METHODS ;; #===================================================================== ;; sub new { ;; my ( $caller ) = shift; ;; my ( %arg ) = @_; ;; my $class = ref($caller) || $caller; ;; croak \"Class::Prototype is a parent class only. You cannot \" . ;; \"create Class::Prototypes in it!\" ;; if $caller eq \'Class::Prototype\'; ;; my $ego = bless {}, $class; ;; # class initialization and object data, see POD for info222 ;; $ego->can(\'attributes\') ;; or croak \"$class has no attributes method defined! \", ;; \"See the Class::Prototype perldoc for details.\"; ;; $ego->{__attributes} = $ego->attributes(); ;; while ( my ( $attr, $val ) = each %{ $ego->{__attributes} } ) { ;; my ( $default, $access ) = @{$val}; ;; my $type = ref $default || \'scalar\'; ;; $type = \'scalar\' if $type eq \'Regexp\'; ;; my ( $method ) = $attr =~ /^_([a-zA-Z]\w*)$/; ;; croak \"Bad attribute name, $attr, in attributes \", ;; \"(must have an underscore prefix)!\n\" unless $method; ;; my $value; ;; if ( $access eq \'readonly\') { # only the default ;; $value = $default; ;; } ;; else # if an arg is given, use it, otherwise default ;; { ;; $value = defined $arg{$method} ? ;; $arg{$method} : $default; ;; } ;; # auto-install method unless the package already defines it ;; $ego->_install_method($method, $access, $type, $value) ;; unless $ego->can($method); ;; } ;; # Allow children to get in on building the object if they want to do ;; # more than simple attribute loading ;; $ego->can(\"new_hook\") and $ego->new_hook(@_); ;; # object is built, methods made, defaults installed so...? ;; delete $ego->{__attributes}; ;; return $ego; ;; } ;; #===================================================================== ;; sub _install_method { ;; my ( $ego, $method, $access, $type, $value ) = @_; ;; my $attr = \"_$method\"; ;; no strict \'refs\'; # can\'t typeglob subs correctly otherwise ;; no warnings; # pointless unitialized warnings ;; print ;; \"Installing method: $method()\n\", ;; \" access: $access\n\", ;; \" value: \", defined $value ? $value : \'UNDEF\', ;; \"\n type: $type\n\n\" if $ego->verbosity() > 4; ;; if ( $type eq \'scalar\' ) { ;; # SCALARS ------------------------------------------------------------ ;; # ---- attribute is write once or readonly, NOTE *if* CLAUSE AT END ;; *{\"$class::$method\"} = sub { ;; my($ego,$arg) = @_; ;; if ( defined $ego->{$attr} ) { ;; # complain if trying to set again ;; carp \"You cannot reset $method() (to $arg), skipping!\" ;; if defined $arg; ;; # it\'s already set, so get ;; return $ego->{$attr}; ;; } ;; $ego->{$attr} = $arg; ;; } ;; if $access eq \'writeonce\' or $access eq \'readonly\'; ;; # ---- attribute is normal, set if given value, get otherwise ;; *{\"$class::$method\"} = sub { ;; my($ego,$arg) = @_; ;; $ego->{$attr} = $arg if defined $arg; ;; return $ego->{$attr} unless defined $arg; ;; } ;; if $access eq \'write\'; ;; # SCALARS ends ------------------------------------------------------- ;; } ;; elsif ( $type eq \'ARRAY\' ) { ;; # ARRAYS ------------------------------------------------------------- ;; # ---- regular arrays, shift or return all w/o arg, push w/ ;; *{\"$class::$method\"} = sub { ;; my($ego) = shift; ;; my $args = ref $_[0] eq \'ARRAY\' ? $_[0] : \@_; ;; unless ( @{$args} ) { ;; # scalar context: destructive while->next->element; list: get all ;; return wantarray ? ;; @{$ego->{$attr}} : shift(@{$ego->{$attr}}); ;; } ;; push(@{$ego->{$attr}}, @{$args}); ;; } ;; if $access eq \'write\'; ;; # ---- writeonce arrays, initialization is the value ;; *{\"$class::$method\"} = sub { ;; my($ego) = shift; ;; my $args = ref $_[0] eq \'ARRAY\' ? $_[0] : \@_; ;; if ( ref $ego->{$attr} and @{$ego->{$attr}} ) { ;; # complain if trying to set again ;; carp \"You cannot add values to $method(), skipping!\" ;; if ref $args and @{$args}; ;; # it\'s already set, so get ;; return wantarray ? @{$ego->{$attr}} : $ego->{$attr}; ;; } ;; $ego->{$attr} = $args; ;; } ;; if $access eq \'writeonce\'; ;; if ( $access eq \'readonly\' ) { ;; $ego->{$attr} = $value; ;; *{\"$class::$method\"} = sub { ;; my($ego) = shift; ;; carp \"Disregarded arguments sent to readonly $method()!\" ;; if @_; ;; return wantarray ? @{$ego->{$attr}} : $ego->{$attr}; ;; }; ;; return; ;; } ;; } ;; # ARRAYS ends ------------------------------------------------------- ;; elsif ( $type eq \'HASH\' ) { ;; # HASHES ------------------------------------------------------------- ;; # ---- we want a \"keys\" method no matter the type ------------------ ;; *{\"$class::\" . \"keys_$method\"} = sub { ;; my($ego) = shift; ;; return keys %{$ego->{$attr}}; ;; }; ;; # ---- regular hashes, set, get by key or return all w/o arg ;; *{\"$class::$method\"} = sub { ;; my($ego) = shift; ;; my $arg; ;; if ( ref $_[0] eq \'HASH\' ) # hasref to set new values ;; { ;; $arg = $_[0]; ;; } ;; elsif ( not @_ % 2 ) # plain list in pairs, turn to a hash(ref) ;; { ;; $arg = { @_ }; ;; } ;; else # plain arg to get value ;; { ;; return $ego->{$attr}{$_[0]}; ;; } ;; unless ( $arg ) { ;; # no args, so return the full hash ;; return wantarray ? ;; %{$ego->{$attr}} : $ego->{$attr}; ;; } ;; while ( my ($key,$value) = each %{$arg} ) { ;; $ego->{$attr}{$key} = $value; ;; } ;; } ;; if $access eq \'write\'; ;; # AND!! a delete method to go with it ;; *{\"$class::\" . \"delete_$method\"} = sub { ;; my($ego) = shift; ;; my $keys = ref $_[0] eq \'ARRAY\' ? $_[0] : @_; ;; for my $key ( @{$keys} ) { ;; delete $ego->{$attr}{$key}; ;; } ;; } ;; if $access eq \'write\'; ;; # ---- writeonce hashes, initialization is the value ----------------- ;; *{\"$class::$method\"} = sub { ;; my($ego) = shift; ;; my $args = ref $_[0] eq \'HASH\' ? $_[0] : {@_}; ;; print \"calling $method with @{$args}\n\"; ;; if ( ref $ego->{$attr} and %{$ego->{$attr}} ) { ;; # complain if trying to set again ;; carp \"You cannot add values to $method(), skipping!\" ;; if ref $args and %{$args}; ;; # it\'s already set, so get ;; return wantarray ? %{$ego->{$attr}} : $ego->{$attr}; ;; } ;; $ego->{$attr} = $args; ;; } ;; if $access eq \'writeonce\'; ;; if ( $access eq \'readonly\' ) { ;; $ego->{$attr} = $value; ;; *{\"$class::$method\"} = sub { ;; my($ego, @keys) = @_; ;; my @return_list; ;; if ( @keys ) { ;; push @return_list, $ego->{$attr}{$_} for @keys; ;; return wantarray ? @return_list : \@return_list; ;; } ;; return wantarray ? %{$ego->{$attr}} : $ego->{$attr}; ;; }; ;; return; ;; } ;; } ;; # HASHES ends ------------------------------------------------------- ;; # if we have been unable to auto install a method 321 ;; croak \"Non-existent method, \'$method,\' called!\n\" ;; unless $ego->can($method); ;; # unless $ego->can($method) at this point throw a croak ;; carp ;; \"Setting $attr via $method->($value)\n\" if $ego->verbosity() > 3; ;; $ego->$method($value); ;; } ;; #===================================================================== ;; sub show_attributes { ;; my ( $ego ) = @_; ;; return grep defined, map { /^_([a-zA-Z]\w*)$/ } keys %{$ego}; ;; } ;; #===================================================================== ;; sub _standard_attributes { ;; my ( $ego ) = @_; ;; croak \"Can\'t call _standard_attributes() post new()!\" ;; unless $ego->{__attributes}; ;; keys %{$ego->{__attributes}}; ;; } ;; #===================================================================== ;; sub _default_for { ;; my ( $ego, $attr ) = @_; ;; croak \"Can\'t call _default_for() post new()!\" ;; unless $ego->{__attributes}; ;; $ego->{__attributes}{$attr}[0]; ;; } ;; #===================================================================== ;; sub _writeable { ;; my ( $ego, $attr ) = @_; ;; $ego->{__attributes}{$attr}[1] eq \'write\'; ;; } ;; #===================================================================== ;; sub verbosity { ;; my ( $ego, $verbosity ) = @_; ;; # 0 (off) through 5 (max, not implemented) ;; return $ego->{__VERBOSITY} unless defined $verbosity; ;; carp \"Cannot set verbosity to \'$verbosity\'!\n\" ;; and return ;; unless $verbosity =~ /^[0-5]$/; ;; $ego->{__VERBOSITY} = $verbosity; ;; } ;; #===================================================================== ;; sub serial { ;; shift if ref($_[0]); ;; return unless @_; ;; join(\', \', @_[0..$#_-1]) . ;; (@_>2 ? \',\':\'\' ) . ;; (@_>1 ? (\' and \' . $_[-1]) : $_[-1]); ;; } ;; #===================================================================== ;; sub DESTROY { 1 } ;; #===================================================================== ;; sub dump { ;; # erase this i think ;; my ( $ego ) = shift; ;; while ( my ( $key, $value ) = each %{$ego} ) { ;; print \"$key --> $value\"; ;; } ;; } ;; #===================================================================== ;; }#==================================================================== ;; # Class::Prototype ENDS ;; #===================================================================== ;; 1; # let\'s eval true, shall we? ;; #===================================================================== ;; =pod ;; =head1 NAME ;; B ;; =head1 VERSION ;; 0.03 ;; =head1 ABSTRACT ;; Class::Prototype is an object oriented prototyping base class. It is ;; designed to throw together a module or family of modules quickly by ;; giving self-installed methods defined via the child class\'s ;; attributes() method. The types of methods which can be self-installed ;; cover 80-90% of what a typical OOP module does. Ie: making a hash ;; based object, installing attributes, and then getting, setting, ;; resetting, stacking, shifting those attributes. ;; Class::Prototype is not really intended for building production code. ;; The use of the code it generates is terse (set/get methods are one in ;; the same) and DWIM (do what I mean -- context determines behavior). As ;; such it will for some users \"not do what I expected\" and \"not work the ;; way I prefer.\" Class::Prototype code is also generally slower than ;; what you might code up by hand b/c it\'s installing its own methods as ;; it goes. Class::Prototype is for putting up a scaffolding of prototype ;; code that will work immediately and will be phased completely out as ;; development progresses. Class::Prototype is for jumping in and writing ;; code that works. ;; =head1 SYNOPSIS ;; =head2 Define your new class--must contain attributes() ;; #------------------------------------------------------------ ;; package Fish; ;; use base \'Class::Prototype\'; ;; #------------------------------------------------------------ ;; # set some lexical class data ;; my @family = qw( Loricariidae Balistidae Gobiidae ;; Syngnathidae Megachasmidae ); ;; my %sizes; ;; @sizes{@family} = qw( medium small small ;; tiny huge ); ;; #------------------------------------------------------------ ;; # set up the only method required to start coding, ;; # attributes(), which must be defined in this general format ;; sub attributes { ;; {# DEFAULT ACCESS ;; _favorite => [ undef, \'writeonce\' ], ;; _current_fish => [ undef, \'write\' ], ;; _family => [ \@family, \'readonly\' ], ;; _size => [ \%sizes, \'readonly\' ], ;; } ;; } ;; #------------------------------------------------------------ ;; 1; # save it in the @INC path as Fish.pm and we\'re ready! ;; =head2 Now use it in a script ;; use Fish; # <<-- your new class/module ;; #--------------------------------------------- ;; my $fish_obj = Fish->new(); ;; # set your favorite fish ;; $fish_obj->favorite(\"Kuhli Loach\"); ;; print \"Fish Chart:\n\"; ;; for my $fish ( sort $fish_obj->family ) { ;; printf \"%15s --> %s\n\", ;; $fish, $fish_obj->size($fish); ;; # keep track of last fish seen here ;; $fish_obj->current_fish($fish); ;; } ;; print \"The last fish family I saw was \", ;; $fish_obj->current_fish, \".\n\"; ;; # try to reset the \"writeonce\" favorite ;; $fish_obj->favorite(\"7 Gill Shark\"); ;; print \"My favorite fish is still the \", ;; $fish_obj->favorite, \".\n\"; ;; And you should get: ;; Fish Chart: ;; Balistidae --> small ;; Gobiidae --> small ;; Loricariidae --> medium ;; Megachasmidae --> huge ;; Syngnathidae --> tiny ;; The last fish family I saw was Syngnathidae. ;; You cannot reset favorite() (to 7 Gill Shark), skipping! at fish line 22 ;; My favorite fish is still the Kuhli Loach. ;; =head1 You give, you get ;; attributes() is just a wrapper for a hash reference which describes ;; your object\'s automated behavior. You can use scalars, arrays and ;; hashes in your object. ;; In your hash ref, you have keys (attributes) which point to 2 element ;; array ref of initialization information. Like so: ;; attribute => [ \'default value\', \'access\' ], ;; Access can be set to one of the following: ;; =over 5 ;; =item * readonly (default/initialization value is only value) ;; =item * writeonce (default, new(key=>\'value\'), or first !undef write) ;; =item * write (open to change as often as desired) ;; =back ;; Default values can be scalars (undef is acceptable default for a ;; scalar, especially a \"writeonce\" scalar), array refs, hash refs. So, ;; another sample attributes() method with examples: ;; sub attributes { ;; return { # DEFAULT ACCESS ;; scalar_attr => [ \'default value\', \'write\' ], ;; scalar_attr2 => [ undef, \'writeonce\' ], ;; array_attr => [ [], \'write\' ], ;; array_attr2 => [ [ 1 .. 99 ], \'readonly\' ], ;; hash_attr => [ { perl => \'rocks\', ;; ruby => \'rolls\', ;; java => \'hmm...\' }, \'readonly\' ], ;; hash_attr2 => [ {}, \'write\' ] ;; }; ;; } ;; =head2 What happens now? Methods are installed ;; Assuming the attribute name is \"my_attr,\" regardless of the default ;; data type or access, the method my_attr() is installed for your object ;; and behaves in the following ways. ;; =over 2 ;; =item * default is \'some string\' access is \'readonly\' ;; my_attr() has only one use. It is called to return the scalar \"some ;; string.\" If given an argument, it will carp() about it and not do ;; anything with it. ;; =item * default is \'some string\' access is \'writeonce\' ;; my_attr() can set its value one time only. NB: this b ;; initialization. Therefore given the default of \'some string\' it will ;; behave for the user like \"readonly.\" See the next one for the way you ;; want to use this. ;; =item * default is B access is \'writeonce\' ;; my_attr() is not set by the initialization (undef) so the user can set ;; it one time. After that, it\'s only get. It can be set in new() as ;; well. ;; my $obj = Subclass->new( my_attr => \'my only value\' ); ;; # or the equivalent ;; my $obj = Subclass->new(); ;; $obj->my_attr(\'my only value\'); ;; =item * default is \'some string\' access is \'write\' ;; my_attr() is get/set. Calling it without an arg, like $obj->my_attr(), ;; gets: \"some string.\" Calling it with an arg, like $obj->my_attr(\'new ;; string\'), updates the contents so the next call without an argument ;; will get: \"new string.\" ;; =item * default is [\'array\',\'ref\'] access is \'readonly\' ;; my_attr() is get only. In scalar context it returns the array ref, in ;; list context it dereferences it for you and returns the list. Carps if ;; given arguments. ;; =item * default is [\'array\',\'ref\'] access is \'writeonce\' ;; my_attr() can be passed an array or an array ref to store for future ;; gets once. After it is set, which can be in the call to new(), it ;; behaves as the \'readonly\' version above. ;; =item * default is [\'array\',\'ref\'] access is \'write\' ;; my_attr() is get/set, or in this case, return all or shift/push. ;; my @array = $obj->my_attr(); # list context, gets the list ;; my $element = $obj->my_attr(); # scalar, shifts off an element ;; so this would harmless iterate on the array\'s data ;; for my $element ( $obj->my_attr ) { ;; print $element, \"\n\"; ;; } ;; while this would empty the array one shift at a time: ;; while ( my $element = $obj->my_attr() ) { ;; print $element, \"\n\"; ;; } ;; And adding elements to the list is easy: ;; $obj->my_attr(@elements_to_append); ;; =item * default is a hash ref, any access type ;; keys_my_attr() is installed to get the list of keys to use like so: ;; for my $key ( sort $obj->keys_my_attr ) { ;; print \"$key -->> \", $obj->my_attr($key), \"\n\"; ;; } ;; There is no each_my_attr() style function. ;; =item * default is { hash => \'ref\' } access is \'readonly\' ;; The attributes() hash ref value is the only one possible. ;; keys_my_attr() gets keys, my_attr($key) gets values. ;; =item * default is { hash => \'ref\' } access is \'writeonce\' ;; I think you get the idea. ;; =item * default is { hash => \'ref\' } access is \'write\' ;; my_attr( $key => $value ) to set ;; =back ;; =head1 METHODS ;; =head2 Correction, no methods ;; Class::Prototype is a parent class. You cannot create objects in it ;; and you should never directly use its methods. ;; This means you will never do this: ;; use Class::Prototype; ;; You\'ll always use a subclass of it. Because if you try to do something ;; like ;; my $obj = Class::Prototype->new(); ;; You will get a croak along the lines of \"Class::Prototype is a parent ;; class only. You cannot create Class::Prototypes in it!\" ;; =head2 Subclass methods you start with ;; =over 3 ;; =item * my $obj = SubClass->new() ;; Obviously, we need a new() method and one is ready for you. It ;; controls the installation of the object from the attributes() method ;; you need to have in your subclass. ;; If you are worried about being limited by being unable to write your ;; own new(), there is a way to get in on the object initialization. If ;; you have a method called new_hook() in your subclass, ;; =item * $obj->verbosity() or $obj->verbosity($verbosity) ;; Set/get. A verbosity system of 0-5 is set up and used through the ;; method verbosity(). 0 means no extra info, 5 would mean everything. It ;; can be reset on the fly if given a 0-5 value. Implement your own: ;; sub method1 { ;; my ( $self, @args ) = @_; ;; warn \"method1() got \", join(\', \', @args), \".\n\" ;; if $self->verbosity >= 2; ;; #... do the rest of what you came to do ;; } ;; =item * $obj->show_attributes() ;; Returns an unsorted list of keys/attributes in your object but only ;; those keys that start with an underscore and a letter. This is the Class::Prototype ;; way of installing them. Eg, $self->{_touchiness}. If you add your own ;; attributes through hardcoded methods and you don\'t use this ;; convention, show_attributes() will not return them. So neither ;; $self->{__private_x_2} nor $self->{look_ma} would be found by ;; show_attributes(). ;; =back ;; =head2 Initializing the object specially with new_hook() ;; new_hook() is run on the object immediately after it is bless\'d and ;; before any methods are installed or default values are set. This means ;; you can define anything into your object you like before the automatic ;; installation runs. ;; Also note that if you have an attribute named xyz in your attributes() ;; but you also create an xyz() method in your subclass, the automatic ;; installation of xyz(), or its related methods, like keys_xyz() and ;; delete_xyz() for hash refs attributes, does not occur. Class::Prototype::new() ;; contains this: ;; # auto-install method unless the package already defines it ;; $ego->_install_method($method, $access, $type, $value) ;; unless $ego->can($method); ;; which does what you\'d expect -- skips the method installation if you ;; already defined a method by the same name. ;; This is so that you can drop in methods as you go which will replace ;; the automated ones. You can also take them back out to restore the ;; automatic behavior as long as the attribute remains in your attributes() ;; method. ;; =head1 Setting and getting all in one ;; Any attribute which is defined as \"write\" is set/get and any attribute ;; defined as \"writeonce\" is set-once/get. ;; =head2 Subclass POD writer ;; IT SHOULD WRITE ITS OWN POD WITH A COMPANION SCRIPT, to show the ;; methods the child will have. And either put it to STDOUT or append it ;; to the .pm in question. ;; =head1 THANKS ;; Anyone who owns \"Object Oriented Perl,\" Damian Conway, 1884777791, ;; already knows this module is heavily based on techniques therein. ;; Anyone who hasn\'t dropped Mr. Conway a line just to say, \"Thank you ;; for your Perl work and advocacy,\" should. ;; =head1 COPYRIGHT ;; (c)2002-2003 Ashley Pond V, ashley@cpan.org, all rights reserved; ;; modify and redistribute under the same terms as Perl. ;; =cut ;; ") ; definition ;; "s" ; abbreviation ;; "Inserts a PERL module program") ; documentation ;*The following template/snippet will be place at the top of a html/xhtml index.html page and it will allow a web-page viewer to view and navigate a huge webpage with simple (the usual u-d-n-p (up-down-next-previous)) keys--after typing the "?" to see the set of keys that can be used (of course org-info.js and stylesheet.css are called here so they need to be handy---and this also requires a table of contents section (so an example is included below)--but the table of contents section may be hidden): (tempo-define-template "javascript-bgp_xhtml-generally-used-to-run-org-info.js" ; template name '(" EMACS ORG-INFO.JS

EMACS ORG-INFO.JS

1 The Name of the Game

First of all: Press `?´ for a list of available shortcuts.

The aim of this little script is to implement a part of emacs facilities of folding in the HTML-exported files.

....etc.....see ~/n/n/lib/javascript/legito.net/org-info-js/index.html for entire body

Author: Sebastian Rose <sebastian_rose@gmx.de>

Date: 2008/03/31 14:11:16

") ; definition "s" ; abbreviation "Inserts an XHTML document which calls a JAVASCRIPT program it will allow a web-page viewer to view and navigate a huge webpage with simple u-d-n-p keys") ; documentation (tempo-define-template "javascript-bgp_xhtml-roll-6-sided-die" ; template name '(" Roll a 6 sided die using JAVASCRIPT
") ; definition "s" ; abbreviation "Inserts an HTML document which calls a JAVASCRIPT program it will allow a web-page viewer to view and navigate a huge webpage with simple u-d-n-p keys") ; documentation ;*The following template/snippet requires (tempo-define-template "javascript-bgp_xhtml-worldkit-swf-globe-Flash" ; template name '(" ") ; definition "s" ; abbreviation "Inserts an HTML document which calls/embeds the .SWF/Flash program worldkit.swf ") ; documentation ;*The following template/snippet requires (tempo-define-template "html-bgp_build-interactive-Flash-maps-from-arbitrary-data-sources-in-RSS-or-RDF" ; template name '("
Submit ") ; definition "s" ; abbreviation "The HTML above invokes RDFMapper to map the contents of this RDF file. It sends a set of key-value pairs to the web service, which returns a map in .swf (Macromedia Flash) format. ") ; documentation ;*The following template/snippet requires (tempo-define-template "ruby-bgp_hello-world" ; template name '(" # The Greeter class class Greeter def initialize(name) @name = name.capitalize end def salute puts \"Hello #{@name}!\" end end # Create a new object g = Greeter.new(\"world\") # Output \"Hello World!\" g.salute ") ; definition "s" ; abbreviation "Hello World for RUBY scripting language. ") ; documentation (tempo-define-template "perl-bgp_acme-bleach-clean-code" ; template name '("#!/usr/bin/perl -w # File: Acme-Bleach-perl-module_hello-world-example.pl # # Authors: Brian Powell (bpowell@127.0.0.1) # # Description: Example of PERL program using the Acme::Bleach PERL module. # # This program will run only once and then most of it will disappear. # eval 'exec /iw/perl/current/bin/perl -s $0 ${1+\\\"$@\\\"}' if 0; # Limit the scope. use diagnostics; use strict; use warnings; use vars qw($VERSION $RELEASE $HTML_OUTPUT); # This will be printed once: print \"Hello world!\\n\\n\\n\"; # The star of this example show: Acme::Bleach print \"This programs absolute path: $0\\n\"; print \"This is the last flawless run of this program.\\n\"; print \"It will now self-destruct!\\n\"; system(\"echo \\\"use Acme::Bleach;\\\" >> $0 \"); ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program.") ; documentation;; (tempo-define-template "perl-bgp_vnc-perl-module-simple-client" ; template name '("#!/usr/bin/perl -w # File: /vnc-perl-module-simple-client.pl # # Authors: Brian Powell (bpowell@127.0.0.1) # # Description: Example of PERL program using the Net::VNC PERL module. # # This program will collect .png files of a VNC session. # eval 'exec /iw/perl/current/bin/perl -s $0 ${1+\\\"$@\\\"}' if 0; # Limit the scope. use diagnostics; use strict; use warnings; use Net::VNC; use vars qw($VERSION $RELEASE $HTML_OUTPUT); my $vnc = Net::VNC->new({hostname => $hostname, password => $password}); $vnc->depth(24); $vnc->login; print $vnc->name . \": \" . $vnc->width . ' x ' . $vnc->height . \"\\n\"; #*Captures the screen of the remote computer, returning an Image::Imlib2 object: my $image = $vnc->capture; $image->save(\"out.png\"); #*You may call capture() multiple times. Each time, the $image buffer is # overwritten with the updated screen. So, to create a series of ten screen # shots: for my $n (1..10) { my $filename = sprintf 'snapshot%02d.png', $n++; $vnc->capture()->save($filename); print \"Wrote $filename\\n\"; } ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program.") ; documentation;; ;*The following snippet is a php program which creates KML and then brings up GOOGLEEARTH. (tempo-define-template "php-bgp_kml-and-googleearth" ; template name #'("#<#?#p#h#p #header(\"Content-type: application/vnd.google-earth.kml+xml\"); # echo \"<#?#xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"; echo \"\\n\"; echo \"\\n\"; $lat = $_GET['lat']; $long = $_GET['long']; $place = $_GET['place']; $group = $_GET['group']; $link = $_SERVER['HTTP_REFERER']; echo \"\\n\"; echo \" lat: $lat, long: $long
$place ]]>
\\n\"; echo \"$place\\n\"; echo \"\\n\"; echo \"$long\\n\"; echo \"$lat\\n\"; echo \"5000.00\\n\"; echo \"20.0\\n\"; echo \"0\\n\"; echo \"\\n\"; echo \"0\\n\"; echo \"\\n\"; echo \"1\\n\"; echo \"relativeToGround\\n\"; echo \"$long,$lat\\n\"; echo \"\\n\"; echo \"
\\n\"; echo \"
\\n\"; echo \"
\\n\"; ?> ") ; definition "s-jj" ; abbreviation "The following snippet is a php program which creates KML and then brings up GOOGLEEARTH.") ; documentation ;**The following is similar to the above but each headline appears as before but this time it is enumerated: (tempo-define-template "makefile-bgp_kuul-makefile-one-liners" ; template name '(" # find all the java files $(shell find . -name '*.java') # convert java file into fully qualified name $(subst /,.,$(patsubst %.java,,$(sources))) $(subst /,.,$(subst %.java,,$(sources))) # determine if there are duplicate programs in the path. $(shell find $(subst :, ,$(PATH)) -name ls) # A non-caching replacement for wildcard. file-exists = $(shell test -e $1 && echo $1) # Generate an output file name. RELEASE_TAR := mpwm-$(shell date +%F).tar.gz # Convert dos file path to unix. drive-letter-to-slash = /$(subst :,,$1) # Handling file names with spaces # add version suffix to file get-release-dir = $(release-path)$(if $(all-release-path),_$(words $(all-release-path))) # determine if a list has duplicates $(findstring $(words $(list)) $(words $(sort $(list)))) # determine if a file list contains illegal suffix $(if $(filter-out $1,$2),$(warning Illegal suffixes in list.)) ") ; definition "s-jjj" ; abbreviation "Inserts Wayly kuul one-liners we can all use in our makefiles ") ; documentation;; (tempo-define-template "makefile-bgp_java-project" ; template name '("# A generic makefile for a Java project. VERSION_NUMBER := 1.0 # Location of trees. SOURCE_DIR := src OUTPUT_DIR := classes # Unix tools AWK := awk FIND := /bin/find MKDIR := mkdir -p RM := rm -rf SHELL := /bin/bash # Path to support tools JAVA_HOME := /opt/j2sdk1.4.2_03 AXIS_HOME := /opt/axis-1_1 TOMCAT_HOME := /opt/jakarta-tomcat-5.0.18 XERCES_HOME := /opt/xerces-1_4_4 JUNIT_HOME := /opt/junit3.8.1 # Java tools JAVA := $(JAVA_HOME)/bin/java JAVAC := $(JAVA_HOME)/bin/javac JFLAGS := -sourcepath $(SOURCE_DIR) \\ -d $(OUTPUT_DIR) \\ -source 1.4 JVMFLAGS := -ea \\ -esa \\ -Xfuture JVM := $(JAVA) $(JVMFLAGS) JAR := $(JAVA_HOME)/bin/jar JARFLAGS := cf JAVADOC := $(JAVA_HOME)/bin/javadoc JDFLAGS := -sourcepath $(SOURCE_DIR) \\ -d $(OUTPUT_DIR) \\ -link http://java.sun.com/products/jdk/1.4/docs/api # Jars COMMONS_LOGGING_JAR := $(AXIS_HOME)/lib/commons-logging.jar LOG4J_JAR := $(AXIS_HOME)/lib/log4j-1.2.8.jar XERCES_JAR := $(XERCES_HOME)/xerces.jar JUNIT_JAR := $(JUNIT_HOME)/junit.jar # Set the Java classpath class_path := OUTPUT_DIR \\ XERCES_JAR \\ COMMONS_LOGGING_JAR \\ LOG4J_JAR \\ JUNIT_JAR # space - A blank space space := $(empty) $(empty) # $(call build-classpath, variable-list) define build-classpath $(strip \\ $(patsubst :%,%, \\ $(subst : ,:, \\ $(strip \\ $(foreach j,$1,$(call get-file,$j):))))) endef # $(call get-file, variable-name) define get-file $(strip \\ $($1) \\ $(if $(call file-exists-eval,$1),, \\ $(warning The file referenced by variable \\ '$1' ($($1)) cannot be found))) endef # $(call file-exists-eval, variable-name) define file-exists-eval $(strip \\ $(if $($1),,$(warning '$1' has no value)) \\ $(wildcard $($1))) # $(call brief-help, makefile) define brief-help $(AWK) '$$1 ~ /^[^.][-A-Za-z0-9]*:/ \\ { print substr($$1, 1, length($$1)-1) }' $1 | \\ sort | \\ pr -T -w 80 -4 endef # $(call file-exists, wildcard-pattern) file-exists = $(wildcard $1) # $(call check-file, file-list) define check-file $(foreach f, $1, \\ $(if $(call file-exists, $($f)),, \\ $(warning $f ($($f)) is missing))) endef # #(call make-temp-dir, root-opt) define make-temp-dir mktemp -t $(if $1,$1,make).XXXXXXXXXX endef # MANIFEST_TEMPLATE - Manifest input to m4 macro processor MANIFEST_TEMPLATE := src/manifest/manifest.mf TMP_JAR_DIR := $(call make-temp-dir) TMP_MANIFEST := $(TMP_JAR_DIR)/manifest.mf # $(call add-manifest, jar, jar-name, manifest-file-opt) define add-manifest $(RM) $(dir $(TMP_MANIFEST)) $(MKDIR) $(dir $(TMP_MANIFEST)) m4 --define=NAME=\"$(notdir $2)\" \\ --define=IMPL_VERSION=$(VERSION_NUMBER) \\ --define=SPEC_VERSION=$(VERSION_NUMBER) \\ $(if $3,$3,$(MANIFEST_TEMPLATE)) \\ > $(TMP_MANIFEST) $(JAR) -ufm $1 $(TMP_MANIFEST) $(RM) $(dir $(TMP_MANIFEST)) endef # $(call make-jar,jar-variable-prefix) define make-jar .PHONY: $1 $$($1_name) $1: $($1_name) $$($1_name): cd $(OUTPUT_DIR); \\ $(JAR) $(JARFLAGS) $$(notdir $$@) $$($1_packages) $$(call add-manifest, $$@, $$($1_name), $$($1_manifest)) endef # Set the CLASSPATH export CLASSPATH := $(call build-classpath, $(class_path)) # make-directories - Ensure output directory exists. make-directories := $(shell $(MKDIR) $(OUTPUT_DIR)) # help - The default goal .PHONY: help help: @$(call brief-help, $(CURDIR)/Makefile) # all - Perform all tasks for a complete build .PHONY: all all: compile jars javadoc # all_javas - Temp file for holding source file list all_javas := $(OUTPUT_DIR)/all.javas # compile - Compile the source .PHONY: compile compile: $(all_javas) $(JAVAC) $(JFLAGS) @$< # all_javas - Gather source file list .INTERMEDIATE: $(all_javas) $(all_javas): $(FIND) $(SOURCE_DIR) -name '*.java' > $@ # jar_list - List of all jars to create jar_list := server_jar ui_jar # jars - Create all jars .PHONY: jars jars: $(jar_list) # server_jar - Create the $(server_jar) server_jar_name := $(OUTPUT_DIR)/lib/a.jar server_jar_manifest := src/com/company/manifest/foo.mf server_jar_packages := com/company/m com/company/n # ui_jar - create the $(ui_jar) ui_jar_name := $(OUTPUT_DIR)/lib/b.jar ui_jar_manifest := src/com/company/manifest/bar.mf ui_jar_packages := com/company/o com/company/p # Create an explicit rule for each jar # $(foreach j, $(jar_list), $(eval $(call make-jar,$j))) $(eval $(call make-jar,server_jar)) $(eval $(call make-jar,ui_jar)) # javadoc - Generate the Java doc from sources .PHONY: javadoc javadoc: $(all_javas) $(JAVADOC) $(JDFLAGS) @$< .PHONY: clean clean: $(RM) $(OUTPUT_DIR) .PHONY: classpath classpath: @echo CLASSPATH='$(CLASSPATH)' .PHONY: check-config check-config: @echo Checking configuration... $(call check-file, $(class_path) JAVA_HOME) .PHONY: print print: $(foreach v, $(V), \\ $(warning $v = $($v))) ") ; definition "s-jjj" ; abbreviation "Inserts a Makefile to compile a Java project") ; documentation;; (tempo-define-template "perl-bgp_par-helloworld" ; template name '("#!perl -w # File: helloworld.pl # # Authors: Brian Powell (bpowell@uucom.com) # # Description: Example of PERL program using PAR.pm. Inserts a PERL program # # that is a self-extracting executable that runs on any operating system # #eval 'exec /iw/perl/current/bin/perl -s $0 ${1+\\\"$@\\\"}' if 0; # Limit the scope. use English; use diagnostics; use strict; use warnings; use Tk; #use vars qw($VERSION $RELEASE $HTML_OUTPUT); my $mw = MainWindow->new( ); $mw->Label(-text => 'Hello, world!')->pack( ); $mw->Button(-text => 'Quit', -command => sub { exit })->pack( ); MainLoop( ); #*To test this program: #sudo perl -MCPAN -e 'force install PAR' && pp -o helloworld helloworld.pl #*Keep require happy: return 1; ") ; definition "s-jjj" ; abbreviation "Inserts a PERL program that is a self-extracting executable that runs on any operating system.") ; documentation;; ;*The following snippet is a php program which creates KML and then brings up GOOGLEEARTH. (tempo-define-template "geosphere-bgp" ; template name '(" ") ; definition "s-jj" ; abbreviation "Inserts a stub to do a geosphere entry") ; documentation;; * JSON http://www.w3schools.com/json/ http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/lisp/json.el?root=emacs http://kmkeen.com/jshon/ * DNS+DNS SEC ** http://diyws.ath.cx/lessons/lesson-3-dns-and-xampp http://www.nlnetlabs.nl/publications/dnssec_howto/#x1-104000F ** http://www.internetsociety.org/deploy360/dnssec/?gclid=CJP7v__EgsQCFQaRaQodeCQAfw ** http://www.internetsociety.org/deploy360/dnssec/basics/ ** http://www.internetsociety.org/deploy360/resources/dnssec-howto-from-nlnet-labs/ ** http://www.nlnetlabs.nl/publications/dnssec_howto/ * https://github.com/defunkt/gist ‌You can also use Gist as a library from inside your ruby code: Gist.gist("Look.at(:my => 'awesome').code") * https://www.marshut.net/kuxsnm/lentic-6-multiple-syntactic-views-over-emacs-buffers.html Lentic is an Emacs mode * Nagios plugins http://search.cpan.org/dist/Nagios-Plugin/lib/Nagios/Plugin/Performance.pm Nagios::Plugin class for handling performance data. This is a public interface because it could be used by performance graphing routines, such as nagiostat (http://nagiostat.sourceforge.net), perfparse (http://perfparse.sourceforge.net), nagiosgraph (http://nagiosgraph.sourceforge.net) or NagiosGrapher (http://www.nagiosexchange.org/NagiosGrapher.84.0.html). Nagios::Plugin::Performance offers both a parsing interface (via parse_perfstring), for turning nagios performance output strings into their components, and a composition interface (via new), for turning components into perfdata strings. Nagios::Plugin::Performance->new(%attributes) Instantiates a new Nagios::Plugin::Performance object with the given attributes. Nagios::Plugin::Performance->parse_perfstring($string) Returns an array of Nagios::Plugin::Performance objects based on the string entered. If there is an error parsing the string - which may consists of several sets of data - will return an array with all the successfully parsed sets. If values are input with commas instead of periods, due to different locale settings, then it will still be parsed, but the commas will be converted to periods. Nagios::Plugin A family of perl modules to streamline writing Nagios plugins 0.36 Nagios::Plugin::Config read nagios plugin .ini style config files Nagios::Plugin::ExitResult Helper class for returning both output and return codes when testing. Nagios::Plugin::Functions functions to simplify the creation of Nagios plugins 0.36 Nagios::Plugin::Getopt OO perl module providing standardised argument processing for Nagios plugins Nagios::Plugin::Performance class for handling Nagios::Plugin performance data. Nagios::Plugin::Range class for handling Nagios::Plugin range data. Nagios::Plugin::Threshold class for handling Nagios::Plugin thresholds. ** http://nagios-plugins.org/downloads/ * PHP+lamp config files /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/ssl.conf /etc/my.cnf /etc/mysql/my.cnf http://php.net/manual/en/language.variables.scope.php http://www.tutorialspoint.com/php/php_installation_linux.htm http://www.tutorialspoint.com/php/php_for_perl_developers.htm http://stackoverflow.com/questions/12202021/where-is-my-httpd-conf-file-located-apache http://www.jslint.com/ * http://www.ravellosystems.com/?gclid=CKfn4qPgtsECFbRzMgodlEgAqQ Run VMware workloads on AWS with nested virtualization * * http://en.wikipedia.org/wiki/Processing.js * check out https://www.outernet.is/ * http://setosa.io/blog/2014/07/26/markov-chains/index.html --get this--most is downloaded in /.git see if you can mimic ** Add disqus to websites (like the dude that did the markov chains site)? https://disqus.com/admin/signup/?utm_source=New-Site https://disqus.com * Use these to get cartesian product of 7 cards for evaluating strength of flops in omaha? http://stackoverflow.com/questions/1620946/cartesian-product-of-two-files-as-sets-of-lines-in-gnu-linux echo {2,3,4,5,6,7,8,9,T,J,Q,K,A}{w,x,y,z} | sed -e "s# #\n#g" > 5.j echo {2,3,4,5,6,7,8,9,T,J,Q,K,A}{w,x,y,z} | sed -e "s# #\n#g" > 6.j perl -e '{use File::Slurp; @f1 = read_file("5.j"); @f2 = read_file("6.j"); map { chomp; $v1 = $_; map { print "$v1 $_"; } @f2 } @f1;}'> j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^.....$ > /e/2cards.n ; cat /e/2cards.n|nl *** This worked great--for producing the cartesian product! ** All 2-card hands: perl -e '{use File::Slurp; @f1 = read_file("5.j"); @f2 = read_file("6.j"); map { chomp; $v1 = $_; map { print "$v1 $_"; } @f2 } @f1;}'> j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^.....$ > /e/2cards.n ; cat /e/2cards.n|nl perl -e '{use File::Slurp; @f1 = read_file("/e/2cards.n"); @f2 = read_file("6.j"); map { chomp; $v1 = $_; map { print "$v1 $_"; } @f2 } @f1;}'> j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^........$ > /e/3cards.n ; cat /e/3cards.n perl -e '{use File::Slurp; @f1 = read_file("/e/3cards.n"); @f2 = read_file("6.j"); map { chomp; $v1 = $_; map { print "$v1 $_"; } @f2 } @f1;}'> j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^...........$ > /e/4cards.n ; cat /e/4cards.n ** maybe A solution using join, awk and process substitution: join <(xargs -I_ echo 1 _ < setA) <(xargs -I_ echo 1 _ < setB) | awk '{ printf("%s, %s\n", $2, $3) }' ** maybe this will get the cartesian product awk 'FNR==NR{ a[++d]=$1; next} { for ( i=1;i<=d;i++){ print $1","a[i] } }' file2 file1 # ./shell.sh a,c a,d a,e b,c b,d b,e ** Here's shell script to do it--but its faster!: ** "gf": while read a; do while read b; do echo "$a, $b"; done < file2; done < file1 *** Trying with our example above: echo {2,3,4,5,6,7,8,9,T,J,Q,K,A}{w,x,y,z} | sed -e "s# #\n#g" > 5.j echo {2,3,4,5,6,7,8,9,T,J,Q,K,A}{w,x,y,z} | sed -e "s# #\n#g" > 6.j while read a; do while read b; do echo "$a $b"; done < 6.j; done < 5.j > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^.....$ > /e/2cards.n ; cat /e/2cards.n|nl while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/2cards.n > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^........$ > /e/3cards.n ; cat /e/3cards.n cat /e/3cards.n **** Dev echo {12,13,14,15,16,17,18,19,20,21,22,23,24}{1,2,3,4} | sed -e "s# #\n#g" > 5.j echo {12,13,14,15,16,17,18,19,20,21,22,23,24}{1,2,3,4} | sed -e "s# #\n#g" > 6.j #while read a; do while read b; do echo "$a $b"; done < 6.j; done < 5.j > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^.......$ > /e/2cards.n ; cat /e/2cards.n ***** Dev Eliminating dupe hands/sorting/putting hands in ascending order while read a; do while read b; do echo "$a $b"; done < 6.j; done < 5.j > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^.......$ > /e/2cards.n ; cat /e/2cards.n | awk -F' ' '$1<$2{print}' > /e/2cards_sorted.n ; cat /e/2cards_sorted.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/2cards_sorted.n > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^...........$ > /e/3cards.n ; cat /e/3cards.n | awk -F' ' '$2<$3{print}' > /e/3cards_sorted.n ; cat /e/3cards_sorted.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/3cards_sorted.n > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^...............$ > /e/4cards.n ; cat /e/4cards.n | awk -F' ' '$3<$4{print}' > /e/4cards_sorted.n ; nl /e/4cards_sorted.n | tail while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/4cards_sorted.n > j.j ; /e/throw-out-dupe-words-on-same-line.py | grep ^...................$ > /e/5cards.n ; cat /e/5cards.n | awk -F' ' '$4<$5{print}' > /e/5cards_sorted.n ; nl /e/5cards_sorted.n | tail ****** Is this useful/faster?: echo I am am a a boy. | sed -r 's/(\w+) +\1/\1/g' while read a; do while read b; do echo "$a $b"; done < 6.j; done < 5.j > k.j ; cat k.j | awk -F' ' '$1<$2{print}' > /e/2cards_simpler.n ; cat /e/2cards_simpler.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/2cards_simpler.n > k.j ; cat k.j | awk -F' ' '$2<$3{print}' > /e/3cards_simpler.n ; cat /e/3cards_simpler.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/3cards_simpler.n > k.j ; cat k.j | awk -F' ' '$3<$4{print}' > /e/4cards_simpler.n ; cat /e/4cards_simpler.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/4cards_simpler.n > k.j ; cat k.j | awk -F' ' '$4<$5{print}' > /e/5cards_simpler.n ; tail /e/5cards_simpler.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/5cards_simpler.n > k.j ; cat k.j | awk -F' ' '$5<$6{print}' > /e/6cards_simpler.n ; tail /e/6cards_simpler.n while read a; do while read b; do echo "$a $b"; done < 6.j; done < /e/6cards_simpler.n > k.j ; cat k.j | awk -F' ' '$6<$7{print}' > /e/7cards_simpler.n ; tail /e/7cards_simpler.n * Perl prep for interview ** How do I create a Perl class? "bless" a "hashref" !!!!!!!!!!!: a typical way of creating Perl objects is to 'bless' a hashref. The object instance can then store data against it's own set of hash keys. package SampleObject; use strict; use warnings; sub new { my ($class, %args) = @_; return bless { %args }, $class; } sub sample_method { my ($self) = @_; print $self->{sample_data}; } and usage: my $obj = SampleObject->new( sample_data => 'hello world', more_data => 'blah blah blah' ); $obj->sample_method(); Alternatively, accessor/mutator methods can be added (see Class::Accessor, Class::Accessor::Chained, etc for easy setting up of these) - these make it easier to validate data and add encapsulation (it's not enforced in Perl, you have to ensure your code doesn't go around an appropriate accessor/mutator and access the data in the blessed hashref directly). *** UNIVERSAL http://perldoc.perl.org/UNIVERSAL.html NAME SYNOPSIS DESCRIPTION WARNINGS EXPORTS NAME UNIVERSAL - base class for ALL classes (blessed references) SYNOPSIS $is_io = $fd->isa("IO::Handle"); $is_io = Class->isa("IO::Handle"); $does_log = $obj->DOES("Logger"); $does_log = Class->DOES("Logger"); $sub = $obj->can("print"); $sub = Class->can("print"); $sub = eval { $ref->can("fandango") }; $ver = $obj->VERSION; # but never do this! $is_io = UNIVERSAL::isa($fd, "IO::Handle"); $sub = UNIVERSAL::can($obj, "print"); DESCRIPTION UNIVERSAL is the base class from which all blessed references inherit. See perlobj. UNIVERSAL provides the following methods: $obj->isa( TYPE ) CLASS->isa( TYPE ) eval { VAL->isa( TYPE ) } Where TYPE is a package name $obj is a blessed reference or a package name CLASS is a package name VAL is any of the above or an unblessed reference When used as an instance or class method ($obj->isa( TYPE ) ), isa returns true if $obj is blessed into package TYPE or inherits from package TYPE . When used as a class method (CLASS->isa( TYPE ) , sometimes referred to as a static method), isa returns true if CLASS inherits from (or is itself) the name of the package TYPE or inherits from package TYPE . If you're not sure what you have (the VAL case), wrap the method call in an eval block to catch the exception if VAL is undefined. If you want to be sure that you're calling isa as a method, not a class, check the invocand with blessed from Scalar::Util first: use Scalar::Util 'blessed'; if ( blessed( $obj ) && $obj->isa("Some::Class") ) { ... } $obj->DOES( ROLE ) CLASS->DOES( ROLE ) DOES checks if the object or class performs the role ROLE . A role is a named group of specific behavior (often methods of particular names and signatures), similar to a class, but not necessarily a complete class by itself. For example, logging or serialization may be roles. DOES and isa are similar, in that if either is true, you know that the object or class on which you call the method can perform specific behavior. However, DOES is different from isa in that it does not care how the invocand performs the operations, merely that it does. (isa of course mandates an inheritance relationship. Other relationships include aggregation, delegation, and mocking.) By default, classes in Perl only perform the UNIVERSAL role, as well as the role of all classes in their inheritance. In other words, by default DOES responds identically to isa . There is a relationship between roles and classes, as each class implies the existence of a role of the same name. There is also a relationship between inheritance and roles, in that a subclass that inherits from an ancestor class implicitly performs any roles its parent performs. Thus you can use DOES in place of isa safely, as it will return true in all places where isa will return true (provided that any overridden DOES and isa methods behave appropriately). $obj->can( METHOD ) CLASS->can( METHOD ) eval { VAL->can( METHOD ) } can checks if the object or class has a method called METHOD . If it does, then it returns a reference to the sub. If it does not, then it returns undef. This includes methods inherited or imported by $obj , CLASS , or VAL . can cannot know whether an object will be able to provide a method through AUTOLOAD (unless the object's class has overridden can appropriately), so a return value of undef does not necessarily mean the object will not be able to handle the method call. To get around this some module authors use a forward declaration (see perlsub) for methods they will handle via AUTOLOAD. For such 'dummy' subs, can will still return a code reference, which, when called, will fall through to the AUTOLOAD. If no suitable AUTOLOAD is provided, calling the coderef will cause an error. You may call can as a class (static) method or an object method. Again, the same rule about having a valid invocand applies -- use an eval block or blessed if you need to be extra paranoid. VERSION ( [ REQUIRE ] ) VERSION will return the value of the variable $VERSION in the package the object is blessed into. If REQUIRE is given then it will do a comparison and die if the package version is not greater than or equal to REQUIRE , or if either $VERSION or REQUIRE is not a "lax" version number (as defined by the version module). The return from VERSION will actually be the stringified version object using the package $VERSION scalar, which is guaranteed to be equivalent but may not be precisely the contents of the $VERSION scalar. If you want the actual contents of $VERSION , use $CLASS::VERSION instead. VERSION can be called as either a class (static) method or an object method. WARNINGS NOTE: can directly uses Perl's internal code for method lookup, and isa uses a very similar method and cache-ing strategy. This may cause strange effects if the Perl code dynamically changes @ISA in any package. You may add other methods to the UNIVERSAL class via Perl or XS code. You do not need to use UNIVERSAL to make these methods available to your program (and you should not do so). EXPORTS None by default. You may request the import of three functions (isa , can , and VERSION ), but this feature is deprecated and will be removed. Please don't do this in new code. For example, previous versions of this documentation suggested using isa as a function to determine the type of a reference: use UNIVERSAL 'isa'; $yes = isa $h, "HASH"; $yes = isa "Foo", "Bar"; The problem is that this code will never call an overridden isa method in any class. Instead, use reftype from Scalar::Util for the first case: use Scalar::Util 'reftype'; $yes = reftype( $h ) eq "HASH"; and the method form of isa for the second: $yes = Foo->isa("Bar"); *** Moose can be used, which is an extension of the Perl 5 object system. AN EXAMPLE ^ package Person; use Moose; has 'first_name' => ( is => 'rw', isa => 'Str', ); has 'last_name' => ( is => 'rw', isa => 'Str', ); no Moose; __PACKAGE__->meta->make_immutable; This is a complete and usable class definition! package User; use DateTime; use Moose; extends 'Person'; has 'password' => ( is => 'rw', isa => 'Str', ); has 'last_login' => ( is => 'rw', isa => 'DateTime', handles => { 'date_of_last_login' => 'date' }, ); sub login { my $self = shift; my $pw = shift; return 0 if $pw ne $self->password; $self->last_login( DateTime->now() ); return 1; } no Moose; __PACKAGE__->meta->make_immutable; When ready to instantiate your class in an application, use it in the "traditional" Perl manner: use User; my $user = User->new( first_name => 'Example', last_name => 'User', password => 'letmein', ); $user->login('letmein'); say $user->date_of_last_login; **** We'll leave the line-by-line explanation of this code to other documentation, but you can see how Moose reduces common OO idioms to simple declarative constructs. ***** Besides Moose: See Damian Conway's "Object Oriented Perl" book *** Can go to CPAN and looking at .pm files (thousands of them--from simple to hard) will give you a great idea of how to create a good class. ** http://www.perlmonks.org/?node_id=94007 *** 'my' creates a new variable, 'local' temporarily amends the value of a variable--use 'my' when you can (it's faster than local) *** my() == scope is simply delimited from the point of the `my' to the end of the block. *** local() == variables are versions of global variables: they potentially have to be seen by all routines in the program. **** local() works in @time@ while my() works in @space@--but they both end (go "out of scope" at the end of the block they're defined in. *** "Can only really explain the difference between my and local once you've explained the difference between package and lexical variables. ** "local() probably should have been called save() since *** Simple example for local() and my() &s; sub s() { local $s="5"; &b; print $s; } sub b() { $s++; } The above script prints 6. But if we change local to my it will print 5. This is the difference. Simple--variables defined with my() @DO NOT EXIST@ outside the scope of the brackets of the function/subroutine--the "{...}"--but variables defined with local() @DO EXIST@ and are changed until (like my()) the ending bracket "}" is reached--so local() variables are temporary variables that are global for until the ending bracket "}" is reached--my() is simpler and should be used whenever possible--but makes variables strictly local--like the example above the call to subroutine b--the "&b;" line is pointless--it changes nothing--my() restricts scope in "space" (within the brackets) while local() restricts it in "time" (dying only when the end bracket is reached--and not until--so a local() call CAN AFFECT GLOBAL VARIABLES--temporarily (time wise)--but it really changes them until the bracket is reached! **** Why use local() at all if its so confusing etc.? Example: Slurping in an entire file--without changing file So, local saves a global variable's current value and then set it to some form of empty value. You'll often see it used to slurp an entire file, rather than leading just a line: my $file_content; { local $/; open IN, "foo.txt"; $file_content = ; } Calling local $/ sets the input record separator (the value that Perl stops reading a "line" at) to an empty value, causing the spaceship operator to read the entire file, so it never hits the input record separator. ** "local() should be called save() instead since so many people assume its a non-global variable defining function--but its not--it only @temporarily@ redefines a variable--yet it is always, in some sense, a global variable! ** $ perl -MCPAN -e "shell" *** install Number::Format *** $ perl -MCPAN -e "install 'Convert::EBCDIC'" **** Installing Oracle::OCI --Precursor Modules perl -MCPAN -e "install C::Scan" perl -MCPAN -e "install Data::Flow" perl -MCPAN -e 'install Bundle::LWP' perl -MCPAN -e 'install Bundle::Apache' /usr/local/apache/bin/apachectl restart ** Now create the test package, as in Example 5-2: Example 5-2. The HelloApache.pm module package Apache::HelloApache; use strict; use Apache::Constants qw(:common); sub handler { my $r = shift; $r->content_type('text/html'); $r->send_http_header; my $host = $r->get_remote_host; $r->print(<HelloApache

Hello $host

Okay, perhaps we should have said "Hello World!" but nobody expects Perl Sith Lords to do the expected! :-)

END return OK; } 1; # Must finish with a true value ** first shebang line $ ./boot *** And/or just do $ perl boot ** To find out if you are using a Perl distribution with a shared libperl, you can issue the following: ggggg e # perl -MConfig -e 'print "$Config{useshrplib}\n"' true ggggg e # ** Lexical scoping: Firstly, don't go to a dictionary as that won't help you in this particular case. In perl, when we speak of something in the terms of it being lexically scoped, we are talking about the area of code where the given thing is visible e.g { # beginning of lexical scope my $foo; } # end of lexical scope *** i.e. "lexical scoping"=section of code where things can live temporarily--deleted once the scope has been exited { # begin lexical scope my $foo = "a string"; print " \$foo is: ", (defined $foo ? $foo : "undefined"), $/; } # end lexical scope print "\$foo is: ", (defined $foo ? $foo : "undefined"), $/; __output__ $foo is: a string $foo is: undefined There is an exception to this rule however - if something is still referring to something created within a lexical scope upon exit of the scope, that thing will not be deleted since it is still being referred to by something. This does not mean you can still refer to it directly, it just means that perl has yet to clean it up. my $ref; { # begin lexical scope my $foo = "something in a lexical scope"; $ref = \$foo; } # end lexical scope print "\$ref refers to: $$ref", $/; print "\$foo is: ", (defined $foo ? $foo : "undefined"), $/; __output__ $ref refers to: something in a lexical scope $foo is: undefined *** every variable created with my() lives within the current lexical scope. ** Dynamic scoping: *** local() introduces what is called dynamic scope, which means that the `local' variable that it declares is inherited by other functions called from the one with the declaration. *** To implement dynamic scoping, Perl uses an extra stack just for the purpose. *** Using strict means making the vast majority of your variables lexical my vars. *** Capture group contents are dynamically scoped and available to you outside the pattern until the end of the enclosing block or until the next successful match, **** whichever comes first. *** Good for overloading variables. ** chomp Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage chomp VARIABLE chomp( LIST ) chomp This safer version of chop removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the English module). It returns the total number of characters removed from all its arguments. It's often used to remove the newline from the end of an input record when you're worried that the final record may be missing its newline. When in paragraph mode ($/ = "" ), it removes all trailing newlines from the string. When in slurp mode ($/ = undef ) or fixed-length record mode ($/ is a reference to an integer or the like; see perlvar) chomp() won't remove anything. If VARIABLE is omitted, it chomps $_ . Example: while (<>) { chomp; # avoid \n on last field @array = split(/:/); # ... } If VARIABLE is a hash, it chomps the hash's values, but not its keys. You can actually chomp anything that's an lvalue, including an assignment: chomp($cwd = `pwd`); chomp($answer = ); If you chomp a list, each element is chomped, and the total number of characters removed is returned. Note that parentheses are necessary when you're chomping anything that is not a simple variable. This is because chomp $cwd = `pwd`; is interpreted as (chomp $cwd) = `pwd`; , rather than as chomp( $cwd = `pwd` ) which you might expect. Similarly, chomp $a, $b is interpreted as chomp($a), $b rather than as chomp($a, $b) . * Running Perl DBI ** See [[file:/e/n/n/docs/PerlforOracleDBAs.epub]] http://oreilly.com/catalog/oracleperl/pdbatoolkit/ => [[file:/e/n/n/docs/oreilly.com/catalog/oracleperl/pdbatoolkit/index.html]] file:/e/n/n/docs/oreilly.com/catalog/oracleperl/pdbatoolkit/index.html [[dired:/e/n/n/docs/oreilly.com/catalog/oracleperl/pdbatoolkit]] ** Example: #!perl -w use strict; # In perl's before 5.6 (or if you just want to be portable between the versions), you can put '-w' on the 'shebang' line, or set the $^W variable (however, setting $^W will not catch compile time warnings unless its in a BEGIN{} block, so '-w' is usually preferable): use warnings; use DBI; # Connect to Oracle database, making sure AutoCommit is # turned off and potential errors are raised. my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'scott', 'tiger', { RaiseError => 1, AutoCommit => 0 } ); # Create the SQL. my $sql = qq{ SELECT 'Hello World' FROM DUAL }; # Prepare the SQL and execute. my $sth = $dbh->prepare( $sql ); $sth->execute( ); # Fetch output rows into array, plus prepare a # print formatter for the results. while ( my($helloWorldString) = $sth->fetchrow_array) { # Print out the result. print $helloWorldString, "\n"; } $dbh->disconnect( ); # Disconnect ** The differences between "require()" and "use()" are many and often subtle: use only expects a bareword, require can take a bareword or an expression use is evaluated at compile-time, require at run-time use implicitly calls the import method of the module being loaded, require does not *** That's optional. Adding empty parens (as in use Socket ();) prevents import from being called. use excepts arguments in addition to the bareword (to be passed to import), require does not use does not behave like a function (i.e can't be called with parens, can't be used in an expression, etc), whereas require does *** BIGGEST/MOST ENLIGHTENING DIFF TO ME: Use excepts module name only. but require excepts whole filename. So they behave differently but achieve the same goal. Then there's a list of cultural differences in addition to the technical differences, but they're not so hard and fast. ** To create a "reference" in Perl you put a "\" in front of it: my $scalar_ref = \$calar; my $hash_ref = \%ash; my $subroutine_ref = \&ubroutine; *** Then to "dereference" these then, in Perl, and then use them in another subroutine for example: you put whatever the appropriate symbol is in front of the "$"--since all references are scalars: my $newscalar = $$calar; my %newhash = %$hash_ref; my &newsubroutine = &$subroutine_ref; **** More on dereferencing references and using the results: http://perlmeme.org/howtos/using_perl/dereferencing.html Dereferencing in perl References are commonly used when you are returning a large object or data structure (for example an array or hash) from a subroutine. Instead of returning a copy of the entire data structure, you return a pointer to the structure. This makes your programs more efficient. You can also use references to subroutines and scalars. When you want to actually use the values in these variables, you need to dereference the pointer. This page shows you how this works in Perl. Creating references You can create a reference to a variable or subroutine by using the backslash (\) operator. For example, the following subroutine returns a reference to the array @fruit. sub fruit_i_like() { my @fruit = ('apple', 'banana', 'orange'); return \@fruit; } The code to call this subroutine would look like: my $fruit = fruit_i_like(); The fruit_i_like() subroutine returns a scalar variable so that $fruit will hold a reference to the @fruit array. This works the same with scalars, hashes and subroutines: my $scalar_ref = \$a_scalar; my $hash_ref = \%a_hash; my $subroutine_ref = \&a_subroutine; You can create a reference to an anonymous array or hash by using square brackets for an array and braces for a hash: my $array_ref = ['apple', 'banana', 'orange']; my $hash_ref = {name => 'Becky', age => 23}; Similarly, you can create a reference to an anonymous subroutine: my $sub_ref = sub { print "In a subroutine\n" }; Filehandles can also be referenced. You do this by using a reference to a typeglob (see perldoc perldata): do_something(\*FILEHANDLE); sub do_something($) { my ($filehandle) = @_; print $filehandle "Something\n"; } Dereferencing - part 1 A simple way of dereferencing is to put the appropriate identifier (sigil) in front of the reference. For example, the following code creates a reference to a scalar, and prints both the reference and the dereferenced value so that you can see that the reference is actually a reference: #!/usr/bin/perl use strict; use warnings; my $scalar = "This is a scalar"; my $scalar_ref = \$scalar; print "Reference: " . $scalar_ref . "\n"; print "Dereferenced: " . $$scalar_ref . "\n"; This produces something like: Reference: SCALAR(0x80fea8c) Dereferenced: This is a scalar In the same way, to dereference an array reference, hash reference or a subroutine reference, you put the appropriate identifier (sigil) before the reference. Here is a array reference example: #!/usr/bin/perl use strict; use warnings; my $array_ref = ['apple', 'banana', 'orange']; my @array = @$array_ref; print "Reference: $array_ref\n"; print "Dereferenced: @array\n"; The output is: Reference: ARRAY(0x80f6c6c) Dereferenced: apple banana orange And a hash reference example: #!/usr/bin/perl use strict; use warnings; my $hash_ref = {name => 'Becky', age => 23}; my %hash = %$hash_ref; print "Reference: $hash_ref\n"; print "Dereferenced:\n"; foreach my $k (keys %hash) { print "$k: $hash{$k}\n"; } The output of this program is: Reference: HASH(0x80f6c6c) Dereferenced: name: Becky age: 23 And a subroutine reference example: #!/usr/bin/perl use strict; use warnings; my $sub_ref = sub { print "In a subroutine\n" }; &$sub_ref(); This calls the subroutine and produces: In a subroutine Dereferencing - part 2 Another similar way of dereferencing is to use a block (in curly braces). For example, the example above that uses a scalar reference would be re-written as: #!/usr/bin/perl use strict; use warnings; my $scalar = "This is a scalar"; my $scalar_ref = \$scalar; print "Reference: " . $scalar_ref . "\n"; print "Dereferenced: " . ${$scalar_ref} . "\n"; While this looks like only two extra characters, the block is helpful when your reference is stored in a hash or other data structure: #!/usr/bin/perl use strict; use warnings; my %hash = (frogs => sub {print "Frogs\n"}); &{ $hash{frogs} }(); Dereferencing - part 3 The arrow operator also allows you to dereference references to arrays or hashes. The arrow operator makes more complex structures easier to read. The first example shows accessing an element of an array reference: #!/usr/bin/perl use strict; use warnings; my $array_ref = ['apple', 'banana', 'orange']; print "My first fruit is: " . $array_ref->[0] . "\n"; This would produce the following output: My first fruit is: apple The next example shows accessing elements of an hash reference: #!/usr/bin/perl use strict; use warnings; my $hash_ref = {name => 'Becky', age => 23}; foreach my $k (keys %$hash_ref) { print "$k: " . $hash_ref->{$k} . "\n"; } This produces the following output: age: 23 name: Becky Subroutine references work the same way, using parenthesis: #!/usr/bin/perl use strict; use warnings; my %hash = (frogs => sub {print "Frogs\n"}); $hash{frogs}->(); The ref operator The handy perl 'ref' operator tells you what type of reference your variable is. This means that you can write a subroutine that takes a different action based on the type of reference it received. In the following example, the subroutine write_to_file writes the passed in $message to the given filehandle, however it writes the message differently depending on whether the variable is a scalar value, an array reference or a hash reference. #!/usr/bin/perl use strict; use warnings; sub write_to_file($$); open (FILEHANDLE, ">test.txt") or die $!; print write_to_file(\*FILEHANDLE, "A log"); print write_to_file(\*FILEHANDLE, ['apple', 'banana', 'orange']); print write_to_file(\*FILEHANDLE, {name => 'Becky', age => 23}); close FILEHANDLE; sub write_to_file($$) { my ($filehandle, $message) = @_; if (ref($message) eq 'ARRAY') { print $filehandle "@$message\n"; } elsif (ref($message) eq 'HASH') { foreach my $k (keys %$message) { print $filehandle "$k: " . $message->{$k} . "\n"; } } else { print $filehandle "$message\n"; } } The above example would produce a file with the following contents: A log apple banana orange age: 23 name: Becky See also perldoc perldsc (for detailed examples of perl data structures) perldoc perldata ** say Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage say FILEHANDLE LIST say FILEHANDLE say LIST say Just like print, but implicitly appends a newline. say LIST is simply an abbreviation for { local $\ = "\n"; print LIST } . To use FILEHANDLE without a LIST to print the contents of $_ to it, you must use a real filehandle like FH , not an indirect one like $fh . This keyword is available only when the "say" feature is enabled, or when prefixed with CORE:: ; see feature. Alternately, include a use v5.10 or later to the current scope. * Perl for Oracle DBAs .epub oreilly book ** ODBC (Oracle DataBase Connectivity) and JDBC (Java DataBase Connectivity) ** Oracle uses the DBD::Oracle driver, another Perl module that provides the actual communication to the low-level OCI code. Call Level Interface (CLI) *** OraPerl that was released for Perl 4. ** Oracle::OCI, a "new" (book was published 2010) Perl module that provides an even closer interface between Perl and Oracle. Perl DBI API Table 1-1. Main Perl DBI functions DBI function Description available_drivers( ) Lists all of the available DBD drivers including DBD::Oracle data_sources( ) Lists all of the databases available to DBD::Oracle connect( ) Establishes an Oracle database connection disconnect( ) Disconnects a login session from Oracle err( ) Returns the relevant Oracle error code errstr( ) Supplies an associated Oracle error message prepare( ) Prepares a SQL statement for execution execute( ) Executes a prepared statement do( ) Prepares and executes a single SQL statement all together bind_param( ) Binds a value to a prepared statement commit( ) Commits a transaction rollback( ) Rolls back a transaction table_info( ) Fetches metadata information from a table fetchrow_arrayref( ) Fetches a row of data into a referenced array fetchrow_array( ) Fetches a row of data into an array selectrow_array( ) Executes prepare( ), execute( ) and fetchrow_array( ) all in one call In Table 1-2 we list the main OCI functions to give you a sense of the kinds of Oracle operations you can invoke from your Perl programs. Table 1-2. Main OCI functions OCI function Description OCIAttrSet( ) Sets handle attributes OCIAttrGet( ) Gets attributes from a handle OCIBindByName( ) Links variables to a SQL statement placeholder by name OCIBindByPos( ) Links variables to a SQL statement placeholder by position OCIDefineByPos( ) Links a typed select-list item with the output data buffer OCIDescribeAny( ) Describes schema objects OCIDescriptorAlloc( ) Allocates storage for descriptors and LOB locators OCIDescriptorFree( ) Releases the resources taken by descriptors OCIEnvInit( ) Allocates the initial OCI environment handle OCIErrorGet( ) Returns a buffered error message OCIHandleAlloc( ) Points to an allocated handle OCIHandleFree( ) Explicitly releases a memory handle and its resources OCIInitialize( ) Initializes the environment for OCI processes OCILobRead( ) Reads specified LOB and FILE portions into a buffer OCILobWrite( ) Writes a specified buffer into a LOB OCILogoff( ) Ends a login session OCILogon( ) Logs into the OCI session OCIParamGet( ) Gets the descriptor of a parameter attached to a statement handle OCIParamSet( ) Puts the object retrieval descriptor into an object retrieval handle OCIServerAttach( ) Creates the pathway to a data source OCIServerDetach( ) Detaches from a data source OCISessionBegin( ) Begins a user session for a given server OCISessionEnd( ) Ends a user session OCIStmtExecute( ) Sends an application request to the server OCIStmtFetch( ) Fetches data rows from previous queries OCIStmtPrepare( ) Prepares a SQL statement for later execution OCITransCommit( ) Commits a nominated transaction At the most basic level, virtually all outside programs — from web applications to standalone GUI applications — interact with Oracle through this OCI program layer. ** Oracle Call Interface (OCI) * http://www.ibm.com/developerworks/opensource/library/os-twitterstorm/index.html?ca=dat Process real-time big data with Twitter Storm An introduction to streaming big data Storm is an open source, big-data processing system that differs from other systems in that it's intended for distributed real-time processing and is language independent. Learn about Twitter Storm, its architecture, and the spectrum of batch and stream processing solutions. 21 Mar 2013 - Added information about IBM InfoSphere Streams in Stream computing from IBM and Resources. 02 Apr 2013 - Updated URL for IBM InfoSphere Streams links in Stream computing from IBM and Resources > Learn. PDF (223 KB) | 5 Comments M. Tim Jones, Independent author, Consultant 02 April 2013 (First published 06 November 2012) Also available in Chinese Russian Japanese Portuguese Spanish +Table of contents Codename: BlueMix. IBM's go-to-cloud platform. Join the beta. Hadoop, the clear king of big-data analytics, is focused on batch processing. This model is sufficient for many cases (such as indexing the web), but other use models exist in which real-time information from highly dynamic sources is required. Solving this problem resulted in the introduction of Storm from Nathan Marz (now with Twitter by way of BackType). Storm operates not on static data but on streaming data that is expected to be continuous. With Twitter users generating 140 million tweets per day, it's easy to see how this technology is useful. Stream computing from IBM Part of IBM’s big data platform, InfoSphere Streams extends the state-of-the-art in big data processing. It is a high-performance computing platform that enables users to develop and reuse applications to rapidly ingest, analyze, and correlate information as it arrives from thousands of real-time sources. Learn more about InfoSphere Streams. But Storm is more than a traditional big-data analytics system: It's an example of a complex event-processing (CEP) system. CEP systems are typically categorized as computation and detection oriented, each of which can be implemented in Storm through user-defined algorithms. CEPs can, for example, be used to identify meaningful events from a flood of events, and then take actions on those events in real time. Nathan Marz provides a number of examples in which Storm is used within Twitter. One of the most interesting is the generation of trend information. Twitter extracts emerging trends from the fire hose of tweets and maintains them at the local and national level. What this means is that as a story begins to emerge, Twitter's trending topics algorithm identifies the topic in real time. This real-time algorithm is implemented within Storm as a continuous analysis of Twitter data. What does "big data" mean? Big data refers to a scale of data that cannot be managed by conventional means. Internet-scale data has fostered the creation of new architectures and applications that are able to process this new class of data. These architectures are highly scalable and efficiently process data in parallel across a sea of servers. Storm versus traditional big data What differentiates Storm from other big-data solutions is the paradigm that it addresses. Hadoop is fundamentally a batch processing system. Data is introduced into the Hadoop file system (HDFS) and distributed across nodes for processing. When the processing is complete, the resulting data is returned to HDFS for use by the originator. Storm supports the construction of topologies that transform unterminated streams of data. Those transformations, unlike Hadoop jobs, never stop, instead continuing to process data as it arrives. Back to top Big data implementations Hadoop's core was written in the Java™ language but supports data analytics applications written in a variety of languages. Recent entrants have gone more esoteric routes for their implementations to exploit modern languages and their features. For example, the University of California (UC), Berkeley's, Spark is implemented in the Scala language, while Twitter Storm is implemented in Clojure (pronounced closure). Clojure is a modern dialect of the Lisp language. Clojure, like Lisp, supports a functional style of programming, but Clojure also incorporates features to simplify multithreaded programming (a useful feature for the construction of Storm). Clojure is a virtual machine (VM)-based language that runs on the Java Virtual Machine. But even though Storm was developed in Clojure, you can write applications within Storm in virtually any language. All that's necessary is an adapter to connect to Storm's architecture. Adapters exist for Scala, JRuby, Perl, and PHP, and there's a Structured Query Language adapter that supports streaming into a Storm topology. Back to top Key attributes of Storm Storm implements a set of characteristics that define it in terms of performance and reliability. Storm uses ZeroMQ for message passing, which removes intermediate queueing and allows messages to flow directly between the tasks themselves. Under the covers of messaging is an automated and efficient mechanism for serialization and deserialization to Storm's primitive types. What makes Storm most interesting is its focus on fault tolerance and management. Storm implements guaranteed message processing such that each tuple is fully processed through the topology; if a tuple is discovered not to have been processed, it is automatically replayed from the spout. Storm also implements fault detection at the task level, where upon failure of a task, messages are automatically reassigned to quickly restart processing. Storm includes more intelligent process management than Hadoop, where processes are managed by supervisors to ensure that resources are adequately used. Back to top The Storm model Storm implements a data flow model in which data flows continuously through a network of transformation entities (see Figure 1). The abstraction for a data flow is called a stream, which is an unbounded sequence of tuples. The tuple is like a structure that can represent standard data types (such as ints, floats, and byte arrays) or user-defined types with some additional serialization code. Each stream is defined by a unique ID that can be used to build topologies of data sources and sinks. Streams originate from spouts, which flow data from external sources into the Storm topology. Figure 1. Conceptual architecture of a trivial Storm topology Diagram of the conceptual architecture of a trivial Storm topology The sinks (or entities that provide transformations) are called bolts. Bolts implement a single transformation on a stream and all processing within a Storm topology. Bolts can implement traditional things like MapReduce functionality or more complex actions (single-step functions) like filtering, aggregations, or communication with external entities such as a database. A typical Storm topology implements multiple transformations and therefore requires multiple bolts with independent tuple streams. Both spouts and bolts are implemented as one or more tasks within a Linux® system. You can use Storm to easily implement MapReduce functionality for word frequency. As shown in Figure 2, a spout generates the stream of textual data, and a bolt implements the Map function (to tokenize the words of a stream). The resulting stream from the "map" bolt then flows into a single bolt that implements the Reduce function (to aggregate the words into counts). Figure 2. Simple Storm topology for the MapReduce function Diagram of a simple Storm topology for the MapReduce function Note that bolts can stream data to multiple bolts as well as accept data from multiple sources. Storm has the concept of stream groupings, which implement shuffling (random but equal distribution of tuples to bolts) or field grouping (stream partitioning based upon the fields of the stream). Other stream groupings exist, including the ability for the producer to route tuples using its own internal logic. But one of the most interesting features in the Storm architecture is the concept of guaranteed message processing. Storm can guarantee that every tuple a spout emits will be processed; if it isn't processed within some timeout, Storm replays the tuple from the spout. This functionality requires some clever tricks for tracking the tuple through the topology and is one of Storm's key value adds. In addition to supporting reliable messaging, Storm uses ZeroMQ to maximize messaging performance (removing intermediate queueing and implementing direct passing of messages between tasks). ZeroMQ incorporates congestion detection and alters its communication to optimize the available bandwidth. Back to top Storm through example Let's now look at an example of Storm through code to implement a simple MapReduce topology (see Listing 1). This example uses the nicely constructed word count example from Nathan's storm-starter kit available from GitHub (see Resources for a link). This example illustrates the topology shown in Figure 2, which implements a map transformation consisting of a bolt and a reduce transformation consisting of a single bolt. Listing 1. Build a topology in Storm for Figure 2 01 TopologyBuilder builder = new TopologyBuilder(); 02 03 builder.setSpout("spout", new RandomSentenceSpout(), 5); 04 05 builder.setBolt("map", new SplitSentence(), 4) 06 .shuffleGrouping("spout"); 07 08 builder.setBolt("reduce", new WordCount(), 8) 09 .fieldsGrouping("map", new Fields("word")); 10 11 Config conf = new Config(); 12 conf.setDebug(true); 13 14 LocalCluster cluster = new LocalCluster(); 15 cluster.submitTopology("word-count", conf, builder.createTopology()); 16 17 Thread.sleep(10000); 18 19 cluster.shutdown(); Listing 1 (line numbers added for reference) begins with the declaration of a new topology using the TopologyBuilder. Next, at line 3, a spout is defined (named spout) that consists of a RandomSentenceSpout. The RandomSentenceSpout class (namely, the nextTuple method) emits one of five random sentences as its data. The 5 argument at the end of the setSpout method is a parallelism hint (or the number of tasks to create for this activity). At lines 5 and 6, I define the first bolt (or algorithmic transformation entity)—in this case, the map (or split) bolt. This bolt uses the SplitSentence to tokenize the input stream and emit as its output individual words. Note the use of shuffleGrouping at line 6, which defines the input subscription for this bolt (in this case, the "spout") but also that the stream grouping is defined as shuffle. This shuffle grouping means that the input from the spout will be shuffled, or randomly distributed to tasks within this bolt (which has a hint of four-task parallelism). At lines 8 and 9, I define the last bolt, which effectively serves as the reduce element, with its input as the map bolt. The WordCount method implements the necessary word counting behavior (grouping like words together to maintain an overall count) but is not shuffled, so that its output is consistent. If there were multiple tasks implementing the reduce behavior, you would end up with segmented counts, not overall counts. Lines 11 and 12 create and define a configuration object and enable Debug mode. The Config class contains a large number of configuration possibilities (see Resources for a link to more information on the Storm class tree). Lines 14 and 15 create the local cluster (in this case, defining the use of Local mode). I define the name of my local cluster, my configuration object, and my topology (retrieved through the createTopology element of the builder class). Finally, at line 17, Storm sleeps for a duration, and then shuts down the cluster at line 19. Remember that Storm is a continuously operating system, so tasks can exist for a considerable amount of time, operating on new tuples in streams for which they're subscribed. You can learn more about this surprisingly simple implementation, including the details of the spout and bolts, in the storm-starter kit. Back to top Using Storm Nathan Marz has written a readable set of documentation that details installing Storm for both cluster and local modes of operation. The Local mode allows use of Storm without the requirement of a large cluster of nodes. If you need to use Storm in a cluster but lack the nodes, you can also implement a Storm cluster in Amazon Elastic Compute Cloud (EC2). See Resources for a reference for each Storm mode (Local, Cluster, and Amazon EC2). Back to top Other open source big-data solutions Since Google introduced the MapReduce paradigm in 2004, several solutions have appeared that use (or have qualities) of the original MapReduce paradigm. Google's original application of MapReduce was for the indexing of the World Wide Web. Although this application remains in popular usage, the problems that this simple model solves are growing. Table 1 provides a list of the available open source big-data solutions, including traditional batch and streaming applications. Nearly a year before Storm was introduced to open source, Yahoo!'s S4 distributed stream computing platform was open sourced to Apache. S4 was released in October 2010 and provides a high-performance computing (HPC) platform that hides the complexity of parallel processing from the application developer. S4 implements a decentralized cluster architecture that is scalable and incorporates partial fault tolerance. Table 1. Open source big-data solutions Solution Developer Type Description Storm Twitter Streaming Twitter's new streaming big-data analytics solution S4 Yahoo! Streaming Distributed stream computing platform from Yahoo! Hadoop Apache Batch First open source implementation of the MapReduce paradigm Spark UC Berkeley AMPLab Batch Recent analytics platform that supports in-memory data sets and resiliency Disco Nokia Batch Nokia's distributed MapReduce framework HPCC LexisNexis Batch HPC cluster for big data Back to top Going forward Although Hadoop continues to be the most publicized big-data analytics solution, numerous other possibilities exist, each with different characteristics. I have explored Spark in past articles, which incorporates in-memory capabilities for data sets (with the ability to rebuild data that has been lost). But both Hadoop and Spark focus on the batch processing of large data sets. Storm provides a new model for big-data analytics and, because it was recently open sourced, has generated a considerable amount of interest. Unlike Hadoop, Storm is a computation system and incorporates no concept of storage. This allows Storm to be used in a variety of contexts, whether data arrives dynamically from a nontraditional source or is stored in a storage system such as a database (or consumed by a controller for real-time manipulation of some other device, such as a trading system). See Resources for links to more information on Storm, how to get a cluster up and running, and other big-data analytics solutions (both batch and streaming). Resources Learn Complex event processing is the pattern implemented by Storm as well as many other solutions, like Yahoo!' S4. A key difference between Storm and S4 is that Storm provides guaranteed message processing in the face of failures, where S4 can lose messages. Nathan Marz, the key developer behind Storm, has written several interesting and useful introductions to his new offering. The earliest glimpse of Storm came in May 2011 in Preview of Storm: The Hadoop of Realtime Processing - BackType Technology, which was followed in August by A Storm is coming: more details and plans for release. The Storm wiki provides a great set of documentation on Storm, its rationale, and a variety of tutorials on getting Storm and setting up a new project. You'll also find a useful set of documentation on many aspects of Storm, including use of Storm in Local mode, in clusters, and on Amazon. Spark, an alternative for fast data analytics (M. Tim Jones, developerWorks, November 2011) provides an introduction to UC Berkeley's in-memory resilient data analytics platform. Application virtualization, past and future (M. Tim Jones, developerWorks, May 2011) details the use of virtualization for language abstractions. Storm uses the VM-based language Clojure for its implementation in addition to Java technology and many other languages to build its internal (bolt) applications. A thorough class tree exists at GitHub for Storm that details its classes and interfaces. Hadoop has begun to address models beyond simple batch processing. For example, through scheduling, Hadoop can alter the way it processes data to focus on interactivity over batch-level data processing. Learn more about Hadoop scheduling in Scheduling in Hadoop (M. Tim Jones, developerWorks, December 2011). IBM InfoSphere Streams: Get a highly scalable and powerful analytics platform that can handle incredibly high data throughput rates that can range to millions of events or messages per second. The Open Source developerWorks zone provides a wealth of information on open source tools and using open source technologies. Stay current with developerWorks technical events and webcasts focused on a variety of IBM products and IT industry topics. Attend a free developerWorks Live! briefing to get up-to-speed quickly on IBM products and tools, as well as IT industry trends. Watch developerWorks on-demand demos ranging from product installation and setup demos for beginners, to advanced functionality for experienced developers. Follow developerWorks on Twitter. You can also follow this author on Twitter at M. Tim Jones. Get products and technologies ZeroMQ is the intelligent transport layer for efficient messaging in scalable environments. At the ZeroMQ site, you can learn about the offering, how to use it to solve problems, and also how to support this effort. Apache Zookeeper is an open source project that enables highly reliable distributed coordination. Storm uses Zookeeper to coordinate amongst a set of nodes within a cluster. Clojure is the language used to implement the Storm system. Clojure is a recent derivative of the Lisp language created by Rich Hicky as a general-purpose language that also simplifies multithreaded programming. Apache Hadoop is the platform developed by Yahoo! for MapReduce programming. It was recently followed by Spark from UC Berkeley as a resilient in-memory, open source, big-data offering developed in Scala. In addition to Storm, several other big-data offerings are available as open source. Yahoo! S4 is another stream-based big-data platform. Other batch-oriented offerings like Hadoop include Nokia's Disco project and LexisNexis HPCC. IBM InfoSphere Streams: Download InfoSphere Streams and build applications that rapidly ingest, analyze, and correlate information as it arrives from thousands of real-time sources. Evaluate IBM products in the way that suits you best: Download a product trial, try a product online, use a product in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement Service Oriented Architecture efficiently. Discuss Check out developerWorks blogs and get involved in the developerWorks community. Get involved in the developerWorks community. Connect with other developerWorks users while exploring the developer-driven blogs, forums, groups, and wikis. * http://technicalelvis.com/blog/2013/03/28/mahout-twitter-1/ Using Mahout to Group Religious Twitter Users 2 Replies This post describes a method to group religious tweeters by their scripture reference patterns using the kmeans clustering algorithm. I use Apache Pig to process data retrieved by Habakkuk and Mahout to perform clustering. Clustering Primer Clustering consists of representing an entity (e.g. tweeter) as a feature vector, choosing a similarity metric and then applying a clustering algorithm to group the vectors based on similarity. Feature Vector Example Suppose we have two tweeters. Tweeter #1 tweets a reference to Exodus 1:1 and tweeter #2 tweets a reference to Genesis 1:1. Each tweeter can be represented as a “feature vector” that counts the number of references to a book by that tweeter. Positions (Genesis Reference Count, Exodus Reference Count) Tweeter #1: (0, 1) Tweeter #2: (1, 0) Each book has an assigned position within the feature vector. The first vector shows tweeter #1 referenced Genesis zero (0) times and Exodus one (1) time. The second vector shows tweeter #2 referenced Genesis one (1) time and Exodus zero (0) times. The vector can be extended to count every book or even every scripture reference. There are 66 books and 31102 bible verses in the KJV-based bible. Because the number is fixed, they can easily be mapped to integers used as vector position. Similarity Metric There are many methods for calculating the similarity between to vectors. Cosine similarity can measure the angle between vectors so smaller angles imply similar vectors. Euclidean distance measures the distance between vectors so “close” vectors are deemed similar. Other measures include Tanimoto and Manhattan distance. There are many techniques, consult the webernets for more details. Kmeans Clustering As the number of vectors grow, it becomes computationally expensive to calculate the similarity of all vectors in a data set. Kmeans clustering is an efficient algorithm to identify similar groups in large data sets. The algorithm groups n vectors into k clusters of similar vectors. A cluster can be thought of as a geometric circle where the center of the circle defines a centroid point. The kmeans algorithm randomly picks k initial centroid points and assigns all n vectors to a cluster based on the nearest centroid. Next, a new round begins where new centroid points are calculated based on the mean of the vectors assigned to the k clusters in the previous round (hence k-means). The algorithm stops when the centroid points from subsequent rounds are ‘close enough’ or the maximum number of rounds have been reached. Performing Kmeans clustering using Hadoop Two Hadoop-based applications are used to perform this analysis. First, the raw tweets stored in JSON must be processed and converted into feature vectors using Apache Pig. Second, kmeans clustering is performed on the feature vectors using Apache Mahout. Feature Extraction Habakkuk tweets are “tagged” with book (e.g. genesis) and bibleverse (e.g genesis 1:1). The pig script below describes a data flow for transforming the habakkuk tweets into book feature vectors per tweeter. The load statement uses elephant-bird to load the raw JSON from disk into PIG. The join statement uses the book name to correlate a book id with each tweet. The book id serves as the vector position. The foreach counts the book references per tweeter and the group by organizes the records by tweeter. Finally, the store uses elephant-bird to store the data in a format mahout can read. This is just a code snippet. Check github for the full script. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 -- load habakkuk json data, generate screenname and book reference tweets = load '$data' using com.twitter.elephantbird.pig.load.JsonLoader(); filtered = foreach tweets generate (chararray)$0#'screenname' as screenname, (chararray)$0#'book' as book; -- load book ids for join bookids = load '$book_dict' as (book:chararray, docfreq:int, bookid:int); filtered = join bookids by book, filtered by book; -- group using tuple(screenname,book) as key by_screen_book = group filtered by (screenname, bookids::bookid); -- generate counts for each screenname, book book_counts = foreach by_screen_book { generate group.screenname as screenname, group.bookids::bookid as bookid, COUNT(filtered) as count; } -- group by screenname: bag{(screenname, bookid, count)} grpd = group book_counts by screenname; -- nested projection to get: screenname: entries:bag{(bookid, count)} -- uses ToTuple because SEQFILE_STORAGE expects bag to be in a tuple vector_input = foreach grpd generate group, org.apache.pig.piggybank.evaluation.util.ToTuple(book_counts.(bookid, count)); -- store to sequence files STORE vector_input INTO '$output' USING $SEQFILE_STORAGE ( '-c $TEXT_CONVERTER', '-c $VECTOR_CONVERTER -- -cardinality 66' ); Mahout in Action The example mahout command below uses kmeans to generate 2 clusters (-k 2) and choose the initial clusters at random and place them in kmeans-initial-clusters. The maximum number of iterations is 10 (-x). Kmeans will use cosine distance measure (-dm) and a convergence threshold (-cd) of 0.1, instead of using the default value of 0.5 because cosine distances lie between 0 and 1. $ mahout kmeans -i book_vectors-nv \ -c kmeans-initial-clusters -k 2 -o clusters \ -x 10 -ow -cl -dm org.apache.mahout.common.distance.CosineDistanceMeasure \ -cd 0.1 Results Finally, the clusterdump command can print information about the clusters such as the top books and the tweeters in the cluster. These clusters were generated with a small sample with only 10 tweets. $ mahout clusterdump -d join_data/book.dictionary \ -dt text -s clusters/clusters-1 \ -p clusters/clusteredPoints -n 10 -o clusterdump.log $ cat clusterdump.log CL-0 ... Top Terms: luke => 0.4444444444444444 matthew => 0.3333333333333333 john => 0.2222222222222222 galatians => 0.1111111111111111 philippians => 0.1111111111111111 Weight: Point: 1.0: Zigs26 = [luke:1.000] 1.0: da_nellie = [john:1.000] 1.0: austinn_21 = [luke:1.000] 1.0: YUMADison22 = [luke:1.000] 1.0: chap_stique = [galatians:1.000] 1.0: ApesWhitelaw = [matthew:2.000, john:1.000] 1.0: alexxrenee22 = [luke:1.000] 1.0: AbigailObregon3 = [philippians:1.000] 1.0: thezealofisrael = [matthew:1.000] VL-7 ... Top Terms: ephesians => 1.0 Weight: Point: 1.0: Affirm_Success = [ephesians:1.000] The results show 2 clusters. 1 cluster has 9 tweeters with the top books as luke, matthew, john, galations and phillippians. The second cluster has 1 tweeter with ephesians as a top book. Obviously, YMMV with different convergence thresholds, data and distance metrics. References I recommend the following books to anyone learning Pig and Mahout. Programming Pig by Alan Gates: http://my.safaribooksonline.com/9781449317881 Mahout in Action by Sean Owen: http://manning.com/owen/ * http://justinsboringpage.blogspot.fr/2014/05/sending-notifications-from-emacs.html Sending notifications from Emacs (Mac OS X) Sending notifications from emacs is something I find useful. In an earlier blog post I talked about how to use Growl to do so. http://justinsboringpage.blogspot.com/2009/09/making-emacs-growl.html Well now you don't need Growl any longer. There's a neat github project called terminal notifier https://github.com/alloy/terminal-notifier which let's you send notifications from the terminal. You can install it simply, via Homebrew or Rubygems as follows: $ [sudo] gem install terminal-notifier OR brew install terminal-notifier Then you can send notifications using a command like this: terminal-notifier -message "hello" Finally in order to send the notification from emacs we need to write a little Emacs lisp. Check out this gist for the code I use: https://gist.github.com/justinhj/eb2d354d06631076566f#file-gistfile1-el ** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Terminal notifier ;; requires 'sudo gem install terminal-notifier' ;; stolen from erc-notifier (defvar terminal-notifier-command (executable-find "terminal-notifier") "The path to terminal-notifier.") ; (terminal-notifier-notify "Emacs notification" "Something amusing happened") (defun terminal-notifier-notify (title message) "Show a message with `terminal-notifier-command`." (start-process "terminal-notifier" "*terminal-notifier*" terminal-notifier-command "-title" title "-message" message "-activate" "org.gnu.Emacs")) (defun timed-notification(time msg) (interactive "sNotification when (e.g: 2 minutes, 60 seconds, 3 days): \nsMessage: ") (run-at-time time nil (lambda (msg) (terminal-notifier-notify "Emacs" msg)) msg)) This lets you send a notification in the future using M-x timed-notification You are prompted for a time, and the format of that time can be given in a human readable way such as "2 seconds" or "5 minutes" (If you're curious for the allowed options look at the info page in emacs for the function timer-duration ) Then you are prompted for the message "Go to the store", and the message will be sent. The code is very simple, it simply uses run-at-time to run the terminal command in the future. A useful command is find-executable, which given a name will find that executable in your path and run it. This makes configuring tools like this less effort. Troubleshooting Hey if it doesn't work first time what can you do? Check if terminal notify is installed correctly by running at terminal If that succeeds and you don't get a message check if you have enabled do not disturb mode Otherwise if that succeeds and yet emacs isn't sending messages you likely don't have the executable on the path. M-x customize-variable exec-path * https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org * Recoll can index many document types (along with their compressed versions). http://www.lesbonscomptes.com/recoll/features.html * Jenkins OReilly doc: http://www.slideshare.net/demetra512/jenkins-guide * Public instances of Jenkins https://www.google.com/search?ie=UTF-8&q=%22Dashboard+%5BJenkins%5D%22 http://jenkins.nodejs.org/ * PERL multithreading ** http://chicken.genouest.org/perl/multi-threading-with-perl iChicken Bioinformatic Genetic & Genomic about chicken Home Documentations About multi-threading with PERL 30 novembre 2010 by Fred Multi-threading, forking… At first, it seems to be complicated… Actually, it can be quite simple ! First, one thing you should now: your PERL installation may not support threads (this option has been set during compilation), so check it out: perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.30.5-dsa-amd64, archname=x86_64-linux-gnu-thread-multi uname='linux brahms 2.6.30.5-dsa-amd64 #1 smp mon aug 17 02:18:43 cest 2009 x86_64 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.0 -Dsitearch=/usr/local/lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Here, you should look at the following options: useithreads=define. If your PERL install doesn’t have this option, I recommend you to install the forsk.pm module. During installation, the CPAN installer will ask you: It appears your perl was not built with native ithreads. Would you like to create references to forks, such that using 'use threads' and 'use threads::shared' will quietly load forks and forks::shared? [no] I recommend you to choose yes at this point: this will permit you to develop programs with the use threads directive, whatever this options has been set during PERL compilation (note: be aware that the forks module is not as fast as the native threads options. Then, how do we develop this threads? You can find a lot of tutorials with google, like this one, for instance. But, there’s some issues with these examples: there are all based on loops with the fixed number of iterations (do something 10 times and thread it). Okay, that’s nice for beginners. But, again, in the real world, it’s not in this way that things happen! Most of the time, you have a lot of basic operations to perform (let’s say about 500) and you don’t want to perform all the operations at the same time (as your system may go down). How to develop a system-friendly program that will only launch a limited number of threads and will perform all the tasks? That’s the point! And, again, trust me, I didn’t find any tutorials for this « real-world » case. Here I propose a program that may help you to achieve this. The algorithm is based on a while loop that compares the number of task to perform and the number of running and done threads. It can be easily adapt to any cases. Let’s say that you have 100 nucleotide sequences to analyze. These sequences are stored in a Hash table. Then, you can get the number of entry in your hash (your $nb_compute) and enter in the loop. Now, let’s stop talking and have a look at the code: ** Perl Threads & Fork example Skip to end of metadata Added by Andree Toonk, last edited by Andree Toonk on Jul 19, 2010 (view change) show comment Go to start of metadata Below you'll find an example of a multi-threaded Perl program as well as a forked Perl program. Both seem to work fine. A disadvantage of threads is that Perl needs to be compiled with threads support. Not all versions of Perl come with that by default. *** A Perl Thread example #!/usr/local/roadm/bin/perl # This is compiled with threading support use strict; use warnings; use threads; use threads::shared; print "Starting main program\n"; my @threads; for ( my $count = 1; $count <= 10; $count++) { my $t = threads->new(\&sub1, $count); push(@threads,$t); } foreach (@threads) { my $num = $_->join; print "done with $num\n"; } print "End of main program\n"; sub sub1 { my $num = shift; print "started thread $num\n"; sleep $num; print "done with thread $num\n"; return $num; } Will print: Starting main program started thread 1 started thread 2 started thread 3 started thread 4 started thread 5 started thread 6 started thread 7 started thread 8 started thread 9 started thread 10 done with thread 1 done with 1 done with thread 2 done with 2 done with thread 3 done with 3 done with thread 4 done with 4 done with thread 5 done with 5 done with thread 6 done with 6 done with thread 7 done with 7 done with thread 8 done with 8 done with thread 9 done with 9 done with thread 10 done with 10 End of main program Perl Fork example This examples fork 10 child processes. It will wait for all childs to finish before exiting. #!/usr/local/roadm/bin/perl use strict; use warnings; print "Starting main program\n"; my @childs; for ( my $count = 1; $count <= 10; $count++) { my $pid = fork(); if ($pid) { # parent #print "pid is $pid, parent $$\n"; push(@childs, $pid); } elsif ($pid == 0) { # child sub1($count); exit 0; } else { die "couldnt fork: $!\n"; } } foreach (@childs) { my $tmp = waitpid($_, 0); print "done with pid $tmp\n"; } print "End of main program\n"; sub sub1 { my $num = shift; print "started child process for $num\n"; sleep $num; print "done with child process for $num\n"; return $num; } Output looks like: Starting main program started child process for 1 started child process for 2 started child process for 3 started child process for 4 started child process for 5 started child process for 6 started child process for 9 started child process for 10 started child process for 7 started child process for 8 done with child process for 1 done with pid 5584 done with child process for 2 done with pid 5585 done with child process for 3 done with pid 5586 done with child process for 4 done with pid 5587 done with child process for 5 done with pid 5588 done with child process for 6 done with pid 5589 done with child process for 7 done with pid 5590 done with child process for 8 done with pid 5591 done with child process for 9 done with pid 5593 done with child process for 10 done with pid 5594 End of main program ** Perl Threads example from http://chicken.genouest.org/perl/multi-threading-with-perl 01 #!/opt/local/bin/perl -w 02 use threads; 03 use strict; 04 use warnings; 05 06 my @a = (); 07 my @b = (); 08 09 sub sleeping_sub ( $ $ $ ); 10 11 print "Starting main program\n"; 12 13 my $nb_process = 10; 14 my $nb_compute = 20; 15 my $i=0; 16 my @running = (); 17 my @Threads; 18 while (scalar @Threads < $nb_compute) { 19 @running = threads->list(threads::running); 20 print "LOOP $i\n"; 21 print " - BEGIN LOOP >> NB running threads = ".(scalar @running)."\n"; 22 23 if (scalar @running < $nb_process) { 24 my $thread = threads->new( sub { sleeping_sub($i, \@a, \@b) }); 25 push (@Threads, $thread); 26 my $tid = $thread->tid; 27 print " - starting thread $tid\n"; 28 } 29 @running = threads->list(threads::running); 30 print " - AFTER STARTING >> NB running Threads = ".(scalar @running)."\n"; 31 foreach my $thr (@Threads) { 32 if ($thr->is_running()) { 33 my $tid = $thr->tid; 34 print " - Thread $tid running\n"; 35 } 36 elsif ($thr->is_joinable()) { 37 my $tid = $thr->tid; 38 $thr->join; 39 print " - Results for thread $tid:\n"; 40 print " - Thread $tid has been joined\n"; 41 } 42 } 43 44 @running = threads->list(threads::running); 45 print " - END LOOP >> NB Threads = ".(scalar @running)."\n"; 46 $i++; 47 } 48 print "\nJOINING pending threads\n"; 49 while (scalar @running != 0) { 50 foreach my $thr (@Threads) { 51 $thr->join if ($thr->is_joinable()); 52 } 53 @running = threads->list(threads::running); 54 } 55 56 print "NB started threads = ".(scalar @Threads)."\n"; 57 print "End of main program\n"; 58 59 sub sleeping_sub ( $ $ $ ) { 60 sleep(4); 61 } During the main loop, the program will start new threads if the number of running threads is lower than the number of max threads. Still during this loop, it will join pending threads. Then, at the end of the loop, you must be aware that some threads may still running, so, another loop will join the last running threads. You should note that the parameters of the sub are not used (it’s just for the example), but you can send parameters to your favorite sub and get the results, too. To get more details about the shared data, I recommend you to read the threads perldoc. I hope it will help. Tags: code, PERL Categories: PERL • Permalink • 7 Comments » Comments Tanuj dit : 23 août 2012 à 16 h 13 min Thanks for the explanation. Répondre Tomki dit : 26 septembre 2012 à 22 h 09 min Thanks! this example helped me understand the problem I was trying to solve in ways that truly the perl thread tutorial did not. I adapted it a bit: my $nb_process = 20; #this is how many threads to use at a time my $nb_compute = scalar(@domains); #this is how many threads I’ll eventually make use of my $i = 0; my @running = (); my @Threads; while (scalar @Threads list(threads::running); print STDERR » – BEGIN LOOP $i >> NB running threads = « .(scalar @running). »\n » if $optctl{‘debugthreads’}; if (scalar @running new(\&dnschecks, $domain); push (@Threads, $thread); my $tid = $thread->tid; print STDERR » – thread $tid\n » if $optctl{‘debugthreads’}; } @running = threads->list(threads::running); print STDERR » – AFTER STARTING >> NB running Threads = « .(scalar @running). »\n » if $optctl{‘debugthreads’}; foreach my $thr (@Threads) { #check every thread to see if we can rejoin it if ($thr->is_running()) { # no my $tid = $thr->tid; # if $optctl{‘debugthreads’} print STDERR » – Thread $tid running\n »; } elsif ($thr->is_joinable()) { # yes my $tid = $thr->tid; my ($result_href) = $thr->join; $results{$$result_href{‘Domain’}} = $result_href; print STDERR » – Results for thread $tid: $$result_href{‘Domain’} – Thread has been joined\n » if $optctl{‘debugthreads’}; } } @running = threads->list(threads::running); print STDERR » – END LOOP >> NB Threads = « .(scalar @running). »\n » if $optctl{‘debugthreads’}; $i++; } print STDERR « \nJOINING pending threads\n » if $optctl{‘debugthreads’}; while (scalar @running != 0) { foreach my $thr (@Threads) { if ($thr->is_joinable()) { my $tid = $thr->tid; my ($result_href) = $thr->join; $results{$$result_href{‘Domain’}} = $result_href; if ($optctl{‘debugthreads’}) { print STDERR » – Results for thread $tid: $$result_href{‘Domain’} – Thread has been joined\n »; print STDERR » – Threads left = « .(scalar @running). »\n »; } } } @running = threads->list(threads::running); } if ($optctl{‘debugthreads’}) { print STDERR « NB started threads = « .(scalar @Threads). »\n »; print STDERR « End of threads\n »; } * Testing connections from netbackup-1 in O&M (assembled from the /etc/hosts file) export V_UNIQUE_ID=z$(date +%s) echo " * Ping tests from netbackup-1 in I&T:" > ~/ping-tests-from-netbackup-1.org cat \ <(echo "ping -c 1 aes-1-bk ") <(ping -c 1 aes-1-bk ) \ <(echo "ping -c 1 ara-1-bk ") <(ping -c 1 ara-1-bk ) \ <(echo "ping -c 1 archive-1-bk ") <(ping -c 1 archive-1-bk ) \ <(echo "ping -c 1 ca-app-1-bk ") <(ping -c 1 ca-app-1-bk ) \ <(echo "ping -c 1 drm-app-1-bk ") <(ping -c 1 drm-app-1-bk ) \ <(echo "ping -c 1 drm-app-2-bk Resource unavailable. ") <(ping -c 1 drm-app-2-bk ) \ <(echo "ping -c 1 ds-19-bk ") <(ping -c 1 ds-19-bk ) \ <(echo "ping -c 1 ds-ca-1-bk ") <(ping -c 1 ds-ca-1-bk ) \ <(echo "ping -c 1 ds-drm-1-bk ") <(ping -c 1 ds-drm-1-bk ) \ <(echo "ping -c 1 nagios-1-bk ") <(ping -c 1 nagios-1-bk ) \ <(echo "ping -c 1 NE-app-1-bk ") <(ping -c 1 NE-app-1-bk ) \ <(echo "ping -c 1 NE-DB-1-bk ") <(ping -c 1 NE-DB-1-bk ) \ <(echo "ping -c 1 netbackup-1-bk ") <(ping -c 1 netbackup-1-bk ) \ <(echo "ping -c 1 region-1-bk ") <(ping -c 1 region-1-bk ) \ <(echo "ping -c 1 syslog-1-bk ") <(ping -c 1 syslog-1-bk ) \ >> ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#\n##g' ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#ping -c 1#\nping -c 1#g' ~/ping-tests-from-netbackup-1.org cat ~/ping-tests-from-netbackup-1.org|grep "100% packet" > ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org echo "* Unreachable Hosts" cat ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org | nl * Testing connections from netbackup-1 in I&T (assembled from the /etc/hosts file) export V_UNIQUE_ID=z$(date +%s) echo " * Ping tests from netbackup-1 in O&M:" > ~/ping-tests-from-netbackup-1.org cat \ <(echo "ping -c 1 aes-1-bk ") <(ping -c 1 aes-1-bk ) \ <(echo "ping -c 1 ara-1-bk ") <(ping -c 1 ara-1-bk ) \ <(echo "ping -c 1 archive-1-bk ") <(ping -c 1 archive-1-bk ) \ <(echo "ping -c 1 ca-app-1-bk ") <(ping -c 1 ca-app-1-bk ) \ <(echo "ping -c 1 ca-app-2-bk ") <(ping -c 1 ca-app-2-bk ) \ <(echo "ping -c 1 cm-1-bk ") <(ping -c 1 cm-1-bk ) \ <(echo "ping -c 1 coal-ca-1-bk ") <(ping -c 1 coal-ca-1-bk ) \ <(echo "ping -c 1 coal-drm-1-bk ") <(ping -c 1 coal-drm-1-bk ) \ <(echo "ping -c 1 coal-ds-1-bk ") <(ping -c 1 coal-ds-1-bk ) \ <(echo "ping -c 1 drm-app-1-bk ") <(ping -c 1 drm-app-1-bk ) \ <(echo "ping -c 1 drm-app-2-bk ") <(ping -c 1 drm-app-2-bk ) \ <(echo "ping -c 1 ds-19-bk ") <(ping -c 1 ds-19-bk ) \ <(echo "ping -c 1 ds-20-bk ") <(ping -c 1 ds-20-bk ) \ <(echo "ping -c 1 ds-ca-1-bk ") <(ping -c 1 ds-ca-1-bk ) \ <(echo "ping -c 1 ds-ca-2-bk ") <(ping -c 1 ds-ca-2-bk ) \ <(echo "ping -c 1 ds-drm-1-bk ") <(ping -c 1 ds-drm-1-bk ) \ <(echo "ping -c 1 ds-drm-2-bk ") <(ping -c 1 ds-drm-2-bk ) \ <(echo "ping -c 1 nagios-1-bk ") <(ping -c 1 nagios-1-bk ) \ <(echo "ping -c 1 ne-app-1-bk ") <(ping -c 1 ne-app-1-bk ) \ <(echo "ping -c 1 ne-db-1-bk ") <(ping -c 1 ne-db-1-bk ) \ <(echo "ping -c 1 netbackup-1-bk ") <(ping -c 1 netbackup-1-bk ) \ <(echo "ping -c 1 pki-epo-2-bk ") <(ping -c 1 pki-epo-2-bk ) \ <(echo "ping -c 1 region-1-bk ") <(ping -c 1 region-1-bk ) \ <(echo "ping -c 1 syslog-1-bk ") <(ping -c 1 syslog-1-bk ) \ <(echo "ping -c 1 web-r1-bk ") <(ping -c 1 web-r1-bk ) \ <(echo "ping -c 1 web-r2-bk ") <(ping -c 1 web-r2-bk ) \ <(echo "ping -c 1 web-u1-bk ") <(ping -c 1 web-u1-bk ) \ <(echo "ping -c 1 web-u2-bk ") <(ping -c 1 web-u2-bk ) \ >> ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#\n##g' ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#ping -c 1#\nping -c 1#g' ~/ping-tests-from-netbackup-1.org cat ~/ping-tests-from-netbackup-1.org|grep Unreachable > ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org echo "* Unreachable Hosts" cat ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org | nl * Testing connections from nbu-1 export V_UNIQUE_ID=z$(date +%s) echo " * Ping tests from netbackup-1:" > ~/ping-tests-from-netbackup-1.org cat \ <(echo "ping -c 1 nbu-1-bk ") <(ping -c 1 nbu-1-bk ) \ <(echo "ping -c 1 nss-ds-2-bk ") <(ping -c 1 nss-ds-2-bk ) \ <(echo "ping -c 1 nss-tks-2-it-bk ") <(ping -c 1 nss-tks-2-it-bk ) \ >> ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#\n##g' ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#ping -c 1#\nping -c 1#g' ~/ping-tests-from-netbackup-1.org cat ~/ping-tests-from-netbackup-1.org|grep Unreachable > ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org echo "* Unreachable Hosts" cat ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org | nl * NetBackup * Testing connections from nbu-1 export V_UNIQUE_ID=z$(date +%s) echo " * Ping tests from netbackup-1:" > ~/ping-tests-from-netbackup-1.org cat \ <(echo "ping -c 1 nbu-1-bk ") <(ping -c 1 nbu-1-bk ) \ <(echo "ping -c 1 nss-ds-2-bk ") <(ping -c 1 nss-ds-2-bk ) \ <(echo "ping -c 1 nss-tks-2-it-bk ") <(ping -c 1 nss-tks-2-it-bk ) \ >> ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#\n##g' ~/ping-tests-from-netbackup-1.org perl -p -i -e 's#ping -c 1#\nping -c 1#g' ~/ping-tests-from-netbackup-1.org cat ~/ping-tests-from-netbackup-1.org|grep Unreachable > ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org echo "* Unreachable Hosts" cat ~/ping-tests-from-netbackup-1_Unreachable_$V_UNIQUE_ID.org | nl * EE.2 =? /usr/openv/netbackup/bin/bpbackup backup_list http://www.symantec.com/connect/forums/how-allow-user-initiated-backup-unix-client * So altogether now: * DH 1. Using the 4058 frozen ISO build, you’ll need to install the server and client scripts for opening iptables. (I sent them the other day). I turned it off temporarily so it would start. 2. Need to add the command “service netbackup start” before configuring…at least I had to run it. * EE need to do these 1. Add a daily policy to do incremental backups M-Th ---easy checked it out--screenshots and directions => ~Done. 2. Add a policy to allow the DS clients to backup the db2ldif files run at the end of the db2ldif script --almost did this the other day but got some error--have to enable the client priv on the server. 3. Add a weekly policy to do full backups on Sunday ---easy checked it out--screenshots and directions => ~Done. 4. Add a policy to do vaulting early Monday. ** You can start a manul backup and also choose the files/folder to be backed up from the client side. As Hinchclidde mentioned in the previous post tat you need to have a 'USER' type backup [ How to - Open the backup policy -> Attribute Tab -> select the backup type as 'User'.] and select all time(from 12.00 to next 11.55 of same day) in the Date /Time windows. [ How to - Open the backup Policy -> Schedule Tab ] This'll ensure that any time backup can be possible.(All in blue............... :).....) This is done on the Server side, now for the client side. Open the client terminal as administrator(i.e. root). Then go to /usr/openv/netbackup/bin. Now, type ./bp This will bring a CLI interface, form where you can start a backup , with your desired files/folder. All the option have self explained. You can also use "bpbackup"( As mentioned by Marianne) but that is a CLI command no interface will be given to you. (bpbackup is a single line command that can start a backup.) * Begin Of Tasks Section!! Keep Here! *********************************************************************************************************** * cr3156 * Mostly done; I'll test again now and submit to some "Secondary Engineer" bchu. * cr3127 should be done after cr3156 - title: "PKI - Remove Expired CAs from Netbackup server" * cr4100 * EE need to do these today 1. Add a daily policy to do incremental backups M-Th ---easy checked it out--screenshots and directions => ~Done. 2. Add a policy to allow the DS clients to backup the db2ldif files run at the end of the db2ldif script --almost did this the other day but got some error--have to enable the client priv on the server. 3. Add a weekly policy to do full backups on Sunday ---easy checked it out--screenshots and directions => ~Done. 4. Add a policy to do vaulting early Monday. * EE So, should we run db2bak, which does not include the change log? Or db2ldif? ** make sure /bkup is there *** output "-a" stuff there ** http://www.symantec.com/business/support/index?page=content&id=HOWTO43439#v24776644 *** "Deleting a deduplication storage server" a how-to: "If you delete a deduplication storage server, NetBackup disables the deduplication functionality and the storage server functionality on that media server. NetBackup does not delete the media server from your configuration. To delete the media server, use the NetBackup nbemmcmd command. If a disk pool is configured from the disk volume that the deduplication storage server manages, you cannot delete the deduplication storage server. Warning: Do not delete a deduplication storage server if its storage contains unexpired NetBackup images; if you do, data loss may occur. To delete a deduplication storage server In the NetBackup Administration Console, expand Media and Device Management > Credentials > Storage Server On the Edit menu, select Delete. Click Yes in the confirmation dialog box. * Issue Implementing the NetBackup bpstart_notify and the bpend_notify scripts when using Multistreaming in the backup policy Solution When using the NetBackup bpstart_notify and bpend_notify scripts with multistreaming enabled in a backup policy configuration, these scripts will be executed for each of the backup streams created for the backup job. In this case, it is necessary to modify the bpstart_notify and bpend_notify scripts to check for the number of streams running for the backup job and to make sure that they are not executed by every backup stream. Symantec Technical Support is not able to assist with the customization of customer scripts. If assistance is required to write and modify these scripts, please contact Symantec consulting services. Below are some suggestions on how to write these scripts: bpstart_notify - When a backup stream starts running, the bpstart_notify could create touch files for these backup streams that are being generated when the client backup is running. The STREAM_NUMBER, STREAM_COUNT, and STREAM_PID can be used as environment variables for these touch file names. - The bpstart_notify script should check if the first backup stream that was started in the backup job has completed running successfully before it starts writing to the remaining backup streams by checking these touch files previously created. bpend_notify - When a backup stream completes, bpend_notify should check if there are other touch files remaining for all backup streams that have not completed yet. - When the last backup stream completes and no touch files are left, then it should be able to continue executing the bpend_notify script. For further information on these scripts, please see the NetBackup Administrator's Guides, references below. * /usr/openv/netbackup/client/Linux/RedHat/sftp_to_client ** then execute output on client like: " /tmp/bp./client_config" * http://www.symantec.com/business/support/index?page=content&id=HOWTO85931 ndmp_start_path_notify script (UNIX) The UNIX scripts are provided as examples only. You must customize the scripts before using them. For example, the -ne value in the first if statement must be modified to reflect the number of passed parameters. For the ndmp_start_path_notify script, the -ne value must be set to 7. To use this script, create a script similar to /usr/openv/netbackup/bin/goodies/bpstart_notify on the server, and copy it to /usr/openv/netbackup/bin/ndmp_start_path_notify on the UNIX NetBackup for NDMP server. Then, modify the script and ensure that you have permission to run it. On the UNIX media server, the ndmp_start_path_notify script runs before the backup process is issued to the NAS machine. This script must exit with a status of 0 for the calling program to continue and for the backup to proceed. A nonzero status causes the client backup to exit with a status of 99 (NDMP backup failure). Note: Before you use this script, make sure you can run it by using other on the media server. Run chmod 755 script_name, where script_name is the name of the script. If the /usr/openv/netbackup/bin/ndmp_start_path_notify script exists, it runs in the foreground. The bptm process on the NetBackup for NDMP server waits for it to complete before continuing. Any commands in the script that do not end with an & character run serially. The server expects the client to respond with a continue message within the period of time that the NetBackup CLIENT_READ_TIMEOUT option on the server specifies. The default for CLIENT_READ_TIMEOUT is 300. If the script needs more time than 300 seconds, increase the value to allow more time. NetBackup passes the following parameters to the script: Table: Script parameters for ndmp_start_path_notify (UNIX) Parameter Description $1 Specifies the name of the NDMP host. $2 Specifies the policy name from the NetBackup catalog. $3 Specifies the schedule name from the NetBackup catalog. $4 Specifies one of the following: FULL INCR (differential incremental) CINC (cumulative incremental) $5 Specifies the NetBackup status code for the operation. $6 Not used. $7 Specifies the path being backed up. For example: ndmp_start_path_notify freddie cd4000s fulls FULL ndmp_start_path_notify danr cd4000s incrementals INCR ndmp_start_path_notify hare cd4000s fulls FULL To create an ndmp_start_path_notify script for a specific policy or policy and schedule combination, create script files with a .policyname or .policyname.schedulename suffix. In the following two examples of script names, the policy is named production and the schedule is named fulls: /usr/openv/netbackup/bin/ndmp_start_path_notify.production /usr/openv/netbackup/bin/ndmp_start_path_notify.production.fulls The first script affects all scheduled backups in the policy that is named production. The second script affects scheduled backups in the policy that is named production only when the schedule is named fulls. Note: For a given backup, NetBackup uses only one ndmp_start_path_notify script and that is the one with the most specific name. For example, if there are both ndmp_start_path_notify.production and ndmp_start_path_notify.production.fulls scripts, NetBackup uses only ndmp_start_path_notify.production.fulls. The ndmp_start_path_notify script can use the following environment variables: BACKUPID UNIXBACKUPTIME BACKUPTIME The NetBackup bptm process creates these variables. The following are examples of the strings that are available to the script for use in recording information about a backup: BACKUPID=freddie_0857340526 UNIXBACKUPTIME=0857340526 BACKUPTIME=Sun Mar 2 16:08:46 1997 See About the NetBackup for NDMP scripts * Installing the NetBackup client by hand on the client ca-app-1-bk /root/post/post/netbackup-client/NetBackup_7.5_CLIENTS/install * Installing the NetBackup by hand on the new blade stack (ie when they don't get installed) cd /root/post/post/netbackup-client gzip -d NetBackup_7.5_CLIENTS.tar.gz tar xvf NetBackup_7.5_CLIENTS.tar ./NetBackup_7.5_CLIENTS * cr4042 = Title PKI - Virus Scan for Linux Updates * Written by customer: "This CR will configure daily DAT/Engine updates for all of the Linux servers that were moved to VSEL. This will also need to include the associated HIPS Firewall rules to allow the new traffic to be passed from the HBSS server and the Linux servers. This is critical to keep the Linux servers current and within STIG requirements. Virus Scan for Linux Updates" * End Of Tasks Section!! Keep Here! ************************************************************************************************************* * NetBackup tweaks # setenforce 0 # ps -ef|grep nbemm kill -9 blahpid ** Run # install_bp *** again and/or # telnet localhost 1556 # telnet localhost 13724 # telnet localhost 13782 *** check output from # netstat -an *** to see if processes are listening on those ports and/or # iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT ; service iptables save ; service iptables restart # service iptables stopppp # service network restart ; service iptables stop;service iptables status;service iptables save;/etc/init.d/iptables restart;iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT;cat /etc/redhat-release <* org file to MS WORD and retain text I routinely have to do this. My steps are: - Export org to html1 - Switch to the html export buffer (filename.html)1 - Delete the xml lines at the top until the first line is the tag - Save the html - Open the html in Word * CR Priorities CRs should be either Priority 1 or Priority 2. * ccccc 13 # cd /e/n/n/etc/cr4012-task/13 * ccccc 13 # tar cvf cr4012.tar cr4012 => * Made the change you wanted; think the next step is you check off and sign the checklist. * Generally, "version control system" at Convergenz/Tangible: mkdir 55 ; mv 54/CR3156.zip ../55 ; cd ../55 ; unzip CR3156.zip ; (make changes)=> zip -r CR3156 . and/or zip CR3156 CR3156 when done; to reiterate * Need to rsync up Download dirs: * Cygwin: rsync -Habu /cygdrive/c/Users/bpowell/Downloads /cygdrive/e * Linux: rsync -Habu /root/Downloads /E/E --then hava field day deleting crap you downloaded * Need to check that the VirusScanner is working: /etc/init.d/cma status => cma (pid 7438) is running * CRxxxx == HBSS VirusScan for Linux * NetBackup recovery: ** Getting this on the client "Error: client is not validated to use the server". About your error: Check Server entries in the BAR GUI on the client. Ensure the Master is specified as Master on the client. Use bpclntcmd -pn command on client to ensure comms with master server is OK. If all of the above is correct, check that client is authorized to browse and restore - on master, go to Host Properties -> Client Attributes -> add/select client name, then check that client is allowed to browse and restore. * Netbackup docs!: file:///E/E/NetBackup_7.5_CLIENTS/Doc/ file:///E/E/NetBackup_7.5_CLIENTS/Doc/NetBackup_Install_Win.pdf * NetBackupTestServer (on the blade) ** To find the operating system and architecture on a windoze box:Start>Computer>SystemProperties find output/nbsu -type f -exec tar xvf \"{}\" \; chmod 777 *.txt ; chown adminblah *.txt ; chgrp adminblah *.txt ; find output/nbsu -type f -exec gzip \"{}\" \; find output/nbsu -type f -exec mv \"{}\" /root \;' iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT service network restart ; service iptables stop;service iptables status; iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT service iptables save;/etc/init.d/iptables restart; sudo -i; /usr/openv/netbackup/bin/goodies/netbackup start *** then make a policy: choose a policy name and click the checkbox "Use backup policy creation wizard".(go thru whole process and take screenshots **** Put in the same name as that in "/etc/hosts" ** Set up De-Duplication: NetBackup Management > Host Properties > Master Servers [RightClick]> Client Attributes > Always use the media server *** When you create a backup job with client-side deduplication, keep in mind the following items: The backup job can include res j.j ; vi j.j vxlogview --tail 1:01:00|vxlogview --stdate '1/3/14 10:36:00 AM'|vxlogview --where "(stdate >= '1/1/14 0:0:0 AM' && endate <= '1/1/14 10:12:00 AM')" /usr/openv/netbackup/bin/goodies/available_media ** About scratch volume pools on UNIX/Linux The scratch pool is an optional pool that contains the media that NetBackup can allocate to other pools as needed. If you configure a scratch pool, NetBackup moves volumes from that scratch pool to other pools that do not have volumes available. Only one scratch pool is allowed. You cannot add a scratch pool if one exists. You cannot change the NetBackup or DataStore pools to be scratch volume pools. If you create a scratch pool, be aware of the following conditions: If the scratch pool contains assigned volumes, these volumes remain in the scratch pool. NetBackup does not move assigned volumes to other pools as it does with unassigned volumes. NetBackup does not assign volumes while they are in a scratch pool. For example if a NetBackup policy or schedule specifies the scratch pool, all requests for those volumes are denied. NetBackup returns expired media to the scratch volume pool automatically (media that is returned must have been originally in the same scratch pool). To use NetBackup to manage the allocation of volumes to volume pools, do the following: Create volume pools as required, but do not add any volumes to the pools. Define a scratch pool and add all of the volumes to it. NetBackup moves volumes to the other pools as volumes are needed. The small file that gets saved on the Master Server is the disaster recovery image file. It can also be sent to an emailed address. The Catalog feature in the admin console lets you search backup images, duplicate them, promote images from a copy to the primary backup copy, expire images, import images from expired tapes. Copies - each backup is assigned a primary copy, which is used for restores. If the primary copy ("original") is destroyed, you can promote a duplicate copy to a primary. Article URL http://www.symantec.com/docs/TECH135484 ** Seem to have successfully "backed up the catalog" *** Media and Device Management>Media *** Took/moved/reappropriated the "000032" tape from the "NetBackup disk pool" to the "CatalogBackup disk pool" (both seem to be "default disk pools"--like "None" and "Scratch" are defaults too) *** GUI menu choices were something like: ChangeVolumes>NewPool>Media>VolumeGroups>ChangeVolumes>"CatalogBackup 000032"(just chose an available tape drive) * Edit the sshd_config to allow the NetBackup Graphical User Interface to be forwarded to a computer screen (i.e. turn on "X11 Forwarding"). ** The steps to do this depend on the operating system and tools available on the operators computer. * Run the NetBackup install script from the new machine once the NetBackup Server has been initially installed. # sudo -i ; cd /usr/openv/netbackup/bin ; ./install_bp * Turn on all NetBackup daemons and processes: # /usr/openv/netbackup/bin/goodies/netbackup start * Ensure that the "tldcd" is running: # ps -ef|grep tldcd * Ensure the tape drives are communicating with NetBackup: # /usr/openv/netbackup/bin/goodies/available_media ** Run the Java application which should have been loaded when NetBackup was installed on the new server. Login and execute: # /usr/openv/netbackup/bin/jnbSA & * This should bring up the NetBackup Graphical User Interface. ** Run the NetBackup Configuration Wizard *** Work through the 4 main steps of configuring the NetBackup Server; the software will query with a few simple questions. * Set up a policy and do a test backup of the server. RightClick on the Policy tab. etc---flesh this out! * Some networking and/or "No Socket Connection" errors may occur. Some things which may help to troubleshoot such issues ** Login as "nimdaikp" through ssh; but, login as "root" on the NetBackup console. ** Open up any iptable and firewall issues. ** bp.start_all ** Go into the GUI and try to turn on all daemons. ** Test by setting a policy and doing a manual backup of a directory like "/home/nimdaikp" (a directory that should be on all of our servers). ** Telnet to ports that need to be open for NetBackup to work, and open them if they are not already open: telnet nbu-1 13782 *** These methods were successful: Took screenshots of the GUI on 20DEC13. Most importantly, took screenshots of the daemons, processes and jobs. *** See copies of config files at the bottom of this document. **** Some notable commands used: iptables vmquery vmupdate tpconfig bpimmedia vmchange vmupdate bplabel iptables-restore iptables administration tool for IPv4 packet filtering and NAT bpimmedia - display information about NetBackup images on media vmupdate - inventory media contents of a robotic library and update the EMM database bplabel - write NetBackup label on tape media vmquery - query EMM database, or assign and unassign volumes tpconfig - run tape configuration utility vmchange - change media information in EMM database iptables-restore Restore IP Tables ** Finally, after a lot of iptable configuration, EE agreed to allow: service iptables stop (then things of course were manually backed up). service iptables stop *** Maybe all I should need to do is: iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT ** EE still unsettled about the fact that the scheduling of jobs doesn't seem to be working yet; but now, since the firewall has been dismantled, maybe the scheduled backups will work. *** It does work now, since the firewall was dismantled; but, EE points out: "We'll have to revisit this and put the firewalls (iptables) back up." * Upgrading clients after servers are upgraded The update_clients installation script lets you push client software to clients. It does not let you push client software to a remote client that is also a NetBackup media or master server. You cannot push software this way because the server software and client binaries must be of the same version on a single host. The update_clients installation script can determine the full client list that is configured on the server. When it is run without any parameters, it attempts to update all clients (as determined by /usr/openv/netbackup/bin/admincmd/bpplclients). If you do not want to upgrade all clients, you can specify a subset of clients. Use the hardware type and operating system parameters or use the -ClientList parameter. You can run update_clients from a media server. The -ClientList parameter is required in this situation. The script lets you maintain a media server and a set of clients at an earlier release level than the master server. Doing so requires the informed use of the update_clients -ClientList command on a master server and a media server to avoid unwanted client upgrades. /usr/openv/netbackup/bin/admincmd/bpplclients => Hardware OS Client --------------- ----------------------- -------------- ** [root@nbu-1 ~]# cat /usr/openv/java/auth.conf #Original file root ADMIN=ALL JBP=ALL * ADMIN=JBP JBP=ENDUSER+BU+ARC ** Not sure I need to do this: *** [root@nbu-1 ~]# cat << EOF > /usr/openv/java/auth.conf root ADMIN=ALL JBP=ALL * ADMIN=JBP JBP=ENDUSER+BU+ARC nimdaikp ADMIN=ALL JBP=ALL EOF * NetBackup config and troubleshooting notes /usr/openv/netbackup/bin/admincmd/bpplclients #/usr/openv/netbackup/bin/admincmd/bpnbaz -setupmaster echo "PATH=\$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/goodies:/usr/openv/volmgr/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/netbackup/bin/support" >> ~/.bashrc bptestbpcd -verbose -debug -client nbu-1;bptestbpcd -verbose -debug -client 10.18.1.202;bptestbpcd -verbose -debug -client ca-31-main;bptestbpcd -verbose -debug -client ca-31-bk /usr/openv/netbackup/bin/bpps -a |grep nbpem /usr/openv/netbackup/bin/bpps -a |grep nbrb /usr/openv/netbackup/bin/bpps -a |grep nbemm /usr/openv/netbackup/bin/bpps -a |grep bprd /usr/openv/netbackup/bin/bpps -a |grep bpcd /usr/openv/netbackup/bin/bpps -a |grep bpdbm netstat -a | grep vnetd netstat -a | grep bpcd vmquery -rn 0 -bx | grep -i scratch | wc -l #bpnbat -WhoAmI -cf /usr/openv/var/vxss/credentials/nbu-1 netstat -a |grep bpcompatd netstat -a |grep vnetd netstat -a |grep bp service iptables stop #EE did this to get the gui to work nbemmcmd -getemmserver bpclntcmd -self telnet nbu-1 13782 bpclntcmd -pn bperror -all Turn off selinux: setenforce 0 ; getenforce => Permissive /usr/openv/netbackup/bin/goodies/netbackup stop /usr/openv/netbackup/bin/goodies/netbackup start echo "100" > /proc/sys/net/ipv4/tcp_retries1 echo "15" > /proc/sys/net/ipv4/tcp_retries2 echo "1" > /proc/sys/net/ipv4/tcp_abort_on_overflow netstat -a |grep bpcd|grep LISTEN netstat -a |grep vnetd|grep LISTEN ps -ef|grep vnetd #vnetd should be on the the client bpps -x|grep -i pbx #pbx doesn't need to be on the client vi /usr/openv/netbackup/bp.conf head -1 /usr/openv/netbackup/bp.conf|grep nbu-1 grep CLIENT_NAME /usr/openv/netbackup/bp.conf ;#Should output same name as main server name--should only see nbu-1----and nl should be 1--only 1 entry iptables -A INPUT -s 10.18.1.141 -p tcp -j ACCEPT iptables -A INPUT -p tcp --dport 13782 -j ACCEPT iptables -A INPUT -p tcp --dport 13724 -j ACCEPT iptables -A INPUT -p tcp --dport 1556 -j ACCEPT iptables -A INPUT -p tcp --dport 1724 -j ACCEPT service iptables save || iptables-save || iptables-apply # iptables-restore iptables-save iptables-xml /etc/init.d/iptables restart service iptables status bpps -a|grep -i pbx /usr/openv/volmgr/bin/vmquery -m N002C3 [[shell:telnet nbu-1 13724 ; telnet nbu-1 13782 ; telnet nbu-1 1556 ]] ** /etc/services relevant lines grep vnetd /etc/services ; grep bpcd /etc/services ; grep veritas_pbx /etc/services vnetd 13724/tcp # Veritas Network Utility vnetd 13724/udp # Veritas Network Utility bpcd 13782/tcp # VERITAS NetBackup bpcd 13782/udp # VERITAS NetBackup veritas_pbx 1556/tcp # VERITAS Private Branch Exchange veritas_pbx 1556/udp # VERITAS Private Branch Exchange * Netbackup "Intermittent connectivity lost with the server. ** EE try restorecon /sbin/restorecon -R -v /blahdir ** JS try permissive mode setenforce 0 getenforce => Permissive * made iptables file like this and at least I could log in # Generated by iptables-save v1.4.7 on Wed Dec 4 14:24:00 2013 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [127816:7281167] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m tcp --dport 1556 -j ACCEPT -A INPUT -p tcp -m tcp --dport 13724 -j ACCEPT -A INPUT -s 10.18.1.14/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.41/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.61/32 -p tcp -j ACCEPT ... -A INPUT -s 10.1.2.16/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.36/32 -p tcp -j ACCEPT -A INPUT -p esp -j ACCEPT -A INPUT -p ah -j ACCEPT -A INPUT -s 10.1.2.41/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.31/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.120/32 -p tcp -j ACCEPT -A INPUT -s 10.1.3.11/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.12/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.13/32 -p tcp -j ACCEPT -A INPUT -s 10.1.2.11/32 -p tcp -j ACCEPT -A INPUT -d 224.0.0.251/32 -p udp -m udp --dport 5353 -j ACCEPT -A INPUT -p udp -m udp --dport 631 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT COMMIT # Completed on Wed Dec 4 14:24:00 2013 * NetBackup status code: 526 Check if the Java GUI properties (java/nbj.conf) have been set up to connect to a PBX port other than 1556. //root@nbu-1:~ Wed Dec 04 00:16:56 5 6 bash 1 10.18.1.141 cat /usr/openv/java/nbj.conf # $Revision: 1.17 $ #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2012 Symantec Corporation, All Rights Reserved $ * #*************************************************************************** VNETD_PORT=13724 PBX_PORT=1556 NBJAVA_CLIENT_PORT_WINDOW=0 0 INSTALL_PATH=/usr/openv/java INITIAL_MEMORY=36M MAX_MEMORY=256M MEM_USE_WARNING=80 FORCE_IPADDR_LOOKUP=0 USE_NBJAUTH_WITH_ENHAUTH=0 NBJAVA_CORBA_DEFAULT_TIMEOUT=60 NBJAVA_CORBA_LONG_TIMEOUT=1800 FORCE_RESET=1 VNETD_CONNECT_RETRY_TIMEOUT=60 USE_OS_DATETIME_FORMAT=0 NBCSSC_PORT=5637 //root@nbu-1:~ Wed Dec 04 00:17:04 6 7 bash 1 10.18.1.141 ** [root@nbu-1 ~]# netstat -anltp | grep "LISTEN" tcp 0 0 127.0.0.1:51693 0.0.0.0:* LISTEN 1901/pbx_exchange tcp 0 0 0.0.0.0:1556 0.0.0.0:* LISTEN 1901/pbx_exchange tcp 0 0 127.0.0.1:1557 0.0.0.0:* LISTEN 1901/pbx_exchange tcp 0 0 0.0.0.0:13782 0.0.0.0:* LISTEN 9814/bpcd tcp 0 0 10.18.1.141:22 0.0.0.0:* LISTEN 5466/sshd tcp 0 0 0.0.0.0:13720 0.0.0.0:* LISTEN 10089/bprd tcp 0 0 0.0.0.0:13721 0.0.0.0:* LISTEN 10101/bpdbm tcp 0 0 0.0.0.0:13785 0.0.0.0:* LISTEN 9881/NB_dbsrv tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2534/master tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 5647/sshd tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 10537/sshd tcp 0 0 0.0.0.0:13723 0.0.0.0:* LISTEN 10116/bpjobd tcp 0 0 0.0.0.0:13724 0.0.0.0:* LISTEN 9809/vnetd tcp 0 0 0.0.0.0:13701 0.0.0.0:* LISTEN 10324/vmd tcp 0 0 0.0.0.0:5637 0.0.0.0:* LISTEN 10265/nbcssc [root@nbu-1 ~]# * multipath By default DM-multipath will attempt to create a multipath disk device for every disk it finds. It is relatively easy to end up with a system where local disks also get presented as multipathed devices even though they only have a single path. If the local disk is also the root disk, it is impossible to remove the multipathed device mapping without following some specific steps. It’s not immediately apparent what has happened as the multipathed root disk only shows up after a reboot. While it would likely be harmless to leave the disk multipathed, it’s confusing for admins and clutters the device mapper tree unnecessarily. The safest way to avoid this issue is to enable the option “find_multipaths” (new in RHEL 6). mpathconf --find_multipaths y This adds three conditions to whether DM-multipath attempts to create a multipathed disk: A multipathed device has been present before (the files /etc/multipath/* are maintained by multipathd). Two or more paths to the same WWID exist. A multipathed device has been manually created. By default, “find_multipaths” is set to “no” meaning all disks named /dev/sd* are candidates for multipathing whether they are local or otherwise. Another RHEL 6 default is multipathing in the initramfs so that boot-from-SAN works as expected. If boot-from-SAN is not required, omitting multipathing from the initramfs is a “belt & braces” approach to avoiding multipathed local disks. cat >>/etc/dracut.conf < conf.txt vi conf.txt # if UNIX or Linux notepad conf.txt # if Windows bpsetconfig -h client1 conf.txt Port usage-related NetBackup conf ** try these?: mt -f /dev/nst0 status mt -f /dev/nst0 load mt -f /dev/nst0 rewind dmesg | grep emulex find /|grep device.tts ** NetBackupPorts Primarily, all communication use TCP at protocol, the exception being Granular Restore Technology (GRT) restores, where the UDP protocol is used for the NFS traffic. This is not covered in this article. So we will start with the default ports as most environments do not change the ports, then followed by each tier. Default ports Service Port Description VNETD 13724 NetBackup Network daemon. VERITAS_PBX 1556 VxPBX Symantec Private Branch Exchange Service VRTS-AT-PORT 2821 VxAT Symantec authentication service VRTS-AUTH-PORT 4032 VxAZ Symantec Authorization Service BPCD 13782 NetBackup Connection Daemon PDDE_CTRL 10102 PureDisk Controller PDDE_CR 10082 PureDisk Content Router BPRD 13720 NetBackup Request Daemon These eight ports are the primary ports used in almost all NetBackup environments using at least version 6.0. Support for 5.x clients and servers is very limited in NetBackup 7, as the main application communication protocols has changed as of version 6.0. Master server The master server needs to be able to communicate will all tiers, such as the media servers, EMM server, VxSS server, clients, as well as servers where the Java or Administration console is running. Following minimum ports are required; Source Destination Service Port Master Media VNETD 13724 Master Media VERITAS_PBX 1556 Master EMM VERITAS_PBX 1556 Master Client VNETD 13724 Master Admin Console VERITAS_PBX 1556 Master Java Server VERITAS_PBX 1556 Master Netware VNETD 13724 Master Netware BPCD 13782 Master VxSS server VRTS-AT-PORT 2821 Master VxSS server VRTS-AUTH-PORT 4032 Media server The media servers must be able to communicate with the master server and EMM server and obviously the clients. In secure environments the VxSS server is also required. In backup and restore operations it is primarily the media server that communicates with the clients. Source Destination Service Port Media Master VNETD 13724 Media Media VNETD 13724 Media Master VERITAS_PBX 1556 Media EMM VERITAS_PBX 1556 Media Client VNETD 13724 Media Netware VNETD 13724 Media Netware BPCD 13782 Media VxSS server VRTS-AT-PORT 2821 Media VxSS server VRTS-AUTH-PORT 4032 Media Media PDDE_CTRL 10102 Media Media PDDE_CR 10082 Media Client PDDE_CTRL 10102 Media Client PDDE_CR 10082 EMM server The Enterprise Media Manager server (EMM) is the central database for media information as well as many new features in 6.x and 7.0. The EMM server is in almost all cases installed on the master server, but for huge environments or in shared media environments, the EMM server may be a separate server. Source Destination Service Port EMM Master VERITAS_PBX 1556 EMM Media VERITAS_PBX 1556 EMM Admin Console VERITAS_PBX 1556 EMM Java Server VERITAS_PBX 1556 Client The client requires access to the master server for scanning of backups as well as initiating user or archive operations. The client must also be able to connect to the media servers when connect-back backup types such as Oracle and SQL backup is used. When using client side de-duplication, the client must also be able to communicate with the PDDE media servers or all servers in a PureDisk Storage Pool, including the Storage Pool Authority (SPA), and Content Routers (CR). In secure enviroments, the clients must also be able to authenticate against the VxSS server. Source Destination Service Port Client Master VNETD 13724 Client Media VNETD 13724 Client Media PDDE_CTRL 10102 Client Media PDDE_CR 10082 Client VxSS server VRTS-AT-PORT 2821 Novell NetWare If there are any NetWare servers being backed up, following ports must be open; Source Destination Service Port Netware Master BPRD 13720 Netware Master VNETD 13724 Netware Media VNETD 13724 Administration Console If you are using the Windows Administration console which is native Windows application, you first have to add the DNS name of the workstation or server to the list of "trusted" servers in the master server. After that, following ports must be open; Source Destination Service Port Admin Console Master VNETD 13724 Admin Console Master VERITAS_PBX 1556 Admin Console Media VNETD 13724 Admin Console EMM VERITAS_PBX 1556 Admin Console VxSS server VRTS-AT-PORT 2821 Java Server The Java server is the process running on the master server when you connect using the Java Administration Console. It needs to be able to communicate with all the core components. Source Destination Service Port Java Server Master VNETD 13724 Java Server Master VERITAS_PBX 1556 Java Server Media VNETD 13724 Java Server EMM VERITAS_PBX 1556 Java Server VxSS server VRTS-AT-PORT 2821 Java Console Many use the Java Console instead of the Windows native Administration Console, and as it uses the Java Server for further communication, it only requires below ports; Source Destination Service Port Java Console Master VNETD 13724 Java Console Master VERITAS_PBX 1556 Java Console Java Server VNETD 13724 Summary It is my belief that having the core ports used by NetBackup in tabular form does make it easier to communicate the requirements to the network team, so they can carry out the necessary changes to the network. ** Getting ready to make a prototype--main/general plan--could vary from site-to-site/machine-to-machine (getting ready to write CR's): *** Bring up the VeritasNetBackup gui and click "GettingStarted"=>NetBackupWizard **** "Before running any NetBackupWizard, attach and configure your storage devices"--so make sure this is done first. **** Then use NetBackupWizard to do these steps (which correspond to the next 4 or 5 icons (same sequence) in the gui): ***** Configure Storage Devices ***** Configure Volumes ***** Configure Catalog Backup ***** Create Backup Policy ** Top 8 netbackup commands--which are mostly found in: /usr/openv/netbackup/bin/admincmd == [[shell:sleep 3;xte 'str cat /opt/openv/netbackup/bin/version' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str bpconfig -U' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str bptestbpcd -host region1 -connect_options 0 0 2' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str bperror -U -problems' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str vmoprcmd -d ds' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str bpps -x' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str bplist -l -R /etc' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str bprestore -f restore_file_test_list' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:sleep 3;xte 'str tpconfig -l' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[shell:tpconfig -add -robot 9 -robtype tld -cntlhost perch' 'key Return' &][/u/www.symantec.com.png]][[/t.png]][[https://sort.symantec.com/checklist/install#report][/u/www.symantec.com.png]][[/t.png]][[file:///e/n/n/docs/NetBackup_Veritas_Admin-Guide.pdf][/u/www.symantec.com.png]]+Big3InteractiveBPShells: ( [[shell:sleep 3;xte 'str bpadm' 'key Return'][/u/www.symantec.com.png]] || [[shell:sleep 3;xte 'str vmadm' 'key Return'][/u/www.symantec.com.png]] || [[shell:sleep 3;xte 'str tpconfig' 'key Return' 'key p' 'key Return' 'key p' 'key Return'][/u/www.symantec.com.png]] ) AdminGuides7.5: [[file:///e/n/n/docs/NetBackup7.5_AdminGuideI_UNIXServer.pdf][/u/www.symantec.com.png]]+[[file:///e/n/n/docs/NetBackup_AdminGuideII_UNIXServer.pdf][/u/www.symantec.com.png]] *** [[shell:sleep 3;xte 'str bpconfig -U' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] bpconfig -U == display global attributes of netbackup "bpconfig : This command is used to configure or display global configuration attributes for NetBackup. *** [[shell:sleep 3;xte 'str bptestbpcd -host region1 -connect_options 0 0 2' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] bptestbpcd -host region1 -connect_options 0 0 2 "bptestbpcd : This command is used to test connections to clients. This command is helpful because, unlike ping or nslookup, it tests for connection to a NetBackup Client using client connection options at the NetBackup communication level. *** [[shell:sleep 3;xte 'str bperror -U -problems' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] bperror reports the problems in the User format that have occurred in t3he previous 24 hours. *** [[shell:sleep 3;xte 'str vmoprcmd -d ds' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] displays the drive status of all drives--"vmoprcmd can be used for many things" *** [[shell:sleep 3;xte 'str bpps -x' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] list all netbackup processes statistics for the processes *** [[shell:sleep 3;xte 'str bplist -l -R /blah' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] display the information on the files and directories that were backed up or archived on netbackup server. *** [[shell:sleep 3;xte 'str bprestore -f backup_list' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] restore the files that are listed in a file named backup_list *** [[shell:sleep 3;xte 'str tpconfig -add -robot 9 -robtype tld -cntlhost perch' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] run tape configuration utility and configures robots, drives, drive arrays, drive paths, and hosts for use with NetBackup and comes with large number of option or switches. **** [[shell:sleep 3;xte 'str tpconfig -l' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] *** [[shell:sleep 3;xte 'str bplist' 'key Return' &][/u/www.symantec.com.png]][[/t.png]] bplist "-t" netbackup types: **** "If you create directory /usr/openv/netbackup/logs/bplist/ with public-write access, bplist creates an activity log file in this directory that you can use for troubleshooting. *** Character-based, menu interfaces (bpadmin, vmadmin, tpconfig) The menu interface is used on UNIX platforms. NetBackup management Start a character-based, menu interface for NetBackup management by running the bpadm command. You can use the bpadm interface from any terminal (or terminal emulation window) that has a termcap or a terminfo definition. Media management >> Start a character-based, menu interface for media management by running the vmadm command. You can use the vmadm interface from any terminal (or terminal emulation window) that has a termcap or a terminfo definition. Device management Start a character-based, menu interface for device management by running the tpconfig command. You can use the tpconfig interface from any terminal (or terminal emulation window) that has a termcap or a terminfo definition. For more information about the menu interfaces, see the NetBackup Administrator's Guide, Volume II. *** Other dookie/NetBackup commands: [[shell:sleep 3;xte 'str cat /usr/openv/netbackup/logs/bplist/*' 'key Return'][/u/www.symantec.com.png]]*[[shell:sleep 3;xte 'str cat /usr/openv/var/global/external_drivetypes.txt' 'key Return'][/u/www.symantec.com.png]] *** tpconfig can be used to add devices: just type "tpconfig" for "interactive"/question-answer mode that will query you about which drives to share OR do something like: ** "For NetBackup to operate properly, the correct set of processes (daemons) must be running on your UNIX servers. This procedure determines which processes are running and shows how to start processes that may not be running. To verify that all processes are running on UNIX servers 1. To see the list of processes (daemons) running on the server and on the Media Manager, enter the following command: /usr/openv/netbackup/bin/bpps -x 2. If the master server is also the EMM server, ensure that the nbemm and the nbrb services are running. If neither service is running, start them by entering the following two commands. If only one of the services is running, start the other service by using the appropriate command. /usr/openv/netbackup/bin/nbemm /usr/openv/netbackup/bin/nbrb 3. The nbpem and the nbjm services must be running on the master server. If neither service is running, start them by entering the following two commands. If only one of the services is running, start the other service by using the appropriate command. /usr/openv/netbackup/bin/nbjm /usr/openv/netbackup/bin/nbpem 4. If either the NetBackup request daemon (bprd) or database manager daemon (bpdbm) is not running, start them by entering the following command: /usr/openv/netbackup/bin/initbprd 5. Make sure that the following media and device management processes are running: ltid (needs to be running only if drives are configured on the server) vmd (volume) avrd (automatic volume recognition), only if drives are configured on the server Processes for all configured robots 6. If any of these processes are not running, stop the device daemon ltid by running the following command: /usr/openv/volmgr/bin/stopltid 7. To verify that the ltid, avrd, and robotic control daemons are stopped, run the following command: /usr/openv/volmgr/bin/vmps 8. If you use ACS robotic control, the acsssi and the acssel daemons may continue to run when ltid is terminated. Stop any robot control daemons that may continue to run by entering the following command: /usr/openv/netbackup/bin/bp.kill_all 9. Then, start all daemons by running the following command: /usr/openv/volmgr/bin/ltid For debugging, start ltid with the -v (verbose) option. *** Did bpps || bpps -x || bpps -a ** Then maybe things like: vxlogview -p 51216 -i 111 -o 144 -t 24:00:00 ; ls /usr/openv/var/global ; ls /usr/openv/db/bin ; ls /usr/openv/var/global *** then these may help/look into this advice for netbackup probs/logging: vxlogview -p 51216 -i 111 -o 144 -t 24:00:00 *** additional messages are recorded in the admin log, including log data from nbdb_admin: * NetBackup key binaries and scripts: ** /usr/openv/netbackup/bin/admincmd/bpplinfo ** /usr/openv/netbackup/bin/admincmd/bpplclients ** /usr/openv/netbackup/bin/jnbSA -> /usr/openv/java/jnbSA* ** /usr/openv/netbackup/bin ** /usr/openv/netbackup/bin/support ** /usr/openv/netbackup/bin/admincmd ** /usr/openv/volmgr/bin ** /usr/openv/netbackup/bin/goodies ** export DISPLAY=192.168.137.160 ---didn't seem necessary--maybe need sshd running on local machine *** Just got the damn NetBackup gui to show up on my linux desktop: xhost +;ssh -t -Y root@10.18.1.120 /usr/openv/netbackup/bin/jnbSA ** Fibre Channel[edit] card needed for the NetBackup project--to attach to tape drives thru fibre optic cable etc. Today, the term host bus adapter (HBA) is most often used to refer to a Fibre Channel interface card. Fibre Channel HBAs are available for all major open systems, computer architectures, and buses, including PCI and SBus (obsolete today). Each HBA has a unique World Wide Name (WWN), which is similar to an Ethernet MAC address in that it uses an OUI assigned by the IEEE. However, WWNs are longer (8 bytes). There are two types of WWNs on a HBA; a node WWN (WWNN), which is shared by all ports on a host bus adapter, and a port WWN (WWPN), which is unique to each port. There are HBA models of different speeds: 1Gbit/s, 2Gbit/s, 4Gbit/s, 8Gbit/s, 16Gbit/s, 10Gbit/s and 20Gbit/s. The major Fibre Channel HBA manufacturers are QLogic and Emulex. As of mid-2009, these vendors shared approximately 90% of the market.[1][2] Other manufacturers include Agilent, ATTO, Brocade, and LSI. HBA is also known to be interpreted as High Bandwidth Adapter in cases of Fibre Channel controllers. ** http://www.symantec.com/connect/articles/making-your-life-easier-netbackup "Add these directories to the PATH variable in the .profile file in the home directory of the user you log in as."--e.g.: PATH=$PATH:/usr/openv/netbackup/bin/admincmd:/usr/openv/netbackup/bin:/usr/openv\ /netbackup/bin/goodies:/usr/openv/netbackup/bin/support:/usr/openv/volmgr/bin:/u\ sr/openv/java:/netbackup:/opt/sfw/bin:/netbackup/scripts:/opt/VRTSaz/bin/vxazd:/\ opt/VRTSat/bin/:/opt/VRTSaz/bin/:/opt/vormetric/mseo/server/bin:/opt/vormetric/m\ seo/agent/bin:/usr/openv/db/bin ** Can do this daily: /opt/openv/netbackup/bin/support/nbsu -c -t ///1543283bd9fff694c9c3910fc6c47559#$find / -type f|grep nbsu /opt/openv/srt/BMR1/usr/openv/netbackup/bin/support/nbsu /opt/openv/netbackup/bin/support/doc/nbsupport_help.html /opt/openv/netbackup/bin/support/doc/nbsupport_readme.txt /opt/openv/netbackup/bin/support/nbsu /opt/openv/netbackup/bin/support/nbsupport /opt/openv/netbackup/bin/goodies/man/nbsu.1 /opt/openv/man/man1/nbsu.1.gz ///1543283bd9fff694c9c3910fc6c47559#$/opt/openv/netbackup/bin/support/nbsu 1.0 Determining initial nbsu settings 1.1 Determining OS environment 1.2 Determining OS host services 1.3 Determining identified network interface hostnames 1.4 Determining NetBackup environment 2.0 Querying nbsu diagnostic lists 2.1 Determining nbsu diagnostics to run 3.0 Executing nbsu diagnostics Executing diagnostic MM_adv_disk /usr/openv/netbackup/bin/admincmd/bpstulist -L /usr/openv/netbackup/bin/admincmd/tpconfig -dsh -all_hosts /usr/openv/netbackup/bin/admincmd/tpconfig -ddiskarrays Executing diagnostic MM_versioninfo /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/volmgr/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/volmgr/bin/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/volmgr/database/ Executing diagnostic MM_vmglob /usr/openv/volmgr/bin/vmglob -listall -java Executing diagnostic MM_vmpool /usr/openv/volmgr/bin/vmpool -listall /usr/openv/volmgr/bin/vmpool -listscratch /usr/openv/volmgr/bin/vmpool -list_catalog_backup Executing diagnostic MM_vmquery /usr/openv/volmgr/bin/vmquery -bx -a Executing diagnostic MM_vmrule /usr/openv/volmgr/bin/vmrule -listall Executing diagnostic NBU_adv_disk /usr/openv/netbackup/bin/admincmd/bpstulist -L /usr/openv/netbackup/bin/admincmd/nbdevquery -liststs -U /usr/openv/netbackup/bin/admincmd/nbdevquery -listdp -allowanydt -U /usr/openv/netbackup/bin/admincmd/nbdevquery -listdv -dp -stype -U Executing diagnostic NBU_all_log_entries /usr/openv/netbackup/bin/admincmd/bperror -all -U Executing diagnostic NBU_altnames cat -s /usr/openv/netbackup/db/altnames Executing diagnostic NBU_auth cat -s /usr/openv/var/auth/authorize.txt cat -s /usr/openv/var/auth/methods.txt cat -s /usr/openv/var/auth/methods_allow.txt cat -s /usr/openv/var/auth/methods_deny.txt cat -s /usr/openv/var/auth/names_allow.txt cat -s /usr/openv/var/auth/names_deny.txt Executing diagnostic NBU_available_media /usr/openv/netbackup/bin/goodies/available_media -a Executing diagnostic NBU_bpclient /usr/openv/netbackup/bin/admincmd/bpclient -All -L Executing diagnostic NBU_bpclntcmd /usr/openv/netbackup/bin/bpclntcmd -self /usr/openv/netbackup/bin/bpclntcmd -sv /usr/openv/netbackup/bin/bpclntcmd -pn /usr/openv/netbackup/bin/admincmd/bplocaladdrs -verbose /usr/openv/netbackup/bin/bpclntcmd -ip /usr/openv/netbackup/bin/admincmd/bpgetconfig SERVER /usr/openv/netbackup/bin/bpclntcmd -hn /usr/openv/netbackup/bin/admincmd/bpplclients -allunique -l /usr/openv/netbackup/bin/bpclntcmd -hn Executing diagnostic NBU_bpconf cat -s /usr/openv/netbackup/bp.conf Executing diagnostic NBU_bpconfig /usr/openv/netbackup/bin/admincmd/bpconfig -U Executing diagnostic NBU_bpgetconfig /usr/openv/netbackup/bin/admincmd/bpgetconfig -g region-1 -L /usr/openv/netbackup/bin/admincmd/bpgetconfig Executing diagnostic NBU_bpplclients /usr/openv/netbackup/bin/admincmd/bpplclients -allunique -U Executing diagnostic NBU_bppllist /usr/openv/netbackup/bin/admincmd/bppllist -L -allpolicies Executing diagnostic NBU_bpps /usr/openv/netbackup/bin/bpps -x Executing diagnostic NBU_bpretlevel /usr/openv/netbackup/bin/admincmd/bpretlevel Executing diagnostic NBU_bpstulist /usr/openv/netbackup/bin/admincmd/bpstulist -g -U Executing diagnostic NBU_bpsyncinfo /usr/openv/netbackup/bin/admincmd/bpsyncinfo -U Executing diagnostic NBU_bu_status_rpt /usr/openv/netbackup/bin/admincmd/bperror -U -backstat -hoursago 24 Executing diagnostic NBU_client_version cat -s /usr/openv/netbackup/bin/version Executing diagnostic NBU_clnt_db_ver find /usr/openv/netbackup/client/ -name version -print | xargs grep NetBackup | sed s/':'/' '/ Executing diagnostic NBU_dirs ls -lR /usr/openv/ Executing diagnostic NBU_disk_staging_schedule /usr/openv/netbackup/bin/admincmd/bpschedule -L Executing diagnostic NBU_emm /usr/openv/netbackup/bin/admincmd/nbemmcmd -listmedia -allrecords /usr/openv/netbackup/bin/admincmd/nbemmcmd -listmedia -conflicts /usr/openv/netbackup/bin/admincmd/nbemmcmd -listmedia -mergetable Executing diagnostic NBU_emm_config /usr/openv/netbackup/bin/admincmd/nbemmcmd -listhosts /usr/openv/netbackup/bin/admincmd/nbemmcmd -listsettings -machinename /usr/openv/netbackup/bin/admincmd/nbemmcmd -listhosts -verbose cat -s /usr/openv/var/global/emm.conf Executing diagnostic NBU_emm_getserver /usr/openv/netbackup/bin/admincmd/nbemmcmd -getemmserver Executing diagnostic NBU_evtmgr cat -s /usr/openv/var/TaoNotifSvcTopologyCache.xml cat -s /usr/openv/var/global/nbservice.conf Executing diagnostic NBU_exclude cat -s /usr/openv/netbackup/exclude* Executing diagnostic NBU_java cat -s /usr/openv/java/auth.conf cat -s /usr/openv/java/nbj.conf cat -s /usr/openv/java/.nbjConf cat -s /usr/openv/netbackup/bin/jbpSA cat -s /usr/openv/netbackup/bin/jnbSA Executing diagnostic NBU_jobs /usr/openv/netbackup/bin/admincmd/bpdbjobs -report Executing diagnostic NBU_lib_cksum find /usr/openv/lib/ -type f -exec cksum {} \; find /usr/openv/lib/ -type l -exec ls -l {} \; Executing diagnostic NBU_license /usr/openv/netbackup/bin/admincmd/bpminlicense -verbose Executing diagnostic NBU_locales ls -1 /usr/openv/msg/.conf* cat -s /usr/openv/msg/.conf Executing diagnostic NBU_logs ls -lR /usr/openv/netbackup/logs/ Executing diagnostic NBU_nbac /usr/openv/netbackup/bin/goodies/support/support_nbac Executing diagnostic NBU_nbdb_info cat -s /usr/openv/var/global/server.conf cat -s /usr/openv/var/global/databases.conf cat -s /usr/openv/db/bin/servername cat -s /usr/openv/db/log/server.log ls -l /usr/openv/db/log/ /usr/openv/netbackup/bin/admincmd/bpgetconfig VXDBMS_NB_DATA cat -s /vxdbms.conf ls -l Executing diagnostic NBU_nbdb_ping /usr/openv/db/bin/nbdb_ping Executing diagnostic NBU_nbpushdata /usr/openv/netbackup/bin/nbpushdata -show_flags /usr/openv/netbackup/bin/nbpushdata -history Executing diagnostic NBU_nbstl /usr/openv/netbackup/bin/admincmd/nbstl -L Executing diagnostic NBU_pack cat -s /usr/openv/pack/pack.history cat -s /usr/openv/pack/pack.summary Executing diagnostic NBU_pbx /opt/VRTSpbx/bin/pbxcfg -p Executing diagnostic NBU_server_groups /usr/openv/netbackup/bin/admincmd/nbsvrgrp -list -verbose Executing diagnostic NBU_share_list ls -l /usr/openv/share/ Executing diagnostic NBU_tunable cat /usr/openv/netbackup/* cat /usr/openv/netbackup/db/config/* Executing diagnostic NBU_vault_config cat -s /usr/openv/netbackup/db/vault/vault.xml Executing diagnostic NBU_version cat -s /usr/openv/netbackup/version Executing diagnostic NBU_versioninfo /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/bin/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/db/bin/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/db/lib/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/netbackup/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/netbackup/bin/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/netbackup/bin/admincmd/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/netbackup/db/config/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/netbackup/bin/goodies/support/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/lib/ /usr/openv/netbackup/bin/goodies/support/versioninfo -d /usr/openv/share/ Executing diagnostic NBU_vxul cat -s /etc/vx/vrtslog.conf /usr/openv/netbackup/bin/vxlogmgr -s -p NB cat -s /usr/openv/netbackup/nblog.conf /usr/openv/netbackup/bin/vxlogcfg -l -p NB /usr/openv/netbackup/bin/vxlogcfg -l -p NB -o Executing diagnostic NET_config /bin/cat -s /etc/nsswitch.conf /bin/cat -s /etc/resolv.conf /bin/cat -s /etc/nscd.conf /bin/cat -s /etc/yp.conf /bin/cat -s /etc/ypserv.conf Executing diagnostic NET_etc_hosts /bin/cat -s /etc/hosts Executing diagnostic NET_ifconfig_info /sbin/ifconfig -a Executing diagnostic NET_netstat /bin/netstat -a /bin/netstat -nr /bin/netstat -s /bin/netstat -ian Executing diagnostic NET_services /bin/cat -s /etc/services Executing diagnostic NET_services_access ls -l /etc/nsswitch.conf ls -l /etc/nscd.conf ls -l /etc/resolv.conf ls -l /etc/hosts ls -l /etc/services Executing diagnostic OS_config /bin/mount /bin/df -k /sbin/fdisk -l /sbin/sysctl -a ulimit -a /usr/bin/locale Executing diagnostic OS_cron /usr/bin/crontab -l Executing diagnostic OS_dmesg /bin/dmesg Executing diagnostic OS_env set | /bin/sort /usr/bin/env | /bin/sort Executing diagnostic OS_general_info /bin/date /usr/bin/uptime /usr/bin/who -b /bin/hostname /bin/domainname /bin/uname -a Executing diagnostic OS_ipcs /usr/bin/ipcs -a Executing diagnostic OS_java /usr/bin/java -version Executing diagnostic OS_lsmod /sbin/lsmod Executing diagnostic OS_messages tail -50 /var/log/messages Executing diagnostic OS_process_list /bin/ps -ef Executing diagnostic OS_release /bin/cat -s /etc/redhat-release Executing diagnostic OS_resource /usr/bin/sar 1 5 -u /usr/bin/mpstat 1 5 /usr/bin/iostat /usr/bin/iostat -c 1 5 /usr/bin/iostat -dx 1 5 /usr/bin/vmstat /bin/cat -s /proc/swaps Executing diagnostic OS_rpcinfo /usr/sbin/rpcinfo -p Executing diagnostic OS_rpm /bin/rpm -q -a -last /bin/rpm -qi -changelog kernel /bin/rpm -V kernel Executing diagnostic OS_sys_config /bin/cat -s /proc/cpuinfo Executing diagnostic OS_xrdb xrdb -query | grep keyboardFocusPolicy sh: xrdb: command not found 4.0 nbsu successfully completed the identified diagnostic commands. Creating support package... Cleaning up output files... Compressing the region-1_master_20131009_084119.tar file... The results are located in the ./output/nbsu/region-1_master_20131009_084119 directory... ** If you want to know how to do something, try looking in the manuals. MASTER Compatibility list: http://www.symantec.com/docs/TECH59978 Master Download List : http://www.symantec.com/docs/TECH65429 Late Breaking News Links : http://www.symantec.com/docs/TECH74904 NBU 6.5 Documentation: http://www.symantec.com/docs/TECH52878 NBU 7.0 Documentation: http://www.symantec.com/docs/TECH126327 NBU 7.1 Documentation: http://www.symantec.com/docs/TECH154178 NBU 7.5 Documentation: http://www.symantec.com/docs/DOC5138 HOWTO Videos: http://www.symantec.com/docs/HOWTO41825 * https://github.com/jdurbin/durbinlib/wiki/csvsql * http://www.zend.com/en/solutions/get-started-php/ * expect.pm and mechanize.pm http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod#How_to_automate_login http://search.cpan.org/search?query=mechanize&mode=all * pymacs http://tharindu-rusira.blogspot.com/2013/07/pythonizing-emacs.html * R/latex http://www.r-bloggers.com/tailor-your-tables-with-stargazer-new-features-for-latex-and-text-output/?utm_source=twitterfeed&utm_medium=twitter&utm_campaign=Feed%3A+RBloggers+%28R+bloggers%29 * http://tapoueh.org/blog/2013/07/08-Muse-blog-compiler.html * https://github.com/jdurbin/durbinlib/wiki/csvsql * http://www.zend.com/en/solutions/get-started-php/ * expect.pm and mechanize.pm http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod#How_to_automate_login http://search.cpan.org/search?query=mechanize&mode=all * pymacs http://tharindu-rusira.blogspot.com/2013/07/pythonizing-emacs.html * R/latex http://www.r-bloggers.com/tailor-your-tables-with-stargazer-new-features-for-latex-and-text-output/?utm_source=twitterfeed&utm_medium=twitter&utm_campaign=Feed%3A+RBloggers+%28R+bloggers%29 * http://tapoueh.org/blog/2013/07/08-Muse-blog-compiler.html * Example .php program ** edited hello.php and did chmod 755 hello.php while hello.php is on linode in this directory: /opt/lampp/htdocs/example --here is hello.php: ?php echo "Hello"; ? ** To prove/test: Browse: firefox http://freeopensource.co.in/example/hello.php http://freeopensource.co.in/example/comment-example.php ** mein kampf!!!===they are taking over==http://lindseywilliams101.blogspot.com/2012/09/lindsey-williams-now-fed-can-repossess.html * php and parallel--try out asap!!--from: http://stackoverflow.com/questions/17562647/gnu-parallel-to-run-from-a-webpage ** I am working on a demo and using GNU Parallel to run my web crawlers in parallel to help reduce the overall time. I am running it from a php file as follows: ?php .... exec(" parallel -j 8 < commands.txt", $output); .... ? When I run this file from terminal, it works fine and does all the scraping work given in the commands.txt file, but the moment I try running it from a webpage (which is calling this php file), parallel gives me the following error: parallel: Warning: $SHELL not set. Using /bin/sh. Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/bin/parallel line 943. Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/bin/parallel line 943. Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/bin/parallel line 2207. Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/bin/parallel line 2207. ** Did you try shell_exec() instead? ै Matt Bryant yesterday try using shell_exec() ै DevZer0 yesterday I tried with 'shell_exec' as well. Still same error. ै Aryabhatt yesterday Its working now (although still showing warning). Thanks Matt Bryant and DevZer0 for your inputs :) ै Aryabhatt 23 hours ago putenv('SHELL=/bin/sh'); might work to nix the warning ै Orangepill 23 hours ago ** GNU Parallel uses $HOME and $SHELL. $SHELL defaults to /bin/sh, but there is no default for $HOME. So set $HOME: putenv('HOME=/tmp'); # Or some other place You are expected to have write permissions in $HOME. If you want to avoid the warning set $SHELL, too: putenv('SHELL=/bin/sh'); * MashableProjects: ** Make a mashup of the "* WaylyKuulCams/InternetTVStations/TrafficCams:" and the spinning globe applet: [[shell:/opt/lampp/lampp startapache &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp stopapache &][/u/127.0.0.1.png]][[/t.png]][[shell:echo "If and only iff XAMPP is not installed already: Click on this icon to get to the section of the LINUX-XAMPP website that details the download options (regular or upgrade and/or development packages--BETA versions are also available on the SourceForge site) and download whatever (takes you to the SourceForge website now) then click on the next icon to install it if its not installed already" ; /google-chrome http://www.apachefriends.org/en/xampp-linux.html#374][/u/127.0.0.1.png]][[/t.png]][[shell:mv -f /root/Downloads/xampp-linux* /debs-new ; tar xvfz /debs-new/xampp-linux-*.tar.gz -C /opt &][/u/127.0.0.1.png]][[/t.png]][[http://www.apachefriends.org/en/xampp-linux.html][/u/www.apachefriends.org.png]][[/t.png]][[shell:cat /e/n/n/n/.1xampp-lampp.n ; echo "Important point about XAMPP: Even though XAMPP provides an integrated LAMP stack, you still have to edit configuration files to customize its components. As with Webalizer, these are all located in the etc directory. If you have little prior experience working with Linux or Unix, relax. This need not be a showstopper. The configuration files are well-documented in an FAQ: See this file: http://www.apachefriends.org/en/faq-xampp.html: " ; /google-chrome http://www.apachefriends.org/en/faq-xampp.html &][/u/www.apachefriends.org.png]][[/t.png]][[http://www.apachefriends.org/en/xampp-linux.html#374][/u/127.0.0.1.png]] [[http://127.0.0.1/xampp/][/u/127.0.0.1.png]] [[shell:/opt/lampp/lampp start &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp stop &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp start &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp restart &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp startapache &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp startssl &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp startmysql &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp startftp &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp stopapache &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp stopssl &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp stopmysql &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp stopftp &][/u/127.0.0.1.png]][[/t.png]][[shell:/opt/lampp/lampp security &][/u/127.0.0.1.png]] ** my.conf httpd.conf * http://blogs.msdn.com/b/chrsmith/archive/2008/08/07/understanding-tail-recursion.aspx * puppet project: make a puppet script that enforces all the right privs for mepis linux box!! ** http://www.linuxforu.com/2010/12/data-centre-automation-puppet-user-group-management/ In our last session, we had learnt how to set up a basic Puppet server and client architecture. Today, we will look at how to create users and groups, and a little bit of file management in association with user creation. User and group management has been a very difficult task for sysadmins, especially when one user account has to be created across 10 machines, or even a 100. Similarly, disabling or deleting the accounts on 10s or 100s of machines, when employees leave the team or company, is not for the faint-hearted. You would be right in asking, ैWhy? Doesnैt LDAP solve the problem?ै Believe me, I agree with you! I feel, after struggling with LDAP for about two years, that: Puppet has made the task much simpler for me. Communications are encrypted by default, without me having to setup SSL separately, which makes it very secure to set even passwords. The configurations on the client end are very minimal, or nil, compared to LDAP. Groups We need to create groups first, because a user, when added, needs to be part of a group. Management of privileges by a group is always better than individual user management. Put all the users into a group, and assign the group privileges as per the member usersै requirements in this group. This is very useful, even when giving sudo privileges. Enter the following lines in the /etc/puppet/manifests/site.pp file ै the comma at the end of a line is significant; so donैt omit it. group { "lfyforum": ensure => present, gid => 1001 } Make sure that a group with the ID 1001 doesnैt already exist. root@puppet-client:~# grep 1001 /etc/group | wc -l 0 On running the command puppetd --server=puppet -t --onetime as the root use, you should get the following result, telling you that the group lfyforum has been created successfully, with the ID 1001. notice: /Stage[main]//Group[lfyforum]/ensure: created root@puppet-client:~# grep 1001 /etc/group lfyforum:x:1001: You can add a -d (debug) flag to the above command if you need to troubleshoot any errors. Users You can create users with a basic method. site.pp would be the file to use for both users and groups in this example. Add the following lines to site.pp: user { "lfy": ensure => "present", uid => "1001", gid => "1001", comment => "LinuxForU User", home => "/home/lfy", shell => "/bin/bash" } Of course, here also please make sure that a user with the ID 1001 doesnैt already exist: root@puppet-client:~# grep 1001 /etc/passwd | wc -l 0 On running the puppetd command as the root, you should get the following output: notice: /Stage[main]//User[lfy]/ensure: created root@puppet-client:~# grep 1001 /etc/passwd lfy:x:1001:1001:LinuxForU User:/home/lfy:/bin/bash Now, can these two be clubbed, instead of having them as two different statements? Yes. We can make the user statement depend on the group by adding the following line: require => Group[ैlfyforumै] You now have the output given below: notice: /Stage[main]//Group[lfyforum]/ensure: created notice: /Stage[main]//User[lfy]/ensure: created Files and folders Although everything (including directories) is considered a file in UNIX, but not in Puppet. You have to exclusively mention the word directory to have a folder created. A home directory does not get created, by default; and if it does, default permissions for the home would be 755. In this special case, adding the managehome line to the user stanza should take care of creating the home folder and the skeleton of the folder as well. user { "lfy": ensure => "present", uid => "1001", gid => "1001", comment => "LinuxForU User", home => "/home/lfy", shell => "/bin/bash", managehome => true } These are the default file permissions: root@puppet-client:~# ls -l /home/ | grep lfy drwxr-xr-x 8 lfy lfyforum 4096 2010-10-27 22:08 lfy How do you set directory permissions? Adding these lines to the same file should help: file { "/home/lfy": mode => 700, require => User["lfy"] } Why did we use the attribute require? Itैs so that there are no errors when Puppet tries to apply permissions to a non-existent folder. Here, it will only run when Puppet confirms that the user has been created first. This should give an output as shown below: notice: /Stage[main]//File[/home/lfy]/mode: mode changed '755' to '700' root@puppet-client:~# ls -l /home/ | grep lfy drwx------ 8 lfy lfyforum 4096 2010-10-27 22:08 lfy Run an id on the user lfy, to see if the user was created properly: root@puppet-client:~# id lfy uid=1001(lfy) gid=1001(lfyforum) groups=1001(lfyforum) Pretty simple, right? Just imagine thousands of machines doing this at the same time without any intervention from your side! As far as Puppet is concerned, itैs the maximum use of the clientैs resources. The server only comes into the picture when configurations are to be pulled. I hope you havenैt forgotten about putting puppetd in cron, as discussed in the last article in this series. User deletion What about user deletion? Just reverse a few entries in the user and file stanzas: user { "lfy": ensure => "absent" } file { "/home/lfy": ensure => absent, force => true, require => User["lfy"] } Why did we use force? Because, by default, Puppet plays safe and does not use rm -rf on the home folder. The force attribute does just that. Now tell meैइ a user/admin has left the organisation and you need to remove his/her home folder. Can you remove/delete the home folder through any LDAP service? Hope now you have got the solution to that as well. I hope you enjoyed creating users, groups and files/folders with Puppet. In the next article, we will look at something even more interesting: the management of passwords, sudo users, and a little bit about setting up Puppet on a machine during installation itself. Related Posts: Puppet Data Centre Automation Solution, Part 4: Classes & Modules Puppet Data Centre Automation Solution, Part 3: Resource Types & Example Configs Puppet Data Centre Automation Solution, Part 1: Setting Up Master & Client Secure Upload Methods in PHP Exploring Software: Plone with Schemas * Using GDB to inspect a running Ruby process This job shouldnैt be taking this long! Thatैs not a great thing to have to say, is it? However, I bet youैve said it before and may not have immediately know why. With liberal use of puts and maybe pry, you can figure out what a problem might be next time you run it, but sometimes you need to figure out what that problem is right now. As it turns out, and I know this is a shocker, Ruby processes are just regular processes. They can be debugged with gdb. Having recently had the need to find out why a job of mine was running particularly slowly, I found out about this lovely tool the hard way: frantic googling. I found some very useful functions for gdb in a blog post by Rasmus on Ruby callstacks. define redirect_stdout call rb_eval_string("$_old_stdout, $stdout = $stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); $stdout.sync = true") end define ruby_eval call(rb_p(rb_eval_string_protect($arg0,(int*)0))) end How to use these: Start up gdb by running gdb /path/to/ruby PID, where /path/to/ruby is the full path to the actual ruby binary and PID is the process ID of the ruby you want to check out. Paste those functions above into the gdb prompt (you might also want to store them in ~/.gdbinit for later). Run redirect_stdout, which will put all the ruby output into a file called /tmp/ruby-debug.PID where PID in this case if the process id of gdb ै not terribly important, but a differentiator in case you do this a lot. Run commands via ruby_eval('Kernel.caller') and object_id and things like that. You should be able to get local variables from wherever you broke into the program. These ruby_eval commands will output into the tempfile that redirect_stdout created, so youैll need to tail -f that file in a different console. Now, with that small headache over with, you can see exactly where your program is and if there is a stupid loop where you forgot to check a boundary condition, or what thing youैre doing with a regular expression on where you should have just used String#index. * gnu parallel: http://www.biostars.org/p/63816/ Best Of News16 Questions712 Unanswered120 Forum33 Tutorials6 Tools10 Videos2 Jobs25 Planet293 Tool: GNU Parallel - parallelize serial command line programs without changing them 30 Article describing tool (for citations): O. Tange (2011): GNU Parallel - The Command-Line Power Tool, ;login: The USENIX Magazine, February 2011:42-47. Authors' website for obtaining code: http://www.gnu.org/software/parallel/ All new computers have multiple cores. Many bioinformatics tools are serial in nature and will therefore not use the multiple cores. However, many bioinformatics tasks (especially within NGS) are extremely parallelizeable: Run the same program on many files Run the same program on every sequence GNU Parallel is a general parallelizer and makes is easy to run jobs in parallel on the same machine or on multiple machines you have ssh access to. EXAMPLE: Replace a for-loop It is often faster to write a command using GNU Parallel than making a for loop: for i in *gz; do zcat $i > $(basename $i .gz).unpacked done can be written as: parallel 'zcat {} > {.}.unpacked' ::: *.gz The added benefit is that the zcats are run in parallel - one per CPU core. EXAMPLE: Blast on multiple machines Assume you have a 1 GB fasta file that you want blast, GNU Parallel can then split the fasta file into 100 KB chunks and run 1 jobs per CPU core: cat 1gb.fasta | parallel --block 100k --recstart '>' --pipe blastp -evalue 0.01 -outfmt 6 -db db.fa -query - > results If you have access to the local machine, server1 and server2, GNU Parallel can distribute the jobs to each of the servers. It will automatically detect how many CPU cores are on each of the servers: cat 1gb.fasta | parallel -S :,server1,server2 --block 100k --recstart '>' --pipe blastp -evalue 0.01 -outfmt 6 -db db.fa -query - > result EXAMPLE: Run bigWigToWig for each chromosome If you have one file per chomosome it is easy to parallelize processing each file. Here we do bigWigToWig for chromosome 1..19 + X Y M. These will run in parallel but only one job per CPU core. The {} will be substituted with arguments following the separator ':::'. bigWigToWig -chrom=chr{} wgEncodeCrgMapabilityAlign36mer_mm9.bigWig mm9_36mer_chr{}.map ::: {1..19} X Y M EXAMPLE: Running composed commands GNU Parallel is not limited to running a single command. It can run a composed command. Here is now you process multiple FASTA files using Biopieces (which uses pipes to communicate): parallel 'read_fasta -i {} | extract_seq -l 5 | write_fasta -o {.}_trim.fna -x' ::: *.fna See also: http://code.google.com/p/biopieces/wiki/HowTo#Howto_use_Biopieces_with_GNU_Parallel EXAMPLE: Running experiments Experiments often have several parameters where every combination should be tested. Assume we have a program called experiment that takes 3 arguments: --age --sex --chr: experiment --age 18 --sex M --chr 22 Now we want to run experiment for every combination of ages 1..80, sex M/F, chr 1..22+XY: parallel experiment --age {1} --sex {2} --chr {3} ::: {1..80} ::: M F ::: {1..22} X Y To save the output in different files you could do: parallel experiment --age {1} --sex {2} --chr {3} '>' output.{1}.{2}.{3} ::: {1..80} ::: M F ::: {1..22} X Y But GNU Parallel can structure the output into directories so you avoid having thousands of output files in a single dir: parallel --results outputdir experiment --age {1} --sex {2} --chr {3} ::: {1..80} ::: M F ::: {1..22} X Y This will create files like outputdir/1/80/2/M/3/X/stdout containing the standard output of the job. If you have many different parameters it may be handy to name them: parallel --result outputdir --header : experiment --age {AGE} --sex {SEX} --chr {CHR} ::: AGE {1..80} ::: SEX M F ::: CHR {1..22} X Y Then the output files will be named like outputdir/AGE/80/CHR/Y/SEX/F/stdout If one of your parameters take on many different values, these can be read from a file using '::::' echo AGE > age_file seq 1 80 >> age_file parallel --results outputdir --header : experiment --age {AGE} --sex {SEX} --chr {CHR} :::: age_file ::: SEX M F ::: CHR {1..22} X Y EXAMPLE(advanced): Using GNU Parallel to parallelize you own scripts Assume you have BASH/Perl/Python script called launch. It takes one arguments, ID: launch ID Using parallel you can run multiple IDs in parallel using: parallel launch ::: ID1 ID2 ... But you would like to hide this complexity from the user, so the user only has to do: launch ID1 ID2 ... You can do that using --shebang-wrap. Change the shebang line from: #!/usr/bin/env bash #!/usr/bin/env perl #!/usr/bin/env python to: #!/usr/bin/parallel --shebang-wrap bash #!/usr/bin/parallel --shebang-wrap perl #!/usr/bin/parallel --shebang-wrap python You further develop your script so it now takes an ID and a DIR: launch ID DIR You would like it to take multiple IDs but only one DIR, and run the IDs in parallel. Again just change the shebang line to: #!/usr/bin/parallel --shebang-wrap bash And now you can run: launch ID1 ID2 ID3 ::: DIR Learn more See more examples: http://www.gnu.org/software/parallel/man.html Watch the intro videos: https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1 Sign up for the email list to get support: https://lists.gnu.org/mailman/listinfo/parallel #ilovefs If you like GNU Parallel: Give a demo at your local user group/team/colleagues Post the intro videos on Reddit/Diaspora*/forums/blogs/ Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists Get the merchandise https://www.gnu.org/s/parallel/merchandise.html * "when you are ready to build you can run "rpmbuild -bb /path/to/spec." ** ---its "rpmbuild" not buildrpm ** see yum install rpm-build rpmbuild Plan: do "rpmbuild -bb blah.spec ** http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment => yum install rpm-build ** http://linux.die.net/man/8/rpmbuild rpmbuild(8) - Linux man page Name rpmbuild - Build RPM Package(s) Synopsis Building Packages: rpmbuild {-ba|-bb|-bp|-bc|-bi|-bl|-bs} [rpmbuild-options] SPECFILE ... rpmbuild {-ta|-tb|-tp|-tc|-ti|-tl|-ts} [rpmbuild-options] TARBALL ... rpmbuild {--rebuild|--recompile} SOURCEPKG ... Miscellaneous: rpmbuild --showrc rpmbuild-options [--buildroot DIRECTORY] [--clean] [--nobuild] [--rmsource] [--rmspec] [--short-circuit] [--sign] [--target PLATFORM] Description rpmbuild is used to build both binary and source software packages. A package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages. One of the following basic modes must be selected: Build Package, Build Package from Tarball, Recompile Package, Show Configuration. General Options These options can be used in all the different modes. -?, --help Print a longer usage message then normal. --version Print a single line containing the version number of rpm being used. --quiet Print as little as possible - normally only error messages will be displayed. -v Print verbose information - normally routine progress messages will be displayed. -vv Print lots of ugly debugging information. --rcfile FILELIST Each of the files in the colon separated FILELIST is read sequentially by rpm for configuration information. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/rpmrc:/usr/lib/rpm/redhat/rpmrc:/etc/rpmrc:~/.rpmrc. --pipe CMD Pipes the output of rpm to the command CMD. --dbpath DIRECTORY Use the database in DIRECTORY rather than the default path /var/lib/rpm --root DIRECTORY Use the file system tree rooted at DIRECTORY for all operations. Note that this means the database within DIRECTORY will be used for dependency checks and any scriptlet(s) (e.g. %post if installing, or %prep if building, a package) will be run after a chroot(2) to DIRECTORY. Build Options The general form of an rpm build command is rpmbuild -bSTAGE|-tSTAGE [ rpmbuild-options ] FILE ... The argument used is -b if a spec file is being used to build the package and -t if rpmbuild should look inside of a (possibly compressed) tar file for the spec file to use. After the first argument, the next character (STAGE) specifies the stages of building and packaging to be done and is one of: -ba Build binary and source packages (after doing the %prep, %build, and %install stages). -bb Build a binary package (after doing the %prep, %build, and %install stages). -bp Executes the "%prep" stage from the spec file. Normally this involves unpacking the sources and applying any patches. -bc Do the "%build" stage from the spec file (after doing the %prep stage). This generally involves the equivalent of a "make". -bi Do the "%install" stage from the spec file (after doing the %prep and %build stages). This generally involves the equivalent of a "make install". -bl Do a "list check". The "%files" section from the spec file is macro expanded, and checks are made to verify that each file exists. -bs Build just the source package. The following options may also be used: --buildroot DIRECTORY When building a package, override the BuildRoot tag with directory DIRECTORY. --clean Remove the build tree after the packages are made. --nobuild Do not execute any build stages. Useful for testing out spec files. --nodeps Do not verify build dependencies. --rmsource Remove the sources after the build (may also be used standalone, e.g. "rpmbuild --rmsource foo.spec"). --rmspec Remove the spec file after the build (may also be used standalone, eg. "rpmbuild --rmspec foo.spec"). --short-circuit Skip straight to specified stage (i.e., skip all stages leading up to the specified stage). Only valid with -bc and -bi. --sign Embed a GPG signature in the package. This signature can be used to verify the integrity and the origin of the package. See the section on GPG SIGNATURES in rpm(8) for configuration details. --target PLATFORM When building the package, interpret PLATFORM as arch-vendor-os and set the macros %_target, %_target_cpu, and %_target_os accordingly. Rebuild and Recompile Options There are two other ways to invoke building with rpm: rpmbuild --rebuild|--recompile SOURCEPKG... When invoked this way, rpmbuild installs the named source package, and does a prep, compile and install. In addition, --rebuild builds a new binary package. When the build has completed, the build directory is removed (as in --clean) and the the sources and spec file for the package are removed. Showrc The command rpmbuild --showrc shows the values rpmbuild will use for all of the options are currently set in rpmrc and macros configuration file(s). Files rpmrc Configuration /usr/lib/rpm/rpmrc /usr/lib/rpm/redhat/rpmrc /etc/rpmrc ~/.rpmrc Macro Configuration /usr/lib/rpm/macros /usr/lib/rpm/redhat/macros /etc/rpm/macros ~/.rpmmacros Database /var/lib/rpm/Basenames /var/lib/rpm/Conflictname /var/lib/rpm/Dirnames /var/lib/rpm/Filemd5s /var/lib/rpm/Group /var/lib/rpm/Installtid /var/lib/rpm/Name /var/lib/rpm/Packages /var/lib/rpm/Providename /var/lib/rpm/Provideversion /var/lib/rpm/Pubkeys /var/lib/rpm/Removed /var/lib/rpm/Requirename /var/lib/rpm/Requireversion /var/lib/rpm/Sha1header /var/lib/rpm/Sigmd5 /var/lib/rpm/Triggername Temporary /var/tmp/rpm* See Also popt(3), rpm2cpio(8), gendiff(1), rpm(8), rpmbuild --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ Authors Marc Ewing Jeff Johnson Erik Troan Referenced By apt.conf(5), compat_digest.plug(1), demo.plug(1), demofiles.plug(1), file2pacdep.plug(1), mock(1), nodoc.plug(1), rpmdeps(8), rpmrebuild(1), rpmrebuild_plugins(1), set_tag.plug(1), tito(8), titorc(5), uniq.plug(1) ** rpm2cpio(8) - Linux man page Name rpm2cpio - Extract cpio archive from RPM Package Manager (RPM) package. Synopsis rpm2cpio [filename] Description rpm2cpio converts the .rpm file specified as a single argument to a cpio archive on standard out. If a '-' argument is given, an rpm stream is read from standard in. rpm2cpio rpm-1.1-1.i386.rpm rpm2cpio - < glint-1.0-1.i386.rpm See Also rpm(8) Author Erik Troan ----met with him many years ago... Referenced By rpmbuild(8), rpmfile(1), rpmpeek(1) * GettingThingsDone/GTD/OrgModeKanbanBoards/Agile/PomodoroTechnique: [[http://www.pomodorotechnique.com]] [[http://www.agilesoc.com/2011/08/08/emacs-org-mode-kanban-pomodoro-oh-my]] [[http://kanis.fr/hg/lisp/ivan/pomodoro.el]] [[file:/e/n/n/lib/elisp/timeclock/timeclock.el]] * CodingAgileOpenSourceProjects: [[http://www.ohloh.net][/u/root.emacs-thumbswww.ohloh.net.png]] [[http://koders.com][/u/root.emacs-thumbswww.koders.com.png]] [[https://www.google.com/calendar][/u/google.com.png]] [[https://docs.google.com][/u/google.com.png]] [[https://github.com][/u/github.com_fluidicon.png]] [[https://trello.com][/u/trello.com.png]] [[http://www.agilesoc.com/2011/08/08/emacs-org-mode-kanban-pomodoro-oh-my][/u/pomidorotechnique.com.png]] [[http://pomidorotechnique.com][/u/pomidorotechnique.com.png]] * GURU/BryanMorris/OrgModeAgileKanban/EMACS: http://www.agilesoc.com/2011/08/08/emacs-org-mode-kanban-pomodoro-oh-my/ ** GNU/EMACS/OrgMode/MobileOrg: http://mobileorg.ncogni.to * https://mosh.mit.edu/ ** https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=mosh%20vs%20screen http://eclecti.cc/computergraphics/science-on-a-snow-globe-spherical-display * http://sed.sourceforge.net/sed1line.txt sed 1 liners! USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5 Latest version of this file (in English) is usually at: http://sed.sourceforge.net/sed1line.txt http://www.pement.org/sed/sed1line.txt This file will also available in other languages: Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html Czech - http://sed.sourceforge.net/sed1line_cz.html Dutch - http://sed.sourceforge.net/sed1line_nl.html French - http://sed.sourceforge.net/sed1line_fr.html German - http://sed.sourceforge.net/sed1line_de.html Italian - (pending) Portuguese - http://sed.sourceforge.net/sed1line_pt-BR.html Spanish - (pending) FILE SPACING: # double space a file sed G # double space a file which already has blank lines in it. Output file # should contain no more than one blank line between lines of text. sed '/^$/d;G' # triple space a file sed 'G;G' # undo double-spacing (assumes even-numbered lines are always blank) sed 'n;d' # insert a blank line above every line which matches "regex" sed '/regex/{x;p;x;}' # insert a blank line below every line which matches "regex" sed '/regex/G' # insert a blank line above and below every line which matches "regex" sed '/regex/{x;p;x;G;}' NUMBERING: # number each line of a file (simple left alignment). Using a tab (see # note on '\t' at end of file) instead of space will preserve margins. sed = filename | sed 'N;s/\n/\t/' # number each line of a file (number on left, right-aligned) sed = filename | sed 'N; s/^/ /; s/ *\(.\{6,\}\)\n/\1 /' # number each line of file, but only print numbers if line is not blank sed '/./=' filename | sed '/./N; s/\n/ /' # count lines (emulates "wc -l") sed -n '$=' TEXT CONVERSION AND SUBSTITUTION: # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format. sed 's/.$//' # assumes that all lines end with CR/LF sed 's/^M$//' # in bash/tcsh, press Ctrl-V then Ctrl-M sed 's/\x0D$//' # works on ssed, gsed 3.02.80 or higher # IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format. sed "s/$/`echo -e \\\r`/" # command line under ksh sed 's/$'"/`echo \\\r`/" # command line under bash sed "s/$/`echo \\\r`/" # command line under zsh sed 's/$/\r/' # gsed 3.02.80 or higher # IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format. sed "s/$//" # method 1 sed -n p # method 2 # IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format. # Can only be done with UnxUtils sed, version 4.0.7 or higher. The # UnxUtils version can be identified by the custom "--text" switch # which appears when you use the "--help" switch. Otherwise, changing # DOS newlines to Unix newlines cannot be done with sed in a DOS # environment. Use "tr" instead. sed "s/\r//" infile >outfile # UnxUtils sed v4.0.7 or higher tr -d \r outfile # GNU tr version 1.22 or higher # delete leading whitespace (spaces, tabs) from front of each line # aligns all text flush left sed 's/^[ \t]*//' # see note on '\t' at end of file # delete trailing whitespace (spaces, tabs) from end of each line sed 's/[ \t]*$//' # see note on '\t' at end of file # delete BOTH leading and trailing whitespace from each line sed 's/^[ \t]*//;s/[ \t]*$//' # insert 5 blank spaces at beginning of each line (make page offset) sed 's/^/ /' # align all text flush right on a 79-column width sed -e :a -e 's/^.\{1,78\}$/ &/;ta' # set at 78 plus 1 space # center all text in the middle of 79-column width. In method 1, # spaces at the beginning of the line are significant, and trailing # spaces are appended at the end of the line. In method 2, spaces at # the beginning of the line are discarded in centering the line, and # no trailing spaces appear at the end of lines. sed -e :a -e 's/^.\{1,77\}$/ & /;ta' # method 1 sed -e :a -e 's/^.\{1,77\}$/ &/;ta' -e 's/\( *\)\1/\1/' # method 2 # substitute (find and replace) "foo" with "bar" on each line sed 's/foo/bar/' # replaces only 1st instance in a line sed 's/foo/bar/4' # replaces only 4th instance in a line sed 's/foo/bar/g' # replaces ALL instances in a line sed 's/\(.*\)foo\(.*foo\)/\1bar\2/' # replace the next-to-last case sed 's/\(.*\)foo/\1bar/' # replace only the last case # substitute "foo" with "bar" ONLY for lines which contain "baz" sed '/baz/s/foo/bar/g' # substitute "foo" with "bar" EXCEPT for lines which contain "baz" sed '/baz/!s/foo/bar/g' # change "scarlet" or "ruby" or "puce" to "red" sed 's/scarlet/red/g;s/ruby/red/g;s/puce/red/g' # most seds gsed 's/scarlet\|ruby\|puce/red/g' # GNU sed only # reverse order of lines (emulates "tac") # bug/feature in HHsed v1.5 causes blank lines to be deleted sed '1!G;h;$!d' # method 1 sed -n '1!G;h;$p' # method 2 # reverse each character on the line (emulates "rev") sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//' # join pairs of lines side-by-side (like "paste") sed '$!N;s/\n/ /' # if a line ends with a backslash, append the next line to it sed -e :a -e '/\\$/N; s/\\\n//; ta' # if a line begins with an equal sign, append it to the previous line # and replace the "=" with a single space sed -e :a -e '$!N;s/\n=/ /;ta' -e 'P;D' # add commas to numeric strings, changing "1234567" to "1,234,567" gsed ':a;s/\B[0-9]\{3\}\>/,&/;ta' # GNU sed sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' # other seds # add commas to numbers with decimal points and minus signs (GNU sed) gsed -r ':a;s/(^|[^0-9.])([0-9]+)([0-9]{3})/\1\2,\3/g;ta' # add a blank line every 5 lines (after lines 5, 10, 15, 20, etc.) gsed '0~5G' # GNU sed only sed 'n;n;n;n;G;' # other seds SELECTIVE PRINTING OF CERTAIN LINES: # print first 10 lines of file (emulates behavior of "head") sed 10q # print first line of file (emulates "head -1") sed q # print the last 10 lines of a file (emulates "tail") sed -e :a -e '$q;N;11,$D;ba' # print the last 2 lines of a file (emulates "tail -2") sed '$!N;$!D' # print the last line of a file (emulates "tail -1") sed '$!d' # method 1 sed -n '$p' # method 2 # print the next-to-the-last line of a file sed -e '$!{h;d;}' -e x # for 1-line files, print blank line sed -e '1{$q;}' -e '$!{h;d;}' -e x # for 1-line files, print the line sed -e '1{$d;}' -e '$!{h;d;}' -e x # for 1-line files, print nothing # print only lines which match regular expression (emulates "grep") sed -n '/regexp/p' # method 1 sed '/regexp/!d' # method 2 # print only lines which do NOT match regexp (emulates "grep -v") sed -n '/regexp/!p' # method 1, corresponds to above sed '/regexp/d' # method 2, simpler syntax # print the line immediately before a regexp, but not the line # containing the regexp sed -n '/regexp/{g;1!p;};h' # print the line immediately after a regexp, but not the line # containing the regexp sed -n '/regexp/{n;p;}' # print 1 line of context before and after regexp, with line number # indicating where the regexp occurred (similar to "grep -A1 -B1") sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h # grep for AAA and BBB and CCC (in any order) sed '/AAA/!d; /BBB/!d; /CCC/!d' # grep for AAA and BBB and CCC (in that order) sed '/AAA.*BBB.*CCC/!d' # grep for AAA or BBB or CCC (emulates "egrep") sed -e '/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d # most seds gsed '/AAA\|BBB\|CCC/!d' # GNU sed only # print paragraph if it contains AAA (blank lines separate paragraphs) # HHsed v1.5 must insert a 'G;' after 'x;' in the next 3 scripts below sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;' # print paragraph if it contains AAA and BBB and CCC (in any order) sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;/BBB/!d;/CCC/!d' # print paragraph if it contains AAA or BBB or CCC sed -e '/./{H;$!d;}' -e 'x;/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d gsed '/./{H;$!d;};x;/AAA\|BBB\|CCC/b;d' # GNU sed only # print only lines of 65 characters or longer sed -n '/^.\{65\}/p' # print only lines of less than 65 characters sed -n '/^.\{65\}/!p' # method 1, corresponds to above sed '/^.\{65\}/d' # method 2, simpler syntax # print section of file from regular expression to end of file sed -n '/regexp/,$p' # print section of file based on line numbers (lines 8-12, inclusive) sed -n '8,12p' # method 1 sed '8,12!d' # method 2 # print line number 52 sed -n '52p' # method 1 sed '52!d' # method 2 sed '52q;d' # method 3, efficient on large files # beginning at line 3, print every 7th line gsed -n '3~7p' # GNU sed only sed -n '3,${p;n;n;n;n;n;n;}' # other seds # print section of file between two regular expressions (inclusive) sed -n '/Iowa/,/Montana/p' # case sensitive SELECTIVE DELETION OF CERTAIN LINES: # print all of file EXCEPT section between 2 regular expressions sed '/Iowa/,/Montana/d' # delete duplicate, consecutive lines from a file (emulates "uniq"). # First line in a set of duplicate lines is kept, rest are deleted. sed '$!N; /^\(.*\)\n\1$/!P; D' # delete duplicate, nonconsecutive lines from a file. Beware not to # overflow the buffer size of the hold space, or else use GNU sed. sed -n 'G; s/\n/&&/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P' # delete all lines except duplicate lines (emulates "uniq -d"). sed '$!N; s/^\(.*\)\n\1$/\1/; t; D' # delete the first 10 lines of a file sed '1,10d' # delete the last line of a file sed '$d' # delete the last 2 lines of a file sed 'N;$!P;$!D;$d' # delete the last 10 lines of a file sed -e :a -e '$d;N;2,10ba' -e 'P;D' # method 1 sed -n -e :a -e '1,10!{P;N;D;};N;ba' # method 2 # delete every 8th line gsed '0~8d' # GNU sed only sed 'n;n;n;n;n;n;n;d;' # other seds # delete lines matching pattern sed '/pattern/d' # delete ALL blank lines from a file (same as "grep '.' ") sed '/^$/d' # method 1 sed '/./!d' # method 2 # delete all CONSECUTIVE blank lines from file except the first; also # deletes all blank lines from top and end of file (emulates "cat -s") sed '/./,/^$/!d' # method 1, allows 0 blanks at top, 1 at EOF sed '/^$/N;/\n$/D' # method 2, allows 1 blank at top, 0 at EOF # delete all CONSECUTIVE blank lines from file except the first 2: sed '/^$/N;/\n$/N;//D' # delete all leading blank lines at top of file sed '/./,$!d' # delete all trailing blank lines at end of file sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' # works on all seds sed -e :a -e '/^\n*$/N;/\n$/ba' # ditto, except for gsed 3.02.* # delete the last line of each paragraph sed -n '/^$/{p;h;};/./{x;/./p;}' SPECIAL APPLICATIONS: # remove nroff overstrikes (char, backspace) from man pages. The 'echo' # command may need an -e switch if you use Unix System V or bash shell. sed "s/.`echo \\\b`//g" # double quotes required for Unix environment sed 's/.^H//g' # in bash/tcsh, press Ctrl-V and then Ctrl-H sed 's/.\x08//g' # hex expression for sed 1.5, GNU sed, ssed # get Usenet/e-mail message header sed '/^$/q' # deletes everything after first blank line # get Usenet/e-mail message body sed '1,/^$/d' # deletes everything up to first blank line # get Subject header, but remove initial "Subject: " portion sed '/^Subject: */!d; s///;q' # get return address header sed '/^Reply-To:/q; /^From:/h; /./d;g;q' # parse out the address proper. Pulls out the e-mail address by itself # from the 1-line return address header (see preceding script) sed 's/ *(.*)//; s/>.*//; s/.*[:<] *//' # add a leading angle bracket and space to each line (quote a message) sed 's/^/> /' # delete leading angle bracket & space from each line (unquote a message) sed 's/^> //' # remove most HTML tags (accommodates multiple-line tags) sed -e :a -e 's/<[^>]*>//g;/zipup.bat dir /b *.txt | sed "s/^\(.*\)\.TXT/pkzip -mo \1 \1.TXT/" >>zipup.bat TYPICAL USE: Sed takes one or more editing commands and applies all of them, in sequence, to each line of input. After all the commands have been applied to the first input line, that line is output and a second input line is taken for processing, and the cycle repeats. The preceding examples assume that input comes from the standard input device (i.e, the console, normally this will be piped input). One or more filenames can be appended to the command line if the input does not come from stdin. Output is sent to stdout (the screen). Thus: cat filename | sed '10q' # uses piped input sed '10q' filename # same effect, avoids a useless "cat" sed '10q' filename > newfile # redirects output to disk For additional syntax instructions, including the way to apply editing commands from a disk file instead of the command line, consult "sed & awk, 2nd Edition," by Dale Dougherty and Arnold Robbins (O'Reilly, 1997; http://www.ora.com), "UNIX Text Processing," by Dale Dougherty and Tim O'Reilly (Hayden Books, 1987) or the tutorials by Mike Arst distributed in U-SEDIT2.ZIP (many sites). To fully exploit the power of sed, one must understand "regular expressions." For this, see "Mastering Regular Expressions" by Jeffrey Friedl (O'Reilly, 1997). The manual ("man") pages on Unix systems may be helpful (try "man sed", "man regexp", or the subsection on regular expressions in "man ed"), but man pages are notoriously difficult. They are not written to teach sed use or regexps to first-time users, but as a reference text for those already acquainted with these tools. QUOTING SYNTAX: The preceding examples use single quotes ('...') instead of double quotes ("...") to enclose editing commands, since sed is typically used on a Unix platform. Single quotes prevent the Unix shell from intrepreting the dollar sign ($) and backquotes (`...`), which are expanded by the shell if they are enclosed in double quotes. Users of the "csh" shell and derivatives will also need to quote the exclamation mark (!) with the backslash (i.e., \!) to properly run the examples listed above, even within single quotes. Versions of sed written for DOS invariably require double quotes ("...") instead of single quotes to enclose editing commands. USE OF '\t' IN SED SCRIPTS: For clarity in documentation, we have used the expression '\t' to indicate a tab character (0x09) in the scripts. However, most versions of sed do not recognize the '\t' abbreviation, so when typing these scripts from the command line, you should press the TAB key instead. '\t' is supported as a regular expression metacharacter in awk, perl, and HHsed, sedmod, and GNU sed v3.02.80. VERSIONS OF SED: Versions of sed do differ, and some slight syntax variation is to be expected. In particular, most do not support the use of labels (:name) or branch instructions (b,t) within editing commands, except at the end of those commands. We have used the syntax which will be portable to most users of sed, even though the popular GNU versions of sed allow a more succinct syntax. When the reader sees a fairly long command such as this: sed -e '/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d it is heartening to know that GNU sed will let you reduce it to: sed '/AAA/b;/BBB/b;/CCC/b;d' # or even sed '/AAA\|BBB\|CCC/b;d' In addition, remember that while many versions of sed accept a command like "/one/ s/RE1/RE2/", some do NOT allow "/one/! s/RE1/RE2/", which contains space before the 's'. Omit the space when typing the command. OPTIMIZING FOR SPEED: If execution speed needs to be increased (due to large input files or slow processors or hard disks), substitution will be executed more quickly if the "find" expression is specified before giving the "s/.../.../" instruction. Thus: sed 's/foo/bar/g' filename # standard replace command sed '/foo/ s/foo/bar/g' filename # executes more quickly sed '/foo/ s//bar/g' filename # shorthand sed syntax On line selection or deletion in which you only need to output lines from the first part of the file, a "quit" command (q) in the script will drastically reduce processing time for large files. Thus: sed -n '45,50p' filename # print line nos. 45-50 of a file sed -n '51q;45,50p' filename # same, but executes much faster If you have any additional scripts to contribute or if you find errors in this document, please send e-mail to the compiler. Indicate the version of sed you used, the operating system it was compiled for, and the nature of the problem. To qualify as a one-liner, the command line must be 65 characters or less. Various scripts in this file have been written or contributed by: Al Aab # founder of "seders" list Edgar Allen # various Yiorgos Adamopoulos # various Dale Dougherty # author of "sed & awk" Carlos Duarte # author of "do it with sed" Eric Pement # author of this document Ken Pizzini # author of GNU sed v3.02 S.G. Ravenhall # great de-html script Greg Ubben # many contributions & much help ------------------------------------------------------------------------- * vmware install "vmware workstation 8" ** https://my.vmware.com/group/vmware/evalcenter?p=vmware-workstation9 ** "shared virtual machines" /var/lib/vmware/Shared VMs ** port to use for https access to workstation server ?? ** file se ** had this error 1. error screen Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module `vmmon' is loaded. 2. error screen Failed to initialize monitor device. 3. error screen The virtual machine is busy. *** did this mv /usr/lib/vmware/modules/binary /usr/lib/vmware/modules/binary.old vmware-modconfig --console --install-all --appname="VMware Player" --icon="vmware-player" * cool way to test scripts //nwadmin@brianp-dev:~/Alfresco/Dev/scripts/database Thu Sep 27 14:20:48 441 1421 -bash 1 rm -Rf j ; mkdir j; cp j.j j; cp j.j j/k.j ; rm -Rf /tmp/jtemp ; rm -Rf zzz; ~/Alfresco/Dev/scripts/database/archiveMove.ksh ~/Alfresco/Dev/scripts/database/enc.cfg.example ~/Alfresco/Dev/scripts/database/j 0 0 0 rsync -Habu --progress -e 'ssh' /home/nwadmin/Alfresco/Dev/scripts/database root@5.5.5.5:/ ssh -t root@5.5.5.5 emacs /database Here are notes you can use when deploying a vm from a template. Deploy a vm from the CentOS 5.6 hardened template. Within the VMWare server, power on the vm. Open its console. Login as root run ifconfig eth0, note HWaddr 00:50:56:9D:65:1A vi /etc/sysconfig/network-scripts/ifcfg-eth0 CHANGE BOOTPROTO=DHCP to STATIC CHANGE HWADDR=00:50:56:9F:47:0E(replace value with ifconfig eth0 HWaddr value ADD IPADDR=whatever.you.chose ADD GATEWAY=10.25.52.1 ADD NETMASK=255.255.255.0 ADD DNS1=10.25.55.15 :wq run service network restart Test $>ping www.google.com Should be successful. If not, double check your changes. UPDATE Hostname vi /etc/hosts CHANGE Line 127.0.0.1 centos.template to 127.0.0.1 your-new-host-name :wq vi/etc/sysconfig/network HOSTNAME=localhost.localdomain to HOSTNAME=your-new-host-name :wq Change hostname for current session- $>hostname your-new-host-name Logout of console within VMWare server. Now you can use a cygwin xterm and ssh to new host. ssh -p 2012 nwadmin@ip address su - root Set the time Set hardware clock: /sbin/hwclock --utc --set --date="01/05/2012 15:54:30" (Set either --utc or --localtime) Then match system clock: /sbin/hwclock --hctosys reboot the vm and check to see vm success ---do "PowerVMOff|On" $ service network restart $ yum update Take a snapshot of new vm * how to clone a vm: ** from rdp screen login to new interface/vcenter (more powerful)---at ip 10.25.52.171 *** miscelaneous **** once you start migrating around you can lose your templates--so I had to copy my templates ** when cloning--to be safe "power off" *** might want to clone to have an identical machine with diff ip to see if something is "scaling"--may have software that you want/need to test with more than one machine *** when cloning alway store new clones where there is the most space on the datastores available **** delete clones ASAP *** if you need a static ip---you'll usually need one to make a new clone ** edit the file ../ifcg-eth0 *** change the ip address *** change the mac address (get this from the gui interface) *** check that you can ping www.google.com => dns working *** check that you can ping 8.8.4.4 ** type notes and maybe your initials and make notes on the point of the clone into the gui---can call it anything ** to delete the clone once your done with it use the gui to choose "DeleteFromDisk" *** then send an email to rc/SysAdmin about the free ip- /stopall-mplayer ; watch -n1 "xte -x :0 \"mouseclick 1\" 2> /dev/null " /contall-mplayer ; ! " # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ watch -n1 "xte -x :1 \"mouseclick 1\" \"key q\" \"key BackSpace\" 2> /dev/null " 6566676869707172737475767778798081828384858687888990919293949596 /killall_mplayer ; watch -n6 "xte -x :0 \"mouseclick 1\" 2> /dev/null " ; watch -n6 "xte -x :1 \"mouseclick 1\" 2> /dev/null " ; watch -n2 "xte -x :0 \"key Page_Down\" 2> /dev/null " [and in separate Cc-able shell] /recordMyDesktop-pkrstrs_arg1.sh .5 ; /recordMyDesktop-full-shots_arg1.sh 1 ; watch -n14 "xte -x :0 \"key Page_Down\" \"sleep 2\" \"key Page_Down\" \"sleep 2\" \"key Page_Down\" \"sleep 2\" \"key Page_Down\" \"sleep 2" \"key Page_Up\" \"key Page_Up\" \"key Page_Up\" \"key Page_Up\" \"sleep 2\" \"mouseclick 1\" 2> /dev/null " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` /usr/lib/firefox/firefox;/firefox3.0.1/firefox ; find . -type f -exec chmod 644 \'{}\' \; gmail.com cnbc.com http://eyeos.info/\?lang=en & 979899000102030405060708091011121314151617181920212223242526 /toppercentchecks_update_old_old_djia-IWM-TMW.sh ; /woman & ; Rscript -e 'date()' -e 'format(Sys.time(), "%a %b %d %X %Y")' ; wmctrl -r "Google Earth" -e 0,0,0,800,600 ; for directories in $(find /e/fractals* -type d) ; do ( cp /e/fractals-view-until-mastered-poker-now-now-now/2-fave-tables-for-pokah_juxtaposed-to-expected-number_9-players.png $directories ) ; done ; * To find the taskname/process to kill on a WindozeXP box: CygwinTerminal-> tasklist (revealed LckPkr zombie window running as client.exe: CygwinTerminal-> taskkill /im client.exe /f ; CxdCaCk /protocol:user@host:/ -> /ssh:root@72.14.182.35:/ ; pidof mplayer ; Mx server-start || /e/mepis24_snapshot & => emacsclient -c || wmctrl -xa emacs && emacsclient -e "(progn (message \"message 555 \") nil)" && date > /j.j;emacsclient -e "(progn (switch-to-buffer \"1.j\")(open-line 5)(insert-file-literally \"/j.j\")(save-some-buffers t) nil)" ; head -5 /1.j ; google blogger post -u briangpowellms@gmail.com --blog 'GELOPPY' --title 'testpost' 'blah' ; In sc to copy a column: goto column and then yc then goto new column and type pc ; /orgmode_arg1.sh /bookmarks_top9.org ; perl -le 'print"rpcpassword=",map{(a..z,A..Z,0..9)[rand 62]}0..9' ; sleep 3600 && /e/alarm-repeat-loop.sh ; pdfjam ebold_cl.pdf ebold_cv.pdf --outfile ida.pdf ; fuser / ; pidof emacs ; export FIRSTLETTER=substr(blahvar,1) ; Mx find-dired^M^M Run find (with args): -type f^M %m^M Mark files (regexp): \.j$^M Q ... S D ; openssl prime 137 ; openssl enc -aes-256-cbc -salt -in j.j -out k.j -pass pass:blah && openssl enc -aes-256-cbc -salt -in k.j -out j.j -pass pass:blah -d ; find ~/ATE/ -type f -exec grep -His "baseclass" \{\} \; perldoc -t j.pm ; cat /etc/*-release||dmesg|head -1||cat /proc/version||cat /etc/issue||uname -a ; if(cat /proc/cpuinfo |grep flags|grep lm)=>can run 64bit apps ; tar -zcf - fileordirectory|openssl enc -aes-256-cbc -salt -out fileordirectory.tar.gz.enc -pass pass:jypjup ; rm -Rf dir ; openssl enc -aes-256-cbc -salt -in fileordirectory.tar.gz.enc -pass pass:jypjup -d|tar -xz -f - ; Get scripts thru outlook:zip -e -P netwitness new.zip /blah.sh ; perl -e 'print (1 .. 42)'==perlconsole^Mprint (1 .. 42) ; slings blahfile ; break 5||continue 5 ; cd /.git/wiki && emacs ; export s=/dir/blah;basename $s==blah==echo ${s##*/} ; ruby -i.bak -pe 'sub "old", "new"' j ; parallel ::: "/flipit -t /dev/ttyUSB0 flip f1 off" "/flipit -t /dev/ttyUSB0 flip f1 off" ; //root@ggggg:~ Sun Mar 01 00:09:31 1 548 bash 1 72.192.221.128 192.168.1.102 ; zenity --info --text="This is an information box." ; status=$? ==status of last command ; parallel 'mv {} {.}.k' ::: *.j ; vi j.j,Cv,jjjjx==remove-rectangle ; parallel 'ln -s {} /a/music/mp4' ::: /zill/DEV*.* ; find .|parallel blahscript {} ; seq 1 5 ; parallel echo ::: {2..9} T J Q K A ::: C D H S ~= echo {A,K,Q,J,T,9,8,7,6,5,4,3,2}{S,H,D,C} ; grep -i SATA /boot/config-$(uname -r) ; yum update;yum install nrpe nagios-common nagios-plugins nagios-plugins-{disk,dns,users,load,procs} ; SSHPASS=$(cat /e/.lsling) rsync --rsh='sshpass -e ssh' -Hab --no-perms --chmod u+rwx /tmp/chumby_9plan9.html root@72.14.182.35:/var/www/html;sshpass -p $(cat /e/.lsling) ssh root@72.14.182.35 chmod 755 /var/www/html/chumby_9plan9.html;SSHPASS=$(cat /e/.lsling) rsync --rsh='sshpass -e ssh' -Hab --no-perms --chmod u+rwx /tmp/chumby_9plan9.html root@72.14.182.35:/opt/lampp/htdocs ; mindkontrol IS the ratio of negative thoughts ; autocutsel -fork ; xte 'mouseup 1' -x :0 ; autocutsel -s PRIMARY -fork ; (shell-command-at-end-of-line "date") ; seq 10000 | parallel -j100 wget https://www.example.com/page{}.html ; sleep 9 ; amixer set PCM 100% ; play /s/17130__NoiseCollector__ak47_chamber_round.wav && play /s/37237__Shades__Gun_Shot_Gun_2_pumps_.wav ; rename 's/ /_/g' blah.* ; ruby -run -e httpd . -p5000 ; /bookmarks_uuuuu ; /etc/init.d/network-manager stop && /etc/init.d/network-manager start ; rsync -Ha j.j bpowell@10.18.1.51:/home/bpowell ; /sbin/service httpd restart ; :.,$s/old/new/gc==Mx query-replace ; export TERM=xterm ; parallel --gnu ::: "/bookmarks" "xterm -ls" & ; Mx dired-single-buffer ; stat blahdir ; stat blahfile ; rpm -qa ; xmodmap -pke > ~/.Xmodmap;emacs ~/.Xmodmap;xmodmap ~/.Xmodmap ;service ssh restart;service network-manager stop;rm /var/lib/NetworkManager/NetworkManager.state;service network-manager start ; pulseaudio & disown ; iptables -A INPUT -p tcp -dport 80 -j ACCEPT;service iptables restart ; setenforce 0==turn-off-selinux ; chkconfig;chkconfig --level 23456 xinetd on;vi /etc/xinetd.conf;service xinetd start;sync;sync;rboot ; find . -inum 55 -exec rm -i {} \; mkcramfs diryouwantinonefile blah.cramfs;mkdir /tmp/temp;mount -t cramfs -o loop blah.cramfs /tmp/temp ; blkid -c /dev/null -o list|ls -la /dev/mapper;mount -t reiserfs /dev/mapper/55555-part2 /j ; udisks --dump ; udevadm monitor ; multipathd -k;show config ; /usr/openv/volmgr/bin/scan -tape ; tpconfig -d;tpconfig -emm_dev_list -dl;tpautoconf ; pam_tally2 --user=nimdaikp --reset ; service iptables stop||iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT||iptables -I INPUT -s 10.1.2.104 -p all -j ACCEPT;rsync -Ha /root/NetBackupClient/NetBackup_7.5_CLIENTS nimdaikp@ds-internal-31b:/home/nimdaikp;rsync -Ha /root/Downloads/temp5555 nimdaikp@10.18.1.141:/home/nimdaikp ; cat /etc/redhat-release ; lastb|awk '{print $1}'|sort|uniq -c|sort -rn|head -5 ; cd-info ; killall -r chrome ; wodim -scanbus;cdrecord blank=fast dev=55,0,0|cdrecord blank=fast dev=/dev/scd0|dvd+rw-format -force /dev/dvd ; fc-list : file fullname family style ; vxlogview --tail 1:01:00 ; scrot -b -s -u -d 3 j.png;geeqie j.png ; cnee --record --mouse -o /e/turn-volume-max.cnee;watch -p -n7 "cat /e/turn-volume-max.cnee|cnee --replay" ; xlsclients -l ; perl -V|grep "useithreads=define" ; apt-get install psmisc;prtstat 8675 ; export MYVAR="fooquuxbar";export SUB=${MYVAR:3:4};echo $SUB ; mplayer -vo x11 -noidx -autosync 30 -mc 0.001 -geometry 0%:80% -zoom "E M.mp4" &> /dev/null & disown ; comm 1.n 2.n =>3 columns:lines unique to FILE1,FILE2 and lines in common in both files! ; play -n synth whitenoise 200 fade 0.2 1 1 trim 0 0.5;sleep 1;play -n synth whitenoise 200 fade 0 1 1 trim 0 1 ; cat /cowsay;encfs /encfs-raw /e;pkill -9 emacs ; cat /proc/meminfo ; nslookup google.com=>Address:68.105.28.11#53;echo DNS=port53;ping www.google.com -p 53 ; for i in $(seq 1 9);do nc -v -n -z -w 1 192.168.1.10$i 5900;done ; netstat -lpn ; nmap 127.0.0.1 ; fuser -k 22/tcp==close-ssh but sshd -D restarts so do: iptables -I INPUT -p tcp --dport 22 -j DROP ==filter-out-access-to-ssh-port-22 ; Vi:?==regexp-search-in-Vi! ; /bookmarks & disown ; /bookmarks_uuuuu & disown * make this an icon---make it a pirate icon shell:parallel --gnu ::: "zsh /e/forkbomb-antedote.zsh" " :(){ :|: & };:" &]] On Sat, Sep 22, 2012 at 11:29 PM, brian powell wrote: [[shell:parallel --gnu ::: "zsh /e/forkbomb-antedote.zsh" "sleep 5 ; :(){ :|: & };:" &]] this of course requires: /e/forkbomb-antedote.zsh will be: while (sleep 100 &) do; done & Forwarded conversation Subject: .(){ .|.& };. --tweet this? == %0|%0 ?? ------------------------ From: brian powell Date: Sat, Sep 22, 2012 at 9:17 PM To: Brian Powell , brian.powell@emc.com * put this in bash--forkbomb/crash a system/crash a machine: .(){ .|.& };. .(){ .|.& };. --tweet this? == %0|%0 ?? * C/C++ #include int main() { while(1) fork(); return 0; } * posix forkbomb() { forkbomb|forkbomb & } forkbomb * c? while(malloc(sizeof(char))); ---------- From: brian powell Date: Sat, Sep 22, 2012 at 9:18 PM To: Brian Powell , brian.powell@emc.com Perl fork while fork Python import os while True: os.fork() Ruby fork while fork ---------- From: brian powell Date: Sat, Sep 22, 2012 at 9:22 PM To: Brian Powell , brian.powell@emc.com :(){ :|: & };: One important "feature" in this computer code means that a fork bomb process which can no longer fork doesn't stick around, but rather exits. In this situation, if we also try to run a new process often enough, eventually one will successfully start. If the new process does nothing, each new do-nothing process we run reduces the number of rampant "fork bomb" processes by one, until eventually all of them can be eradicated. At this point the do-nothing processes can exit. The following short Z Shell code might get rid of the above fork bomb in about a minute[citation needed]: while (sleep 100 &) do; done ---------- From: brian powell Date: Sat, Sep 22, 2012 at 9:25 PM To: Brian Powell , brian.powell@emc.com make this icon?! [[shell:parallel --gnu ::: ":(){ :|: & };:"\ " while (sleep 100 &) do; done " --ie try doing a forkbomb simultaneously doing an antedote/cleanup script ---------- From: brian powell Date: Sat, Sep 22, 2012 at 9:41 PM To: Brian Powell , brian.powell@emc.com this one crashed my system: :(){ :|: & };: ----this worked!! ---------- From: brian powell Date: Sat, Sep 22, 2012 at 9:55 PM To: Brian Powell , brian.powell@emc.com #include int main(void) { for(;;) fork(); /* each time this is called, # processes *=2 */ return 0; } * Tunnel Deployment Description This page explains Secure Shell(SSH) tunnels. The tunnels are built using the SSH protocol. It covers purpose, setup, monitoring, and deployment. There are three types of SSH tunnels-local or port fowarded tunnels, reverse tunnel, and dynamic tunnels. This page describes local and reverse tunnels. Purpose An SSH tunnel allows two hosts to communicate when network topology prevents communication. For example, firewalls may prevent two hosts from communicating with each other. But, an SSH tunnel, if implemented properly, can create a communication channel. The channel is encrypted but the data being sent through the channel is not. Requirements Implementing an ssh tunnel requires the following resources exist- A user has a valid login to both hosts. Both hosts have SSH installed, OpenSSH for example. Identification Determining whether tunnels exist is simply a matter of checking if ssh is running. Then, filter the results and check for ports opened to remote systems. Check if ssh is running- ps -ef | grep -i ssh The output will show any processes utilitzing ssh. If the program that creates the tunnel has the string "tunnel" in the name, then "pgrep" could be used: pgrep tunnel This will list the process-id numbers of the existing tunnels. The "netstat" utility could be used like this: netstat -tpln | grep ssh This will show which processes are "listening" on which ports. The "lsof" utility can be used to identify a "list of open files" so tunnels and/or connections made to "ssh" or "sshd" can be found like this: lsof -i -n | grep ssh Build These RPM packages are needed to setup an SSH tunnel on CentOS Linux: openssh, openssh-server, openssh-clients A good way to get and/or ensure the packages are installed is to use the YUM package manager like this: yum install openssh yum install openssh-server yum install openssh-clients The client's user public SSH key (~/.ssh/id_rsa.pub) must be added to the servers authorized file (~/.ssh/authorized_keys). If a script is used, then the SSH key may have to be accepted once by making a preliminary manual login connection since the script will require the that the machine is a trusted one. The use of a program, a configuration file and a log file aren't required, but such tools should be used when a lot of tunnels are created. Otherwise, things can get very confusing and hard to manage. A configuration file can be stored; for example, in a file like: /root/tunnel/cfg/tunnelssh.cfg.. The log file (created when the tunnel is run) can be stored; for example, in a file like: /var/log/tunnelssh/tunnelssh.cfg...log Example-Local tunnel This example demonstrates how to setup a local ssh tunnel. The tunnel will forward a local port to a remote host. This is the type of tunnel typically setup to connect to a dmz host. Three hosts are involved. Host A is your laptop. It resides on the dhcp vlan. Host B is an intermediary host. It can comuunicate to both host A & host B. Host C resides in the DMZ. It's only accessible via host B. Here's how to create a local tunnel that will allow host A to communicate to host C. ssh -p -L :: @ Executing this command on hostB. ssh -p 2012 -g -L 40080:hostB:80 loginuser@hostC Where- ssh-open communication using the ssh protocol -p-specifies non-default port 2012-is the non-default port. -g-Allows remote hosts to connect to local forwarded ports. -L-Specifies that the given port on the local host is to be forwarded to the given host and port on the remote side. 40080-is an arbitrary localport opened up in iptables. hostB-will maintain the tunnel by forwarding a local port to the remote host, hostC. 80-the remote port containing traffic that will be transmitted across the tunnel. loginuser-the login id on the remote host. hostC-ip address of the remote host. Now, run the following command on hostA. Then, a tunnel will be used to allow hostA to communicate with hostC through the tunnel. ssh -p 40080 loginuser@hostB Example-Remote tunnel This example demonstrates how to setup a remote ssh tunnel. The tunnel will forward a remote port to a local host. Three hosts are involved. Host A is your laptop. It resides on the dhcp vlan. Host B resides in the DMZ. Host B can communicate with host A, but host A can't communicate with Host B. Here's how to create a remote tunnel that will allow host A to communicate to host C. ssh -p -R :: @ Executing this command on hostC. ssh -p 8822 -g -R 8000:hostB:8000 loginuser@hostA Where- ssh-open communication using the ssh protocol -p-specifies non-default port 2012-is the non-default port. -g-Allows remote hosts to connect to local forwarded ports. -L-Specifies that the given port on the local host is to be forwarded to the given host and port on the remote side. 40080-is an arbitrary localport opened up in iptables. hostB-will maintain the tunnel by forwarding a local port to the remote host, hostC. 80-the remote port containing traffic that will be transmitted across the tunnel. loginuser-the login id on the remote host. hostC-ip address of the remote host. HostA can now communicate to hostC by running this command- ssh -p 2012 loginuser@hostB ** vmConfigure.ksh #!/bin/bash # Description: This script can be used to finish the deployment of a machine # running CentOS Linux. The user supplies four valid arguments on the command line: # hostname, internet address, netmask and gateway. # Requirements: Computer that runs CentOS Linux 5 or CentOS Linux 6. # This script is intended to be run while logged in as root. # The ifconfig utility is used to extract the machine address and # the interface information. Its a simple script that, once an instance # of a template of a virtual machine is deployed; for example, it can handle # the tedious details of standing up a running machine. # When the script is run, the expected results are that the variables are edited in the # configuration files and they are changed to the parameters the user chooses. # Also, the main hostname and ssh keys of the machine will be generated. The ssh keys of # root and nwadmin are generated. The network is restarted and the gateway is "pinged". # The following variables are substituted: # DEVICE: The interface network card # IPADDR: The IP address # HWADDR: The machine hardware address # NETMASK: The network netmask # GATEWAY: The network gateway # Define script constants VERSIONTEXT='$Revision: 851 $' REQUIREDBINS=( 'cat' 'hostname' 'ifconfig' 'ping' 'rm' 'sed' '/sbin/service' 'ssh-keygen' ) REQUIREDVARS=( 'DEVICE' 'GATEWAY' 'HOSTNAME' 'HWADDR' 'IPADDR' 'NETMASK' ) REQUIREDCFGS=( '/etc/hosts' '/etc/sysconfig/network-scripts/ifcfg-eth0' '/etc/sysconfig/network' ) # Check the syntax if [ $# -lt 4 ] then echo "vmConfigure.ksh " VERSION=$(echo "${VERSIONTEXT}" | cut -f2 -d\ ) echo " version: ${VERSION}" exit 1 fi # Initialize the positional parameters HOSTNAME="${1}" IPADDR="${2}" NETMASK="${3}" GATEWAY="${4}" # Initialize all variables status=0 # Ensure that required binaries are present, if "which" is installed if which which &> /dev/null then missing=() for bin in "${REQUIREDBINS[@]}" do if ! which "${bin}" &> /dev/null then missing+=( "${bin}" ) fi done # Error if missing any of the required binaries if [ "${#missing[@]}" -gt 0 ] then echo "Unable to run program since these ${#missing[@]} required binaries are missing: ${missing[@]}" exit 1 fi fi # Ensure the existence of all the required configuration files that will be edited missing=() for config in "${REQUIREDCFGS[@]}" do if ! [ -f "${config}" ] then missing+=( "${config}" ) fi done # Error if missing any of the required binaries if [ "${#missing[@]}" -gt 0 ] then echo "Unable to determine OS information since these ${#missing[@]} required configuration files are missing: ${missing[@]}" exit 1 fi # Query the virtual machine for the delivered and configured default interface and store the required variable if ! INTERFACE=$(ifconfig -a | sed -n '/^eth/p' | head -1 | sed 's/[[:blank:]]*$//') then echo "Unable to determine interface information." exit 1 fi # Setting required configuration variables DEVICE=eth0 HWADDR="${INTERFACE##*\ }" # Ensure the existence of all the required configuration variables that will be used to edit the configuration files missing=() for var in "${REQUIREDVARS[@]}" do # Check for a zero-length variable if [ -z "${!var}" ] then missing+=( "${var}" ) fi done # Error if missing any of the required variables if [ "${#missing[@]}" -gt 0 ] then echo "Unable to continue due to these ${#missing[@]} missing but required variables: ${missing[@]}" exit 1 fi # Make the necessary edits of the configuration file and make a networking machine echo '' echo "Configuring virtual machine:" echo '' # Timing operations let time="${SECONDS}" printf ' %-45s' 'Configuring hosts' # Ensure all lines starting with "127.0.0.1" are commented out if ! sed -i -e "s/^\(127.0.0.1.*\)/#\1/g" /etc/hosts > /dev/null then echo "Failure during the configuration of the localhost." exit 1 fi # Ensure lines that contain the string "localhost" aren't commented out if ! sed -i -e "s/^\(#\)\(127.0.0.1.*localhost\)/\2/g" /etc/hosts > /dev/null then echo "Failure during the configuration of the localhost." exit 1 fi # ensure that any long lines with both 127.0.0.1 and the new hostname are there and they are uncommented if already there if ! sed -i -e "s/^\(#\)\(127.0.0.1.*${HOSTNAME}\)/\2/g" /etc/hosts > /dev/null then echo "Failure during the configuration of the localhost." exit 1 fi # Add the new hostname if ! echo "127.0.0.1 ${HOSTNAME}" >> /etc/hosts then echo "Failure during the configuration of the localhost hostname." exit 1 fi echo '' # Set reusable complex command into an array sedcmnd=() for var in "${REQUIREDVARS[@]}" do sedcmnd+=( '-e s/'"${var}"'=.*/'"${var}"'=$(echo $'"${var}"')/g' ) done printf ' %-45s' 'Configuring network' # Assemble complex command command=$(echo "sed -i ${sedcmnd[@]} /etc/sysconfig/network") # Edit network file if ! eval "${command}" then echo "Configuration of the interface failure." exit 1 fi echo '' printf ' %-45s' 'Configuring interface' # Assemble complex command command=$(echo "sed -i ${sedcmnd[@]} /etc/sysconfig/network-scripts/ifcfg-eth0") # Edit interface file if ! eval "${command}" then echo "Unable to continue due to a configuration of the interface failure." exit 1 fi echo '' printf ' %-45s' 'Configuring udev' if [ -f /etc/udev/rules.d/70-persistent-net.rules ] then if ! cat << EOF > /etc/udev/rules.d/70-persistent-net.rules # This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. EOF then echo "Failed to create a udev document." exit 1 fi fi echo '' printf ' %-45s' 'Configuring hostname' if ! hostname "${HOSTNAME}" &> /dev/null then echo "Failed to set the hostname." exit 1 fi echo '' printf ' %-45s' 'Restarting network' if grep "FAIL" then echo "Failure during network restart." exit 1 fi < <(/sbin/service network restart) echo '' printf ' %-45s' 'Pinging gateway' if ! grep "1 received" > /dev/null then echo "Failed to ping the gateway." exit 1 fi < <(ping -c 1 "${GATEWAY}") echo '' printf ' %-45s' 'Configuring ssh' # Remove old private SSH key if it exists if [ -f "/root/.ssh/id_rsa" ] then if ! rm -f "/root/.ssh/id_rsa" then echo "Failed to remove the old key." exit 1 fi fi # Remove old public SSH key if it exists if [ -f "/root/.ssh/id_rsa.pub" ] then if ! rm -f "/root/.ssh/id_rsa.pub" then echo "Failed to remove the old key." exit 1 fi fi # Remove old private SSH key if it exists if [ -f "/home/nwadmin/.ssh/id_rsa" ] then if ! rm -f /home/nwadmin/.ssh/id_rsa then echo "Failed to remove the old key." exit 1 fi fi # Remove old public SSH key if it exists if [ -f "/home/nwadmin/.ssh/id_rsa.pub" ] then if ! rm -f /home/nwadmin/.ssh/id_rsa.pub then echo "Failed to remove the old key." exit 1 fi fi # Generate SSH keys if ! ssh-keygen -f "/root/.ssh/id_rsa" -N "" > /dev/null then echo "Failed to generate new SSH keys." exit 1 fi echo '' # Setup complex ssh-keygen command for passing to the "su" utility command="ssh-keygen -f /home/nwadmin/.ssh/id_rsa -N \"\"" # Generate SSH keys if ! su - nwadmin -c "${command}" > /dev/null then echo "Failed to generate new SSH keys." exit 1 fi echo '' let time="${SECONDS} - ${time}" echo "Configuration completed in ${time} seconds." echo '' exit "${status}" * tunnel.sh #!/bin/bash VERSIONTEXT='$Revision: 3735 $' # Syntax if [ $# -lt 1 ] then echo 'tunnelssh.ksh ' VERSION=$(echo "${VERSIONTEXT}" | cut -f2 -d\ ) echo " version: ${VERSION}" exit 1 fi # Load the argument config="${1}" function getSshCommand { local return_code=0 # Ensure that configuration file is present if [ ! -f "${config}" ] then echo "Unable to locate config file: ${config}" return_code=1 # Load configuration file elif ! . "${config}" then echo "Encountered error when loading config file: ${config}" return_code=1 else # Ensure that configuration variables are defined if [ -z "${SSHHOST}" ]; then echo "Required config variable: SSHHOST is not defined!"; exit 1; fi if [ -z "${SSHPORT}" ]; then echo "Required config variable: SSHPORT is not defined!"; exit 1; fi if [ -z "${SSHUSER}" ]; then echo "Required config variable: SSHUSER is not defined!"; exit 1; fi if [ -z "${REMOTEPORT}" ]; then echo "Required config variable: REMOTEPORT is not defined!"; exit 1; fi if [ -z "${LOCALPORT}" ]; then echo "Required config variable: LOCALPORT is not defined!"; exit 1; fi if [ -z "${PINGHOST}" ]; then echo "Required config variable: PINGHOST is not defined!"; exit 1; fi if [ -z "${REMOTEHOST}" ]; then echo "Required config variable: REMOTEHOST is not defined!"; exit 1; fi if [ -z "${TUNNELLOCAL}" ]; then echo "Assuming local tunnel"; TUNNELLOCAL=1; fi if [ -z "${COMPRESSTUNNEL}" ]; then echo "Assuming no compression"; COMPRESSTUNNEL=0; fi if [ -z "${EXTERNALINTERFACE}" ]; then echo "Assuming local interface"; EXTERNALINTERFACE=0; fi # Initialize the command command="ssh -p ${SSHPORT}" # Add compression, if requested if [ "${COMPRESSTUNNEL}" -gt 0 ] then command="${command} -C" fi # Add external interface, if requested if [ "${EXTERNALINTERFACE}" -gt 0 ] then command="${command} -g" fi # Set the command string if [ "${TUNNELLOCAL}" -gt 0 ] then command="${command} -L ${LOCALPORT}:${REMOTEHOST}:${REMOTEPORT} ${SSHUSER}@${SSHHOST} ping -i 5 ${PINGHOST}" else command="${command} -R ${LOCALPORT}:${REMOTEHOST}:${REMOTEPORT} ${SSHUSER}@${SSHHOST} ping -i 5 ${PINGHOST}" fi fi return ${return_code} } # Load the configuration file if ! getSshCommand then echo "Encountered error when loading config file: ${config}" exit 1 fi # Run the service, if the background if requested if [ $# -eq 1 ] && [ -n "${BACKGROUND}" ] && [ "${BACKGROUND}" -gt 0 ] then # Backup last log file if [ -f "${LOGFILE}" ]; then rm -f "${LOGFILE}.old" && mv -i "${LOGFILE}" "${LOGFILE}.old"; fi # Ensure that the log file can be written if ! touch "${LOGFILE}" 2> /dev/null then echo "Unable to run tunnel service in background without being able to write to log: ${LOGFILE}" exit 1 fi # Allow the process to run even when exitting trap "" SIGHUP # Run the service in the background "${0}" "${config}" 'background' &> "${LOGFILE}" & childid=$! retcode=$? echo "Service running as pid: ${childid} log: ${LOGFILE} status: ${retcode}" echo "${childid}" > "${LOGFILE}.service.pid" exit "${retcode}" fi # Allow the process to run even when exitting trap "" SIGHUP # Initialize variables cycles=0 # Delete stop file, if present if [ -n "${STOPFILE}" ] && [ -f "${STOPFILE}" ] && ! rm -f "${STOPFILE}" then echo "Failed to remove stop file: ${STOPFILE}" exit 1 fi let cycles="${cycles} + 1" ${command} &> /dev/null & childid=$! printf '%20s Cycle #%4d: Connected with pid:%8d on port:%6d to %s:%d <= %s:%d' "$(date +'%Y-%m-%d %H:%M:%S')" "${cycles}" "${childid}" "${LOCALPORT}" "${SSHHOST}" "${SSHPORT}" "${REMOTEHOST}" "${REMOTEPORT}" echo '' echo "${childid}" > "${LOGFILE}.connection.pid" while [ 1 -gt 0 ] do wait "${childid}" retcode=$? printf '%20s Cycle #%4d: Tunnel terminated exit:%5d ' "$(date +'%Y-%m-%d %H:%M:%S')" "${cycles}" "${retcode}" # Stop if stop file found if [ -n "${STOPFILE}" ] && [ -f "${STOPFILE}" ] then printf ' Stop file found' echo '' break # Restart tunnel else # Wait beforing retrying, if defined if [ -n "${RETRYWAIT}" ] && [ "${RETRYWAIT}" -gt 0 ] then printf ' waiting %d seconds' "${RETRYWAIT}" sleep "${RETRYWAIT}" fi # Reload configuration file if ! getSshCommand then echo "Encountered error when reloading config file: ${config}" exit 1 fi echo '' let cycles="${cycles} + 1" ${command} &> "${LOGFILE}.connection.out" & childid=$! printf '%20s Cycle #%4d: Reconnected with pid:%6d on port:%6d to %s:%d <= %s:%d' "$(date +'%Y-%m-%d %H:%M:%S')" "${cycles}" "${childid}" "${LOCALPORT}" "${SSHHOST}" "${SSHPORT}" "${REMOTEHOST}" "${REMOTEPORT}" echo "${childid}" > "${LOGFILE}.connection.pid" echo '' fi done echo '' printf '%20s Stopped tunnel watchdog after %d cycles and %d seconds' "$(date +'%Y-%m-%d %H:%M:%S')" "${cycles}" "${SECONDS}" echo '' ** To test tunnelssh.ksh: Examples $ ./tunnelssh.ksh /root/tunnel/cfg/tunnelssh.cfg.vserver.40123 *** Example config file: /e/n/n/etc/emc/Alfresco/Dev/cfg/tunnelssh.cfg.example # This is a sample configuration file for the ssh tunnel script # $Revision: 3250 $ # The name of the server to which you would like to connect SSHHOST=remoteserver # The connection port for the ssh server SSHPORT=remoteserversshport # The name of the ssh user SSHUSER=remotesshuser # The port number of the application running on the remote server REMOTEPORT=remoteporttotunnel # The host on the remote network containing the port to forward REMOTEHOST=remotehosttotunnel # The port number on the local machine to maintain LOCALPORT=remotehosttunnelport # Specify if the port should appear on the local machine or remote server TUNNELLOCAL=1 # Specify if the tunnel should be compressed COMPRESSTUNNEL=0 # Specify if the tunnel should bind to external interface # This only works when tunnelling locally not remotely EXTERNALINTERFACE=0 # Location of the file that signal that the service should not be restarted STOPFILE=/var/lock/tunnelssh/stopfile.txt # The location of the log file to which the service should write # This only works, if in background LOGFILE=/var/log/tunnelssh/logfile.log # Run this service in the background BACKGROUND=1 # Location of place to ping PINGHOST=google.com # Amount of time to wait between retries # (in seconds) RETRYWAIT=3 ** tunnelssh.ksh Skip to end of metadata Added by last edited by Brian Powell on Dec 10, 2012 (view change) Go to start of metadata Description This is a script that is used to create tunnels that are used to safely connect systems that are not normally connected. It uses SSH to connect the two systems using the port forwarding mechanism. Requirements SSH needs to be installed on client The client's user public ssh key (~/.ssh/id_rsa.pub) must be added to the servers authorized file (~/.ssh/authorized_keys). The client's public ssh key must not have a password specified in order to have all password-less connections. Verification that password-less connections can be made to the server from the client. The key may have to accepted by making a preliminary connection since the script assumes the machine is a trusted one. Syntax tunnelssh.ksh Config File There are more options in the config file than the options listed below. Some of them do not need to be explained so I will ignore them. Config file option Description SSHHOST= Host that you want to connect to REMOTEPORT= This is the port of the app you are trying to connect to. So if you want to tunnel a web app it would be port 80 or 443 REMOTEHOST= This is the address of the server you are going to connect to. If your goal is the server listed in SSHHOST then this value should be localhost LOCALPORT= This is the port that the gateway server will be listing on. The traffic that hits this port will be forwarded down this tunnel COMPRESSTUNNEL=<1|0> Compress tunnel or not TUNNELLOCAL=<1|0> Determines the direction of the tunnel. Defaults to the 1 so it will forward to the remote server STOPFILE= Path and name of the file that signals that the service needs to be restarted PINGHOST= This is the command used on the far side of the tunnel to keep it up. Examples $ ./tunnelssh.ksh /root/tunnel/cfg/tunnelssh.cfg.vserver.40123 ** emacs /etc/sysconfig/iptables *** iptables: http://wiki.centos.org/HowTos/Network/IPTables CentOS Login FrontPage Help Tips and Tricks How To FAQs Events Contribute Newsletter Changelog HowTos/Network/IPTables HowTos Network IPTables IPTables Contents Introduction Getting Started Writing a Simple Rule Set Interfaces IP Addresses Ports and Protocols Putting It All Together Summary Links 1. Introduction CentOS has an extremely powerful firewall built in, commonly referred to as iptables, but more accurately is iptables/netfilter. Iptables is the userspace module, the bit that you, the user, interact with at the command line to enter firewall rules into predefined tables. Netfilter is a kernel module, built into the kernel, that actually does the filtering. There are many GUI front ends for iptables that allow users to add or define rules based on a point and click user interface, but these often lack the flexibility of using the command line interface and limit the users understanding of what's really happening. We're going to learn the command line interface of iptables. Before we can really get to grips with iptables, we need to have at least a basic understanding of the way it works. Iptables uses the concept of IP addresses, protocols (tcp, udp, icmp) and ports. We don't need to be experts in these to get started (as we can look up any of the information we need), but it helps to have a general understanding. Iptables places rules into predefined chains (INPUT, OUTPUT and FORWARD) that are checked against any network traffic (IP packets) relevant to those chains and a decision is made about what to do with each packet based upon the outcome of those rules, i.e. accepting or dropping the packet. These actions are referred to as targets, of which the two most common predefined targets are DROP to drop a packet or ACCEPT to accept a packet. Chains These are 3 predefined chains in the filter table to which we can add rules for processing IP packets passing through those chains. These chains are: INPUT - All packets destined for the host computer. OUTPUT - All packets originating from the host computer. FORWARD - All packets neither destined for nor originating from the host computer, but passing through (routed by) the host computer. This chain is used if you are using your computer as a router. For the most part, we are going to be dealing with the INPUT chain to filter packets entering our machine - that is, keeping the bad guys out. Rules are added in a list to each chain. A packet is checked against each rule in turn, starting at the top, and if it matches that rule, then an action is taken such as accepting (ACCEPT) or dropping (DROP) the packet. Once a rule has been matched and an action taken, then the packet is processed according to the outcome of that rule and isn't processed by further rules in the chain. If a packet passes down through all the rules in the chain and reaches the bottom without being matched against any rule, then the default action for that chain is taken. This is referred to as the default policy and may be set to either ACCEPT or DROP the packet. The concept of default policies within chains raises two fundamental possibilities that we must first consider before we decide how we are going to organize our firewall. 1. We can set a default policy to DROP all packets and then add rules to specifically allow (ACCEPT) packets that may be from trusted IP addresses, or for certain ports on which we have services running such as bittorrent, FTP server, Web Server, Samba file server etc. or alternatively, 2. We can set a default policy to ACCEPT all packets and then add rules to specifically block (DROP) packets that may be from specific nuisance IP addresses or ranges, or for certain ports on which we have private services or no services running. Generally, option 1 above is used for the INPUT chain where we want to control what is allowed to access our machine and option 2 would be used for the OUTPUT chain where we generally trust the traffic that is leaving (originating from) our machine. 2. Getting Started Working with iptables from the command line requires root privileges, so you will need to become root for most things we will be doing. [attachment:ArtWork/WikiDesign/icon-admonition-attention.png] IMPORTANT: We will be turning off iptables and resetting your firewall rules, so if you are reliant on your Linux firewall as your primary line of defense you should be aware of this. Iptables should be installed by default on all CentOS 5.x and 6.x installations. You can check to see if iptables is installed on your system by: $ rpm -q iptables iptables-1.4.7-5.1.el6_2.x86_64 And to see if iptables is actually running, we can check that the iptables modules are loaded and use the -L switch to inspect the currently loaded rules: # lsmod | grep ip_tables ip_tables 29288 1 iptable_filter x_tables 29192 6 ip6t_REJECT,ip6_tables,ipt_REJECT,xt_state,xt_tcpudp,ip_tables # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) target prot opt source destination Above we see the default set of rules on a CentOS 6 system. Note that SSH service is permitted by default. If iptables is not running, you can enable it by running: # system-config-securitylevel 3. Writing a Simple Rule Set [attachment:ArtWork/WikiDesign/icon-admonition-attention.png] IMPORTANT: At this point we are going to clear the default rule set. If you are connecting remotely to a server via SSH for this tutorial then there is a very real possibility that you could lock yourself out of your machine. You must set the default input policy to accept before flushing the current rules, and then add a rule at the start to explicitly allow yourself access to prevent against locking yourself out. We will use an example based approach to examine the various iptables commands. In this first example, we will create a very simple set of rules to set up a Stateful Packet Inspection (SPI) firewall that will allow all outgoing connections but block all unwanted incoming connections: # iptables -P INPUT ACCEPT # iptables -F # iptables -A INPUT -i lo -j ACCEPT # iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # iptables -A INPUT -p tcp --dport 22 -j ACCEPT # iptables -P INPUT DROP # iptables -P FORWARD DROP # iptables -P OUTPUT ACCEPT # iptables -L -v which should give the following output: Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- lo any anywhere anywhere 0 0 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED 0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ssh Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Now lets look at each of the 8 commands above in turn and understand exactly what we've just done: iptables -P INPUT ACCEPT If connecting remotely we must first temporarily set the default policy on the INPUT chain to ACCEPT otherwise once we flush the current rules we will be locked out of our server. iptables -F We used the -F switch to flush all existing rules so we start with a clean state from which to add new rules. iptables -A INPUT -i lo -j ACCEPT Now it's time to start adding some rules. We use the -A switch to append (or add) a rule to a specific chain, the INPUT chain in this instance. Then we use the -i switch (for interface) to specify packets matching or destined for the lo (localhost, 127.0.0.1) interface and finally -j (jump) to the target action for packets matching the rule - in this case ACCEPT. So this rule will allow all incoming packets destined for the localhost interface to be accepted. This is generally required as many software applications expect to be able to communicate with the localhost adaptor. iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT This is the rule that does most of the work, and again we are adding (-A) it to the INPUT chain. Here we're using the -m switch to load a module (state). The state module is able to examine the state of a packet and determine if it is NEW, ESTABLISHED or RELATED. NEW refers to incoming packets that are new incoming connections that weren't initiated by the host system. ESTABLISHED and RELATED refers to incoming packets that are part of an already established connection or related to and already established connection. iptables -A INPUT -p tcp --dport 22 -j ACCEPT Here we add a rule allowing SSH connections over tcp port 22. This is to prevent accidental lockouts when working on remote systems over an SSH connection. We will explain this rule in more detail later. iptables -P INPUT DROP The -P switch sets the default policy on the specified chain. So now we can set the default policy on the INPUT chain to DROP. This means that if an incoming packet does not match one of the following rules it will be dropped. If we were connecting remotely via SSH and had not added the rule above, we would have just locked ourself out of the system at this point. iptables -P FORWARD DROP Similarly, here we've set the default policy on the FORWARD chain to DROP as we're not using our computer as a router so there should not be any packets passing through our computer. iptables -P OUTPUT ACCEPT and finally, we've set the default policy on the OUTPUT chain to ACCEPT as we want to allow all outgoing traffic (as we trust our users). iptables -L -v Finally, we can list (-L) the rules we've just added to check they've been loaded correctly. Finally, the last thing we need to do is save our rules so that next time we reboot our computer our rules are automatically reloaded: # /sbin/service iptables save This executes the iptables init script, which runs /sbin/iptables-save and writes the current iptables configuration to /etc/sysconfig/iptables. Upon reboot, the iptables init script reapplies the rules saved in /etc/sysconfig/iptables by using the /sbin/iptables-restore command. Obviously typing all these commands at the shell can become tedious, so by far the easiest way to work with iptables is to create a simple script to do it all for you. The above commands may be entered into your favourite text editor and saved as myfirewall, for example: #!/bin/bash # # iptables example configuration script # # Flush all current rules from iptables # iptables -F # # Allow SSH connections on tcp port 22 # This is essential when working on remote servers via SSH to prevent locking yourself out of the system # iptables -A INPUT -p tcp --dport 22 -j ACCEPT # # Set default policies for INPUT, FORWARD and OUTPUT chains # iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT # # Set access for localhost # iptables -A INPUT -i lo -j ACCEPT # # Accept packets belonging to established and related connections # iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # # Save settings # /sbin/service iptables save # # List rules # iptables -L -v Note: We can also comment our script to remind us what were doing. now make the script executable: # chmod +x myfirewall We can now simply edit our script and run it from the shell with the following command: # ./myfirewall 4. Interfaces In our previous example, we saw how we could accept all packets incoming on a particular interface, in this case the localhost interface: iptables -A INPUT -i lo -j ACCEPT Suppose we have 2 separate interfaces, eth0 which is our internal LAN connection and ppp0 dialup modem (or maybe eth1 for a nic) which is our external internet connection. We may want to allow all incoming packets on our internal LAN but still filter incoming packets on our external internet connection. We could do this as follows: iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -i eth0 -j ACCEPT But be very careful - if we were to allow all packets for our external internet interface (for example, ppp0 dialup modem): iptables -A INPUT -i ppp0 -j ACCEPT we would have effectively just disabled our firewall! 5. IP Addresses Opening up a whole interface to incoming packets may not be restrictive enough and you may want more control as to what to allow and what to reject. Lets suppose we have a small network of computers that use the 192.168.0.x private subnet. We can open up our firewall to incoming packets from a single trusted IP address (for example, 192.168.0.4): # Accept packets from trusted IP addresses iptables -A INPUT -s 192.168.0.4 -j ACCEPT # change the IP address as appropriate Breaking this command down, we first append (-A) a rule to the INPUT chain for the source (-s) IP address 192.168.0.4 to ACCEPT all packets (also note how we can use the # symbol to add comments inline to document our script with anything after the # being ignored and treated as a comment). Obviously if we want to allow incoming packets from a range of IP addresses, we could simply add a rule for each trusted IP address and that would work fine. But if we have a lot of them, it may be easier to add a range of IP addresses in one go. To do this, we can use a netmask or standard slash notation to specify a range of IP address. For example, if we wanted to open our firewall to all incoming packets from the complete 192.168.0.x (where x=1 to 254) range, we could use either of the following methods: # Accept packets from trusted IP addresses iptables -A INPUT -s 192.168.0.0/24 -j ACCEPT # using standard slash notation iptables -A INPUT -s 192.168.0.0/255.255.255.0 -j ACCEPT # using a subnet mask Finally, as well as filtering against a single IP address, we can also match against the MAC address for the given device. To do this, we need to load a module (the mac module) that allows filtering against mac addresses. Earlier we saw another example of using modules to extend the functionality of iptables when we used the state module to match for ESTABLISHED and RELATED packets. Here we use the mac module to check the mac address of the source of the packet in addition to it's IP address: # Accept packets from trusted IP addresses iptables -A INPUT -s 192.168.0.4 -m mac --mac-source 00:50:8D:FD:E6:32 -j ACCEPT First we use -m mac to load the mac module and then we use --mac-source to specify the mac address of the source IP address (192.168.0.4). You will need to find out the mac address of each ethernet device you wish to filter against. Running ifconfig (or iwconfig for wireless devices) as root will provide you with the mac address. This may be useful for preventing spoofing of the source IP address as it will allow any packets that genuinely originate from 192.168.0.4 (having the mac address 00:50:8D:FD:E6:32) but will block any packets that are spoofed to have come from that address. Note, mac address filtering won't work across the internet but it certainly works fine on a LAN. 6. Ports and Protocols Above we have seen how we can add rules to our firewall to filter against packets matching a particular interface or a source IP address. This allows full access through our firewall to certain trusted sources (host PCs). Now we'll look at how we can filter against protocols and ports to further refine what incoming packets we allow and what we block. Before we can begin, we need to know what protocol and port number a given service uses. For a simple example, lets look at bittorrent. Bittorrent uses the tcp protocol on port 6881, so we would need to allow all tcp packets on destination port (the port on which they arrive at our machine) 6881: # Accept tcp packets on destination port 6881 (bittorrent) iptables -A INPUT -p tcp --dport 6881 -j ACCEPT Here we append (-A) a rule to the INPUT chain for packets matching the tcp protocol (-p tcp) and entering our machine on destination port 6881 (--dport 6881). Note: In order to use matches such as destination or source ports (--dport or --sport), you must first specify the protocol (tcp, udp, icmp, all). We can also extend the above to include a port range, for example, allowing all tcp packets on the range 6881 to 6890: # Accept tcp packets on destination ports 6881-6890 iptables -A INPUT -p tcp --dport 6881:6890 -j ACCEPT 7. Putting It All Together Now we've seen the basics, we can start combining these rules. A popular UNIX/Linux service is the secure shell (SSH) service allowing remote logins. By default SSH uses port 22 and again uses the tcp protocol. So if we want to allow remote logins, we would need to allow tcp connections on port 22: # Accept tcp packets on destination port 22 (SSH) iptables -A INPUT -p tcp --dport 22 -j ACCEPT This will open up port 22 (SSH) to all incoming tcp connections which poses a potential security threat as hackers could try brute force cracking on accounts with weak passwords. However, if we know the IP addresses of trusted remote machines that will be used to log on using SSH, we can limit access to only these source IP addresses. For example, if we just wanted to open up SSH access on our private lan (192.168.0.x), we can limit access to just this source IP address range: # Accept tcp packets on destination port 22 (SSH) from private LAN iptables -A INPUT -p tcp -s 192.168.0.0/24 --dport 22 -j ACCEPT Using source IP filtering allows us to securely open up SSH access on port 22 to only trusted IP addresses. For example, we could use this method to allow remote logins between work and home machines. To all other IP addresses, the port (and service) would appear closed as if the service were disabled so hackers using port scanning methods are likely to pass us by. 8. Summary We've barely scratched the surface of what can be achieved with iptables, but hopefully this HOWTO has provided a good grounding in the basics from which one may build more complicated rule sets. 9. Links http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-fw.html http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-iptables.html * ufw/firewalls/iptables/filtering: #*Security and Safety 1st!: "For Ubuntu, this is nice and easy, simply use the ufw package." #** Execute the following commands to configure it: #ufw limit ssh/tcp #ufw disable ssh #ufw disable http #ufw logging off #ufw deny 9999 #ufw reject out 9999 #ufw reject in 9999 #ufw deny 80 #ufw default deny #ufw allow in http #ufw allow out http #ufw allow in udp #ufw allow out udp #ufw reject in smtp #ufw reject out smtp ufw allow 8332 ufw allow 8333 ##ufw enable ufw disable #ufw status verbose #1.2: To display INPUT or OUTPUT chain rules, enter: # iptables -L INPUT -n -v # iptables -L OUTPUT -n -v --line-numbers #2: Stop / Start / Restart the Firewall If you are using CentOS / RHEL / Fedora Linux, enter: # service iptables stop # service iptables start # service iptables restart You can use the iptables command itself to stop the firewall and delete all rules: # iptables -F # iptables -X # iptables -t nat -F # iptables -t nat -X # iptables -t mangle -F # iptables -t mangle -X # iptables -P INPUT ACCEPT # iptables -P OUTPUT ACCEPT # iptables -P FORWARD ACCEPT Where, -F : Deleting (flushing) all the rules. -X : Delete chain. -t table_name : Select table (called nat or mangle) and delete/flush rules. -P : Set the default policy (such as DROP, REJECT, or ACCEPT). #3: Delete Firewall Rules To display line number along with other information for existing rules, enter: # iptables -L INPUT -n --line-numbers # iptables -L OUTPUT -n --line-numbers # iptables -L OUTPUT -n --line-numbers | less # iptables -L OUTPUT -n --line-numbers | grep 202.54.1.1 You will get the list of IP. Look at the number on the left, then use number to delete it. For example delete line number 4, enter: # iptables -D INPUT 4 OR find source IP 202.54.1.1 and delete from rule: # iptables -D INPUT -s 202.54.1.1 -j DROP You can use the iptables command itself to stop the firewall and delete all rules: # iptables -F # iptables -X # iptables -t nat -F # iptables -t nat -X # iptables -t mangle -F # iptables -t mangle -X # iptables -P INPUT ACCEPT # iptables -P OUTPUT ACCEPT # iptables -P FORWARD ACCEPT Where, -F : Deleting (flushing) all the rules. -X : Delete chain. -t table_name : Select table (called nat or mangle) and delete/flush rules. -P : Set the default policy (such as DROP, REJECT, or ACCEPT). #3: Delete Firewall Rules To display line number along with other information for existing rules, enter: # iptables -L INPUT -n --line-numbers # iptables -L OUTPUT -n --line-numbers # iptables -L OUTPUT -n --line-numbers | less # iptables -L OUTPUT -n --line-numbers | grep 202.54.1.1 You will get the list of IP. Look at the number on the left, then use number to delete it. For example delete line number 4, enter: # iptables -D INPUT 4 OR find source IP 202.54.1.1 and delete from rule: # iptables -D INPUT -s 202.54.1.1 -j DROP Where, -D : Delete one or more rules from the selected chain #4: Insert Firewall Rules To insert one or more rules in the selected chain as the given rule number use the following syntax. First find out line numbers, enter: # iptables -L INPUT -n --line-numbers Sample outputs: Chain INPUT (policy DROP) num target prot opt source destination 1 DROP all -- 202.54.1.1 0.0.0.0/0 2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state NEW,ESTABLISHED To insert rule between 1 and 2, enter: # iptables -I INPUT 2 -s 202.54.1.2 -j DROP To view updated rules, enter: # iptables -L INPUT -n --line-numbers Sample outputs: Chain INPUT (policy DROP) num target prot opt source destination 1 DROP all -- 202.54.1.1 0.0.0.0/0 2 DROP all -- 202.54.1.2 0.0.0.0/0 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state NEW,ESTABLISHED #5: Save Firewall Rules To save firewall rules under CentOS / RHEL / Fedora Linux, enter: # service iptables save In this example, drop an IP and save firewall rules: # iptables -A INPUT -s 202.5.4.1 -j DROP # service iptables save For all other distros use the iptables-save command: # iptables-save > /root/my.active.firewall.rules # cat /root/my.active.firewall.rules #6: Restore Firewall Rules To restore firewall rules form a file called /root/my.active.firewall.rules, enter: # iptables-restore < /root/my.active.firewall.rules To restore firewall rules under CentOS / RHEL / Fedora Linux, enter: # service iptables restart #7: Set the Default Firewall Policies To drop all traffic: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP # iptables -L -v -n #### you will not able to connect anywhere as all traffic is dropped ### # ping cyberciti.biz # wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.2-rc5.tar.bz2 #7.1: Only Block Incoming Traffic To drop all incoming / forwarded packets, but allow outgoing traffic, enter: # iptables -P INPUT DROP # iptables -P FORWARD DROP # iptables -P OUTPUT ACCEPT # iptables -A INPUT -m state --state NEW,ESTABLISHED -j ACCEPT # iptables -L -v -n ### *** now ping and wget should work *** ### # ping cyberciti.biz # wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.2-rc5.tar.bz2 #8:Drop Private Network Address On Public Interface IP spoofing is nothing but to stop the following IPv4 address ranges for private networks on your public interfaces. Packets with non-routable source addresses should be rejected using the following syntax: # iptables -A INPUT -i eth1 -s 192.168.0.0/24 -j DROP # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP #8.1: IPv4 Address Ranges For Private Networks (make sure you block them on public interface) 10.0.0.0/8 -j (A) 172.16.0.0/12 (B) 192.168.0.0/16 (C) 224.0.0.0/4 (MULTICAST D) 240.0.0.0/5 (E) 127.0.0.0/8 (LOOPBACK) #9: Blocking an IP Address (BLOCK IP) To block an attackers ip address called 1.2.3.4, enter: # iptables -A INPUT -s 1.2.3.4 -j DROP # iptables -A INPUT -s 192.168.0.0/24 -j DROP #10: Block Incoming Port Requests (BLOCK PORT) To block all service requests on port 80, enter: # iptables -A INPUT -p tcp --dport 80 -j DROP # iptables -A INPUT -i eth1 -p tcp --dport 80 -j DROP To block port 80 only for an ip address 1.2.3.4, enter: # iptables -A INPUT -p tcp -s 1.2.3.4 --dport 80 -j DROP # iptables -A INPUT -i eth1 -p tcp -s 192.168.1.0/24 --dport 80 -j DROP #11: Block Outgoing IP Address To block outgoing traffic to a particular host or domain such as cyberciti.biz, enter: # host -t a cyberciti.biz Sample outputs: cyberciti.biz has address 75.126.153.206 Note down its ip address and type the following to block all outgoing traffic to 75.126.153.206: # iptables -A OUTPUT -d 75.126.153.206 -j DROP You can use a subnet as follows: # iptables -A OUTPUT -d 192.168.1.0/24 -j DROP # iptables -A OUTPUT -o eth1 -d 192.168.1.0/24 -j DROP #11.1: Example - Block Facebook.com Domain First, find out all ip address of facebook.com, enter: # host -t a www.facebook.com Sample outputs: www.facebook.com has address 69.171.228.40 Find CIDR for 69.171.228.40, enter: # whois 69.171.228.40 | grep CIDR Sample outputs: CIDR: 69.171.224.0/19 To prevent outgoing access to www.facebook.com, enter: # iptables -A OUTPUT -p tcp -d 69.171.224.0/19 -j DROP You can also use domain name, enter: # iptables -A OUTPUT -p tcp -d www.facebook.com -j DROP # iptables -A OUTPUT -p tcp -d facebook.com -j DROP From the iptables man page: ... specifying any name to be resolved with a remote query such as DNS (e.g., facebook.com is a really bad idea), a network IP address (with /mask), or a plain IP address ... #12: Log and Drop Packets Type the following to log and block IP spoofing on public interface called eth1 # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j LOG --log-prefix "IP_SPOOF A: " # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP By default everything is logged to /var/log/messages file. # tail -f /var/log/messages # grep --color 'IP SPOOF' /var/log/messages #13: Log and Drop Packets with Limited Number of Log Entries The -m limit module can limit the number of log entries created per time. This is used to prevent flooding your log file. To log and drop spoofing per 5 minutes, in bursts of at most 7 entries . # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix "IP_SPOOF A: " # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP #14: Drop or Accept Traffic From Mac Address Use the following syntax: # iptables -A INPUT -m mac --mac-source 00:0F:EA:91:04:08 -j DROP ## *only accept traffic for TCP port # 8080 from mac 00:0F:EA:91:04:07 * ## # iptables -A INPUT -p tcp --destination-port 22 -m mac --mac-source 00:0F:EA:91:04:07 -j ACCEPT #15: Block or Allow ICMP Ping Request Type the following command to block ICMP ping requests: # iptables -A INPUT -p icmp --icmp-type echo-request -j DROP # iptables -A INPUT -i eth1 -p icmp --icmp-type echo-request -j DROP Ping responses can also be limited to certain networks or hosts: # iptables -A INPUT -s 192.168.1.0/24 -p icmp --icmp-type echo-request -j ACCEPT The following only accepts limited type of ICMP requests: ### ** assumed that default INPUT policy set to DROP ** ############# iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT ## ** all our server to respond to pings ** ## iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT #16: Open Range of Ports Use the following syntax to open a range of ports: iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 7000:7010 -j ACCEPT #17: Open Range of IP Addresses Use the following syntax to open a range of IP address: ## only accept connection to tcp port 80 (Apache) if ip is between 192.168.1.100 and 192.168.1.200 ## iptables -A INPUT -p tcp --destination-port 80 -m iprange --src-range 192.168.1.100-192.168.1.200 -j ACCEPT ## nat example ## iptables -t nat -A POSTROUTING -j SNAT --to-source 192.168.1.20-192.168.1.25 #18: Established Connections and Restaring The Firewall When you restart the iptables service it will drop established connections as it unload modules from the system under RHEL / Fedora / CentOS Linux. Edit, /etc/sysconfig/iptables-config and set IPTABLES_MODULES_UNLOAD as follows: IPTABLES_MODULES_UNLOAD = no #19: Help Iptables Flooding My Server Screen Use the crit log level to send messages to a log file instead of console: iptables -A INPUT -s 1.2.3.4 -p tcp --destination-port 80 -j LOG --log-level crit #20: Block or Open Common Ports The following shows syntax for opening and closing common TCP and UDP ports: Replace ACCEPT with DROP to block port: ## open port ssh tcp port 22 ## iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT ## open cups (printing service) udp/tcp port 631 for LAN users ## iptables -A INPUT -s 192.168.1.0/24 -p udp -m udp --dport 631 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 631 -j ACCEPT ## allow time sync via NTP for lan users (open udp port 123) ## iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 123 -j ACCEPT ## open tcp port 25 (smtp) for all ## iptables -A INPUT -m state --state NEW -p tcp --dport 25 -j ACCEPT # open dns server ports for all ## iptables -A INPUT -m state --state NEW -p udp --dport 53 -j ACCEPT iptables -A INPUT -m state --state NEW -p tcp --dport 53 -j ACCEPT ## open http/https (Apache) server port to all ## iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT iptables -A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT ## open tcp port 110 (pop3) for all ## iptables -A INPUT -m state --state NEW -p tcp --dport 110 -j ACCEPT ## open tcp port 143 (imap) for all ## iptables -A INPUT -m state --state NEW -p tcp --dport 143 -j ACCEPT ## open access to Samba file server for lan users only ## iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 137 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 138 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 139 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 445 -j ACCEPT ## open access to proxy server for lan users only ## iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 3128 -j ACCEPT ## open access to mysql server for lan users only ## iptables -I INPUT -p tcp --dport 3306 -j ACCEPT #21: Restrict the Number of Parallel Connections To a Server Per Client IP You can use connlimit module to put such restrictions. To allow 3 ssh connections per client host, enter: # iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 3 -j REJECT Set HTTP requests to 20: # iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 --connlimit-mask 24 -j DROP Where, --connlimit-above 3 : Match if the number of existing connections is above 3. --connlimit-mask 24 : Group hosts using the prefix length. For IPv4, this must be a number between (including) 0 and 32. #22: HowTO: Use iptables Like a Pro For more information about iptables, please see the manual page by typing man iptables from the command line: $ man iptables You can see the help using the following syntax too: # iptables -h To see help with specific commands and targets, enter: # iptables -j DROP -h #22.1: Testing Your Firewall Find out if ports are open or not, enter: # netstat -tulpn Find out if tcp port 80 open or not, enter: # netstat -tulpn | grep :80 If port 80 is not open, start the Apache, enter: # service httpd start Make sure iptables allowing access to the port 80: # iptables -L INPUT -v -n | grep 80 Otherwise open port 80 using the iptables for all users: # iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT # service iptables save Use the telnet command to see if firewall allows to connect to port 80: $ telnet www.cyberciti.biz 80 Sample outputs: Trying 75.126.153.206... Connected to www.cyberciti.biz. Escape character is '^]'. ^] telnet> quit Connection closed. You can use nmap to probe your own server using the following syntax: $ nmap -sS -p 80 www.cyberciti.biz Sample outputs: Starting Nmap 5.00 ( http://nmap.org ) at 2011-12-13 13:19 IST Interesting ports on www.cyberciti.biz (75.126.153.206): PORT STATE SERVICE 80/tcp open http Nmap done: 1 IP address (1 host up) scanned in 1.00 seconds I also recommend you install and use sniffer such as tcpdupm and ngrep to test your firewall settings. Conclusion: This post only list basic rules for new Linux users. You can create and build more complex rules. This requires good understanding of TCP/IP, Linux kernel tuning via sysctl.conf, and good knowledge of your own setup. Stay tuned for next topics: Stateful packet inspection. Using connection tracking helpers. Network address translation. Layer 2 filtering. Firewall testing tools. Dealing with VPNs, DNS, Web, Proxy, and other protocols. ** http://www.thegeekstuff.com/2011/03/iptables-inbound-and-outbound-rules/ Linux IPTables: Incoming and Outgoing Rule Examples (SSH and HTTP) by RAMESH NATARAJAN on MARCH 15, 2011 In our previous IPTables firewall series article, we reviewed how to add firewall rule using ैiptables -Aै. We also explained how to allow incoming SSH connection. On a high-level, it involves following 3 steps. Delete all existing rules: ैiptables -Fै Allow only incoming SSH: ैiptables -A INPUT -i eth0 -p tcp ैdport 22 -j ACCEPTै Drop all other incoming packets: ैiptables -A INPUT -j DROPै The above works. But it is not complete. One problem with the above steps is that it doesnैt restrict the outgoing packets. Default Chain Policy The default policy of a chain is ACCEPT. If you donैt what what a chain means, you better read our iptables introduction article. So, both the INPUT and OUTPUT chainैs default policy is ACCEPT. In the above 3 steps we dropped all incoming packets at the end (except incoming ssh). However, we didnैt restrict the outgoing traffic. As you notice below, it says ै(policy ACCEPT)ै next to all the three chain names (INPUT, OUTPUT, and FORWARD). This indicates that the default chain policy is ACCEPT. # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh DROP all -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination So, you have two options here. Option 1: Add drop rules At the end, add the following three drop rules that will drop all incoming, outgoing, and forward packets (except those that are defined above these three rules). If you do this, the default chain policy is still ACCEPT, which shouldnैt matter, as you are dropping all the packets at the end anyway. iptables -A INPUT -j DROP iptables -A OUTPUT -j DROP iptables -A FORWARD -j DROP Option 2: Change the default chain policy to DROP At the beginning, execute the following three commands that will change the chainैs default policy to DROP. iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP Now, if you add the allow ssh rule: ैiptables -A INPUT -i eth0 -p tcp ैdport 22 -j ACCEPTै, and do iptables -L, youैll notice that it says ै(policy DROP)ै next to all the three chains. # iptables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh DROP all -- anywhere anywhere Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination But there is a problem here. The allow ssh incoming connection rule will not work anymore, because all the outgoing packets are dropped. Allow Incoming Connections When the default policy is DROP for INPUT and OUTPUT chains, for every incoming firewall rule, you need to specify the following two rules. Request rule: This is the request that comes from the client to the server for the incoming connection. Response rule: This is for the response that goes out from the server to the client (for the corresponding incoming request). Example 1: Allow incoming SSH connection This is to allow SSH connection from outside to your server. i.e You can ssh to your server from outside. This involves two steps. First, we need to allow incoming new SSH connections. Once the incoming ssh connection is allowed, we also need to allow the response back for that incoming ssh connection. First, Allow incoming SSH connection request, as shown below. iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT In the above example: iptables -A INPUT: Append the new rule to the INPUT chain. For incoming connection request, this always has to be INPUT. -i eth0: This refers to the input interface. For incoming connections, this always has to be ै-iै. -p tcp: Indicates that this is for TCP protocol. ैdport 22: This refers to the destination port for the incoming connection. Port 22 is for ssh. -m state: This indicates that the ैstateै matching module is used. Weैll discuss more about ै-mै option (and all available matching modules for iptables) in future article. ैstate NEW, ESTABLISHED: Options for the ैstateै matching module. In this example, only NEW and ESTABLISHED states are allowed. The 1st time when a SSH connection request is initiated from the client to the server, NEW state is used. ESTABLISHED state is used for all further request from the client to the server. Next, Allow outgoing (ESTABLISHED state only) SSH connection response (for the corresponding incoming SSH connection request). iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT In the above example: iptables -A OUTPUT: Append the new rule to the OUTPUT chain. Since this is for the response rule (for the corresponding incoming request) that goes out from the server, this should be OUTPUT. -o eth0: This refers the output interface. For outgoing connections, this always has to be ै-oै. -p tcp: Indicates that this is for TCP protocol. ैsport 22: This refers to the source port for the outgoing connection. Port 22 is for ssh. Since the incoming request (from the previous rule) came to the ैdestinationै port, the outgoing response will go through the ैsourceै port. -m state: This indicates that the ैstateै matching module is used. ैstate ESTABLISHED: Since this is a response rule, we allow only ESTABLISHED connection (and not any NEW connection). Example 2: Allow incoming HTTP connection This is to allow HTTP connection from outside to your server. i.e You can view your website running on the server from outside. Just like the above SSH incoming rules, this also involves two steps. First, we need to allow incoming new HTTP connection. Once the incoming HTTP connection is allowed, we need to allow the response back for that incoming HTTP connection. First, Allow incoming HTTP connection request, as shown below. iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT Next, Allow outgoing (ESTABLISHED only) HTTP connection response (for the corrresponding incoming SSH connection request). iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT Note: In the above HTTP request and response rule, everything is same as the SSH example except the port number. Allow Outgoing Connections When the default policy is DROP for the INPUT and OUTPUT chains, for every outgoing firewall rule, you need to specify the following two rules. Request rule: This is the request that goes out from the server to outside for the outgoing connection. Response rule: This is for the response that comes back from the outside to the server (for the corresponding outgoing request). Example 3: Allow outgoing SSH connection This is to allow SSH connection from your server to the outside. i.e You can ssh to outside server from your server. This involves two steps. First, we need to allow outgoing new SSH connection. Once the outgoing ssh connection is allowed, we also need to allow the response back for that outgoing ssh connection. First, Allow outgoing SSH connection request, as shown below. iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT In the above example: iptables -A OUTPUT: Append the new rule to the OUTPUT chain. For outgoing connection request, this always has to be OUTPUT. -o eth0: This refers the output interface. For outgoing connections, this always has to be ै-oै. -p tcp: Indicates that this is for TCP protocol. ैdport 22: This refers to the destination port for the outgoing connection. -m state: This indicates that ैstateै matching module is used. ैstate NEW, ESTABLISHED: Options for the ैstateै matching module. In this example, only NEW and ESTABLISHED states are allowed. The 1st time when a SSH connection request is initiated from the server to the outside, NEW state is used. ESTABLISHED state is used for all further request from the server to the outside. Next, Allow outgoing (ESTABLISHED only) SSH connection response (for the corresponding incoming SSH connection request). iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT In the above example: iptables -A INPUT: Append the new rule to the INPUT chain. Since this is for the response rule (for the corresponding outgoing request) that comes from the outside to the server, this should be INPUT. -i eth0: This refers the input interface. For incoming connections, this always has to be ै-iै. -p tcp: Indicates that this is for TCP protocol. ैsport 22: This refers to the source port for the incoming connection. Since the outgoing request (from the previous rule) went to the ैdestinationै port, the incoming response will come from the ैsourceै port. -m state: This indicates that the ैstateै matching module is used. ैstate ESTABLISHED: Since this is a response rule, we allow only ESTABLISHED connection (and not any NEW connection). Putting it all together Create rules.sh shell script which does the following: Delete all existing rules Set default chain policies Allow inbound SSH Allow inbound HTTP Allow outbound SSH First, create the rules.sh $ vi rules.sh # 1. Delete all existing rules iptables -F # 2. Set default chain policies iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP # 3. Allow incoming SSH iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT # 4. Allow incoming HTTP iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT # 5. Allow outgoing SSH iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT Next, execute the rules.sh and view the rules. # chmod u+x rules.sh # ./rules.sh # iptables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:ssh state ESTABLISHED Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp spt:ssh state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:http state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW,ESTABLISHED Using this as a basis you should be able to write your own incoming and outgoing iptables firewall rules. There is lot more to cover in IPTables. Stay tuned! Previous articles in the iptables series: Linux Firewall Tutorial: IPTables Tables, Chains, Rules Fundamentals IPTables Flush: Delete / Remove All Rules On RedHat and CentOS Linux Linux IPTables: How to Add Firewall Rules (With Allow SSH Example) Share * magic numbers: Unix: Under the spell of magic numbers If you've ever wondered how Unix systems identify files, you might be surprised to learn that file names really aren't an important factor. Unix systems reach into files looking for special codes called "magic numbers" to figure out what your files really are. They also examine other file content to pick out additional details. By Sandra Henry-Stocker Add a comment February 24, 2013, 7:09 PM ै Image credit: iStockphoto Magic numbers play a very important role on Unix systems. They help the OS recognize details about files that aren't obvious even to Unix wizards. What are magic numbers? Magic numbers are values, not generally visible unless you dump file contents using a command like od that displays file contents in hex, that serve as signatures for file type identification. Some are fairly obvious once you see them -- like if you spot "\x89PNG" in a file dump. Others won't offer much of a clue. In general, they are special values set up at or near the beginning or nearby in files that allow command like file to distinguish files by their type so even if you call a jpg file my.image, the OS can still figure out what it is. How are they used? The tool for file identification is a command named "file". Use the file command to examine your oddly named my.image file and might just tell you something like this: $ file my.image my.image: JPEG image data, JFIF standard 1.01 The "JFIF" tag in this description stands for JPEG File Interchange Format. This output tells you that this complies. This tells you that the magic number that is associated with JPEG files is both stored in this file and stored in the right location to identify the file. The same value at some other location would have no effect and would likely be coincidental. Use file to examine a file that isn't a JPEG file, but has been assigned a .jpg file extension and the file command comes through and identifies this file as an executable. $ file bash.jpg binfile.jpg: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/ Linux 2.6.9, dynamically linked (uses shared libs), stripped If we follow up this inquiry by examing the beginning of the file with the od command, we can see what appears to be an identifier for ELF files strikingly present in the first four bytes. $ od -bc bash.jpg | head -4 0000000 177 105 114 106 001 001 001 000 000 000 000 000 000 000 000 000 177 E L F 001 001 001 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000020 002 000 003 000 001 000 000 000 340 307 005 010 064 000 000 000 002 \0 003 \0 001 \0 \0 \0 340 307 005 \b 4 \0 \0 \0 Do the same thing with out odd my.image file and we see the "JFIF" tag within the magic number fairly clearly. $ od -bc my.image | head -4 0000000 377 330 377 340 000 020 112 106 111 106 000 001 001 001 001 054 377 330 377 340 \0 020 J F I F \0 001 001 001 001 , 0000020 001 054 000 000 377 341 035 122 105 170 151 146 000 000 111 111 001 , \0 \0 377 341 035 R E x i f \0 \0 I I Most magic numbers aren't readable unless you use a tool such as od to examine the file's contents. The exception is the shebang line that we use in scripts to identify the shell to be used when they are run. This serves as a kind of magic number on its own and is used by the file command as such. For most files, lines in the /usr/share/file/magic file describe what the file command needs to look for. The line for a PNG file, for example, looks like this: 0 string \x89PNG PNG image data, This line tells us that there's no offset (the magic number appears at the beginning of the file), Looking at tux.png, an image of the beloved penguin, file tells us: $ file tux.png tux.png: PNG image data, 400 x 479, 8-bit/color RGBA, non-interlaced Now that's a lot more than just the magic number indicates. The file command, once determining that the file is a PNG file, can look at other content in the file to determine its size and color depth. $ od -bc tux.png | head -4 0000000 211 120 116 107 015 012 032 012 000 000 000 015 111 110 104 122 211 P N G \r \n 032 \n \0 \0 \0 \r I H D R 0000020 000 000 001 220 000 000 001 337 010 006 000 000 000 176 261 216 \0 \0 001 220 \0 \0 001 337 \b 006 \0 \0 \0 ~ 261 216 PNG files begin with this 8-byte signature which is very obvious in the output shown above. \211 P N G \r \n \032 \n Magic numbers help ensure that Unix systems have more to go on than file names when trying to identify file content. Examine the /usr/share/file/magic on your Linux system and you'll notice that there's a lot of information there about different types of files. * /etc/httpd/conf/httpd.conf * Microkernels require less code to be run in the innermost, most trusted mode than monolithic kernels. This has many aspects, such as: Microkernels allow non-fundamental features (such as drivers for hardware that is not connected or not in use) to be loaded and unloaded at will. This is mostly achievable on Linux, through modules. Microkernels are more robust: if a non-kernel component crashes, it won't take the whole system with it. A buggy filesystem or device driver can crash a Linux system. Linux doesn't have any way to mitigate these problems other than coding practices and testing. Microkernels have a smaller trusted computing base. So even a malicious device driver or filesystem cannot take control of the whole system (for example a driver of dubious origin for your latest USB gadget wouldn't be able to read your hard disk). A consequence of the previous point is that ordinary users can load their own components that would be kernel components in a monolithic kernel. Unix GUIs are provided via X window, which is userland code (except for (part of) the video device driver). Many modern unices allow ordinary users to load filesystem drivers through FUSE. Some of the Linux network packet filtering can be done in userland. However, device drivers, schedulers, memory managers, and most networking protocols are still kernel-only. A classic (if dated) read about Linux and microkernels is the Tanenbaum–Torvalds debate. Twenty years later, one could say that Linux is very very slowly moving towards a microkernel structure (loadable modules appeared early on, FUSE is more recent), but there is still a long way to go. Another thing that has changed is the increased relevance of virtualization on desktop and high-end embedded computers: for some purposes, the relevant distinction is not between the kernel and userland but between the hypervisor and the guest OSes. * iptables ruleset--great example: http://www.sns.ias.edu/~jns/files/iptables_ruleset #!/bin/bash ## Iptables example ruleset ## James Stephens (jns@ias.edu) ## http://www.sns.ias.edu/~jns/ ## ============================================================ # # Load appropriate modules. modprobe ip_tables modprobe ip_conntrack modprobe ip_conntrack_ftp # These lines are here in case rules are already in place and the script is ever rerun on the fly. # We want to remove all rules and pre-exisiting user defined chains and zero the counters # before we implement new rules. iptables -F iptables -X iptables -Z # Set up a default DROP policy for the built-in chains. # If we modify and re-run the script mid-session then (because we have a default DROP # policy), what happens is that there is a small time period when packets are denied until # the new rules are back in place. There is no period, however small, when packets we # don't want are allowed. iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP ## =========================================================== ## Some definitions: IFACE="eth0,ppp0 ...... as appropriate" IPADDR="your_ip_address_here" NAMESERVER_1="x.x.x.x" NAMESERVER_2="x.x.x.x" BROADCAST="x.x.x.255" LOOPBACK="127.0.0.0/8" CLASS_A="10.0.0.0/8" CLASS_B="172.16.0.0/12" CLASS_C="192.168.0.0/16" CLASS_D_MULTICAST="224.0.0.0/4" CLASS_E_RESERVED_NET="240.0.0.0/5" P_PORTS="0:1023" UP_PORTS="1024:65535" TR_SRC_PORTS="32769:65535" TR_DEST_PORTS="33434:33523" ## ============================================================ ## Kernel flags # To dynamically change kernel parameters and variables on the fly you need # CONFIG_SYSCTL defined in your kernel. I would advise the following: # Disable response to ping. /bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all # Disable response to broadcasts. # You don't want yourself becoming a Smurf amplifier. /bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts # Don't accept source routed packets. Attackers can use source routing to generate # traffic pretending to be from inside your network, but which is routed back along # the path from which it came, namely outside, so attackers can compromise your # network. Source routing is rarely used for legitimate purposes. /bin/echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route # Disable ICMP redirect acceptance. ICMP redirects can be used to alter your routing # tables, possibly to a bad end. /bin/echo "0" > /proc/sys/net/ipv4/conf/all/accept_redirects # Enable bad error message protection. /bin/echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses # Turn on reverse path filtering. This helps make sure that packets use # legitimate source addresses, by automatically rejecting incoming packets # if the routing table entry for their source address doesn't match the network # interface they're arriving on. This has security advantages because it prevents # so-called IP spoofing, however it can pose problems if you use asymmetric routing # (packets from you to a host take a different path than packets from that host to you) # or if you operate a non-routing host which has several IP addresses on different # interfaces. (Note - If you turn on IP forwarding, you will also get this). for interface in /proc/sys/net/ipv4/conf/*/rp_filter; do /bin/echo "1" > ${interface} done # Log spoofed packets, source routed packets, redirect packets. /bin/echo "1" > /proc/sys/net/ipv4/conf/all/log_martians # Make sure that IP forwarding is turned off. We only want this for a multi-homed host. /bin/echo "0" > /proc/sys/net/ipv4/ip_forward # Note: With connection tracking, all fragments are reassembled before being # passed to the packet-filtering code so there is no ip_always_defrag switch as there # was in the 2.2 kernel. ## ============================================================ # RULES ## LOOPBACK # Allow unlimited traffic on the loopback interface. iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT ## SYN-FLOODING PROTECTION # This rule maximises the rate of incoming connections. In order to do this we divert tcp # packets with the SYN bit set off to a user-defined chain. Up to limit-burst connections # can arrive in 1/limit seconds ..... in this case 4 connections in one second. After this, one # of the burst is regained every second and connections are allowed again. The default limit # is 3/hour. The default limit burst is 5. # iptables -N syn-flood iptables -A INPUT -i $IFACE -p tcp --syn -j syn-flood iptables -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN iptables -A syn-flood -j DROP ## Make sure NEW tcp connections are SYN packets iptables -A INPUT -i $IFACE -p tcp ! --syn -m state --state NEW -j DROP ## FRAGMENTS # I have to say that fragments scare me more than anything. # Sending lots of non-first fragments was what allowed Jolt2 to effectively "drown" # Firewall-1. Fragments can be overlapped, and the subsequent interpretation of such # fragments is very OS-dependent (see this paper for details). # I am not going to trust any fragments. # Log fragments just to see if we get any, and deny them too. iptables -A INPUT -i $IFACE -f -j LOG --log-prefix "IPTABLES FRAGMENTS: " iptables -A INPUT -i $IFACE -f -j DROP ## SPOOFING # Most of this anti-spoofing stuff is theoretically not really necessary with the flags we # have set in the kernel above ........... but you never know there isn't a bug somewhere in # your IP stack. # # Refuse spoofed packets pretending to be from your IP address. iptables -A INPUT -i $IFACE -s $IPADDR -j DROP # Refuse packets claiming to be from a Class A private network. iptables -A INPUT -i $IFACE -s $CLASS_A -j DROP # Refuse packets claiming to be from a Class B private network. iptables -A INPUT -i $IFACE -s $CLASS_B -j DROP # Refuse packets claiming to be from a Class C private network. iptables -A INPUT -i $IFACE -s $CLASS_C -j DROP # Refuse Class D multicast addresses. Multicast is illegal as a source address. iptables -A INPUT -i $IFACE -s $CLASS_D_MULTICAST -j DROP # Refuse Class E reserved IP addresses. iptables -A INPUT -i $IFACE -s $CLASS_E_RESERVED_NET -j DROP # Refuse packets claiming to be to the loopback interface. # Refusing packets claiming to be to the loopback interface protects against # source quench, whereby a machine can be told to slow itself down by an icmp source # quench to the loopback. iptables -A INPUT -i $IFACE -d $LOOPBACK -j DROP # Refuse broadcast address packets. iptables -A INPUT -i $IFACE -d $BROADCAST -j DROP ## DNS # NOTE: DNS uses tcp for zone transfers, for transfers greater than 512 bytes (possible, but unusual), and on certain # platforms like AIX (I am told), so you might have to add a copy of this rule for tcp if you need it # Allow UDP packets in for DNS client from nameservers. iptables -A INPUT -i $IFACE -p udp -s $NAMESERVER_1 --sport 53 -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -i $IFACE -p udp -s $NAMESERVER_2 --sport 53 -m state --state ESTABLISHED -j ACCEPT # Allow UDP packets to DNS servers from client. iptables -A OUTPUT -o $IFACE -p udp -d $NAMESERVER_1 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p udp -d $NAMESERVER_2 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT ## SSH # Allow ssh outbound. iptables -A INPUT -i $IFACE -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT ## WWW # Allow www outbound to 80. iptables -A INPUT -i $IFACE -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT # Allow www outbound to 443. iptables -A INPUT -i $IFACE -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT ## TELNET # Allow telnet outbound. iptables -A INPUT -i $IFACE -p tcp --sport 23 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 23 -m state --state NEW,ESTABLISHED -j ACCEPT ## FTP # Allow ftp outbound. iptables -A INPUT -i $IFACE -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT # Now for the connection tracking part of ftp. This is discussed more completely in my section # on connection tracking to be found here. # 1) Active ftp. # This involves a connection INbound from port 20 on the remote machine, to a local port # passed over the ftp channel via a PORT command. The ip_conntrack_ftp module recognizes # the connection as RELATED to the original outgoing connection to port 21 so we don't # need NEW as a state match. iptables -A INPUT -i $IFACE -p tcp --sport 20 -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 20 -m state --state ESTABLISHED -j ACCEPT # 2) Passive ftp. # This involves a connection outbound from a port >1023 on the local machine, to a port >1023 # on the remote machine previously passed over the ftp channel via a PORT command. The # ip_conntrack_ftp module recognizes the connection as RELATED to the original outgoing # connection to port 21 so we don't need NEW as a state match. iptables -A INPUT -i $IFACE -p tcp --sport $UP_PORTS --dport $UP_PORTS \ -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --sport $UP_PORTS --dport $UP_PORTS \ -m state --state ESTABLISHED,RELATED -j ACCEPT ## SMTP # Allow smtp outbound. iptables -A INPUT -i $IFACE -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o $IFACE -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT ## AUTH server # Reject ident probes with a tcp reset. # I need to do this for a broken mailhost that won't accept my mail if I just drop its ident probe. iptables -A INPUT -i $IFACE -p tcp --dport 113 -j REJECT --reject-with tcp-reset ## TRACEROUTE # Outgoing traceroute anywhere. # The reply to a traceroute is an icmp time-exceeded which is dealt with by the next rule. iptables -A OUTPUT -o $IFACE -p udp --sport $TR_SRC_PORTS --dport $TR_DEST_PORTS \ -m state --state NEW -j ACCEPT # ICMP # We accept icmp in if it is "related" to other connections (e.g a time exceeded (11) # from a traceroute) or it is part of an "established" connection (e.g. an echo reply (0) # from an echo-request (8)). iptables -A INPUT -i $IFACE -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT # We always allow icmp out. iptables -A OUTPUT -o $IFACE -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT ## LOGGING # You don't have to split up your logging like I do below, but I prefer to do it this way # because I can then grep for things in the logs more easily. One thing you probably want # to do is rate-limit the logging. I didn't do that here because it is probably best not too # when you first set things up ................. you actually really want to see everything going to # the logs to work out what isn't working and why. You cam implement logging with # "-m limit --limit 6/h --limit-burst 5" (or similar) before the -j LOG in each case. # # Any udp not already allowed is logged and then dropped. iptables -A INPUT -i $IFACE -p udp -j LOG --log-prefix "IPTABLES UDP-IN: " iptables -A INPUT -i $IFACE -p udp -j DROP iptables -A OUTPUT -o $IFACE -p udp -j LOG --log-prefix "IPTABLES UDP-OUT: " iptables -A OUTPUT -o $IFACE -p udp -j DROP # Any icmp not already allowed is logged and then dropped. iptables -A INPUT -i $IFACE -p icmp -j LOG --log-prefix "IPTABLES ICMP-IN: " iptables -A INPUT -i $IFACE -p icmp -j DROP iptables -A OUTPUT -o $IFACE -p icmp -j LOG --log-prefix "IPTABLES ICMP-OUT: " iptables -A OUTPUT -o $IFACE -p icmp -j DROP # Any tcp not already allowed is logged and then dropped. iptables -A INPUT -i $IFACE -p tcp -j LOG --log-prefix "IPTABLES TCP-IN: " iptables -A INPUT -i $IFACE -p tcp -j DROP iptables -A OUTPUT -o $IFACE -p tcp -j LOG --log-prefix "IPTABLES TCP-OUT: " iptables -A OUTPUT -o $IFACE -p tcp -j DROP # Anything else not already allowed is logged and then dropped. # It will be dropped by the default policy anyway ........ but let's be paranoid. iptables -A INPUT -i $IFACE -j LOG --log-prefix "IPTABLES PROTOCOL-X-IN: " iptables -A INPUT -i $IFACE -j DROP iptables -A OUTPUT -o $IFACE -j LOG --log-prefix "IPTABLES PROTOCOL-X-OUT: " iptables -A OUTPUT -o $IFACE -j DROP * ps is just like top but provides more information. Show Long Format Output # ps -Al To turn on extra full mode (it will show command line arguments passed to process): # ps -AlF To See Threads ( LWP and NLWP) # ps -AlFH To See Threads After Processes # ps -AlLm Print All Process On The Server # ps ax # ps axu Print A Process Tree # ps -ejH # ps axjf # pstree Print Security Information # ps -eo euser,ruser,suser,fuser,f,comm,label # ps axZ # ps -eM See Every Process Running As User Vivek # ps -U vivek -u vivek u Set Output In a User-Defined Format # ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm # ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm # ps -eopid,tt,user,fname,tmout,f,wchan Display Only The Process IDs of Lighttpd # ps -C lighttpd -o pid= OR # pgrep lighttpd OR # pgrep -u vivek php-cgi Display The Name of PID 55977 # ps -p 55977 -o comm= Find Out The Top 10 Memory Consuming Process # ps -auxf | sort -nr -k 4 | head -10 Find Out top 10 CPU Consuming Process # ps -auxf | sort -nr -k 3 | head -10 #6: free - Memory Usage The command free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. # free Sample Output: total used free shared buffers cached Mem: 12302896 9739664 2563232 0 523124 5154740 -/+ buffers/cache: 4061800 8241096 Swap: 1052248 0 1052248 => Related: : Linux Find Out Virtual Memory PAGESIZE Linux Limit CPU Usage Per Process How much RAM does my Ubuntu / Fedora Linux desktop PC have? #7: iostat - Average CPU Load, Disk Activity The command iostat report Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network filesystems (NFS). # iostat Sample Outputs: Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009 avg-cpu: %user %nice %system %iowait %steal %idle 3.50 0.09 0.51 0.03 0.00 95.86 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn sda 22.04 31.88 512.03 16193351 260102868 sda1 0.00 0.00 0.00 2166 180 sda2 22.04 31.87 512.03 16189010 260102688 sda3 0.00 0.00 0.00 1615 0 => Related: : Linux Track NFS Directory / Disk I/O Stats #8: sar - Collect and Report System Activity The sar command is used to collect, report, and save system activity information. To see network counter, enter: # sar -n DEV | more To display the network counters from the 24th: # sar -n DEV -f /var/log/sa/sa24 | more You can also display real time usage using sar: # sar 4 5 Sample Outputs: Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009 06:45:12 PM CPU %user %nice %system %iowait %steal %idle 06:45:16 PM all 2.00 0.00 0.22 0.00 0.00 97.78 06:45:20 PM all 2.07 0.00 0.38 0.03 0.00 97.52 06:45:24 PM all 0.94 0.00 0.28 0.00 0.00 98.78 06:45:28 PM all 1.56 0.00 0.22 0.00 0.00 98.22 06:45:32 PM all 3.53 0.00 0.25 0.03 0.00 96.19 Average: all 2.02 0.00 0.27 0.01 0.00 97.70 => Related: : How to collect Linux system utilization data into a file #9: mpstat - Multiprocessor Usage The mpstat command displays activities for each available processor, processor 0 being the first one. mpstat -P ALL to display average CPU utilization per processor: # mpstat -P ALL Sample Output: Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009 06:48:11 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s 06:48:11 PM all 3.50 0.09 0.34 0.03 0.01 0.17 0.00 95.86 1218.04 06:48:11 PM 0 3.44 0.08 0.31 0.02 0.00 0.12 0.00 96.04 1000.31 06:48:11 PM 1 3.10 0.08 0.32 0.09 0.02 0.11 0.00 96.28 34.93 06:48:11 PM 2 4.16 0.11 0.36 0.02 0.00 0.11 0.00 95.25 0.00 06:48:11 PM 3 3.77 0.11 0.38 0.03 0.01 0.24 0.00 95.46 44.80 06:48:11 PM 4 2.96 0.07 0.29 0.04 0.02 0.10 0.00 96.52 25.91 06:48:11 PM 5 3.26 0.08 0.28 0.03 0.01 0.10 0.00 96.23 14.98 06:48:11 PM 6 4.00 0.10 0.34 0.01 0.00 0.13 0.00 95.42 3.75 06:48:11 PM 7 3.30 0.11 0.39 0.03 0.01 0.46 0.00 95.69 76.89 => Related: : Linux display each multiple SMP CPU processors utilization individually. #10: pmap - Process Memory Usage The command pmap report memory map of a process. Use this command to find out causes of memory bottlenecks. # pmap -d PID To display process memory information for pid # 47394, enter: # pmap -d 47394 Sample Outputs: 47394: /usr/bin/php-cgi Address Kbytes Mode Offset Device Mapping 0000000000400000 2584 r-x-- 0000000000000000 008:00002 php-cgi 0000000000886000 140 rw--- 0000000000286000 008:00002 php-cgi 00000000008a9000 52 rw--- 00000000008a9000 000:00000 [ anon ] 0000000000aa8000 76 rw--- 00000000002a8000 008:00002 php-cgi 000000000f678000 1980 rw--- 000000000f678000 000:00000 [ anon ] 000000314a600000 112 r-x-- 0000000000000000 008:00002 ld-2.5.so 000000314a81b000 4 r---- 000000000001b000 008:00002 ld-2.5.so 000000314a81c000 4 rw--- 000000000001c000 008:00002 ld-2.5.so 000000314aa00000 1328 r-x-- 0000000000000000 008:00002 libc-2.5.so 000000314ab4c000 2048 ----- 000000000014c000 008:00002 libc-2.5.so ..... ...... .. 00002af8d48fd000 4 rw--- 0000000000006000 008:00002 xsl.so 00002af8d490c000 40 r-x-- 0000000000000000 008:00002 libnss_files-2.5.so 00002af8d4916000 2044 ----- 000000000000a000 008:00002 libnss_files-2.5.so 00002af8d4b15000 4 r---- 0000000000009000 008:00002 libnss_files-2.5.so 00002af8d4b16000 4 rw--- 000000000000a000 008:00002 libnss_files-2.5.so 00002af8d4b17000 768000 rw-s- 0000000000000000 000:00009 zero (deleted) 00007fffc95fe000 84 rw--- 00007ffffffea000 000:00000 [ stack ] ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ] mapped: 933712K writeable/private: 4304K shared: 768000K The last line is very important: mapped: 933712K total amount of memory mapped to files writeable/private: 4304K the amount of private address space shared: 768000K the amount of address space this process is sharing with others => Related: : Linux find the memory used by a program / process using pmap command #11 and #12: netstat and ss - Network Statistics The command netstat displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. ss command is used to dump socket statistics. It allows showing information similar to netstat. See the following resources about ss and netstat commands: ss: Display Linux TCP / UDP Network and Socket Information Get Detailed Information About Particular IP address Connections Using netstat Command #13: iptraf - Real-time Network Statistics The iptraf command is interactive colorful IP LAN monitor. It is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. It can provide the following info in easy to read format: Network traffic statistics by TCP connection IP traffic statistics by network interface Network traffic statistics by protocol Network traffic statistics by TCP/UDP port and by packet size Network traffic statistics by Layer2 address Fig.02: General interface statistics: IP traffic statistics by network interface Fig.03 Network traffic statistics by TCP connection #14: tcpdump - Detailed Network Traffic Analysis The tcpdump is simple command that dump traffic on a network. However, you need good understanding of TCP/IP protocol to utilize this tool. For.e.g to display traffic info about DNS, enter: # tcpdump -i eth1 'udp port 53' To display all IPv4 HTTP packets to and from port 80, i.e. print only packets that contain data, not, for example, SYN and FIN packets and ACK-only packets, enter: # tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' To display all FTP session to 202.54.1.5, enter: # tcpdump -i eth1 'dst 202.54.1.5 and (port 21 or 20' To display all HTTP session to 192.168.1.5: # tcpdump -ni eth0 'dst 192.168.1.5 and tcp and port http' Use wireshark to view detailed information about files, enter: # tcpdump -n -i eth1 -s 0 -w output.txt src or dst port 80 #15: strace - System Calls Trace system calls and signals. This is useful for debugging webserver and other server problems. See how to use to trace the process and see What it is doing. #16: /Proc file system - Various Kernel Statistics /proc file system provides detailed information about various hardware devices and other Linux kernel information. See Linux kernel /proc documentations for further details. Common /proc examples: # cat /proc/cpuinfo # cat /proc/meminfo # cat /proc/zoneinfo # cat /proc/mounts 17#: Nagios - Server And Network Monitoring Nagios is a popular open source computer system and network monitoring application software. You can easily monitor all your hosts, network equipment and services. It can send alert when things go wrong and again when they get better. FAN is "Fully Automated Nagios". FAN goals are to provide a Nagios installation including most tools provided by the Nagios Community. FAN provides a CDRom image in the standard ISO format, making it easy to easilly install a Nagios server. Added to this, a wide bunch of tools are including to the distribution, in order to improve the user experience around Nagios. 18#: Cacti - Web-based Monitoring Tool Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices. It can provide data about network, CPU, memory, logged in users, Apache, DNS servers and much more. See how to install and configure Cacti network graphing tool under CentOS / RHEL. vmstat (virtual memory statistics) is a computer system monitoring tool that collects and displays summary information about operating system memory, ... nmap - scan your server for open ports. lsof - list open files, network connections and much more. ntop web based tool - ntop is the best tool to see network usage in a way similar to what top command does for processes i.e. it is network traffic monitoring software. You can see network status, protocol wise distribution of traffic for UDP, TCP, DNS, HTTP and other protocols. Conky - Another good monitoring tool for the X Window System. It is highly configurable and is able to monitor many system variables including the status of the CPU, memory, swap space, disk storage, temperatures, processes, network interfaces, battery power, system messages, e-mail inboxes etc. GKrellM - It can be used to monitor the status of CPUs, main memory, hard disks, network interfaces, local and remote mailboxes, and many other things. vnstat - vnStat is a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s). htop - htop is an enhanced version of top, the interactive process viewer, which can display the list of processes in a tree form. mtr - mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool. * Memory Management in UNIX NOV 7 • ENGINEERING NOTES, NOTES • 346 VIEWS • 0 COMMENTS ** Unix related systems usually uses very sophisticated memory management algorithms to give an efficient use of memory resources. This creates questions “How much memory do we have?” and “How much memory is being used?” This question is answered in this post. Here we have tried to made available Some Questions and Answers on Memory Management in UNIX explaining *** Swapping and Paging, Kernel in Unix System, Fork and Expansion Swap so that students are able to understand the topic in a better way. It will also help for the exam and interviews preparations. UNIX Memory Management Questions and Answers 1.(a) What is the difference between Swapping and Paging? Unix Memory Management Answer: Swapping: Here the whole process is moved from the swap device to the main memory for execution. Process size should be less than or equal to the available main memory. It is easier to implement and overhead to the system. Swapping systems can not handle the memory more flexibly as the paging systems does. Paging: In this system only the required memory pages are moved to main memory from the swap device for execution. Here the size of Process does not matter. It gives the virtual memory concept. It also provides greater flexibility in mapping the virtual address space to the physical memory of the machine. It allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than of the available physical memory. Demand paging systems can handle the memory more flexibly. (b) What is major difference between the Historic Unix and the new BSD release of Unix System V in terms of Memory Management? Answer: Historic Unix uses Swapping system. Here the entire process from the swap device is transferred to the main memory, whereas the Unix System V uses Demand Paging – only the part of the process is moved to the main memory. Historic Unix usually uses one Swap Device and Unix System V allow multiple Swap Devices. (c) What is the main goal of the Memory Management? It always decides which process should reside in the main memory, It Manages the parts of the virtual address space of a process which is non-core resident, It Monitors the available main memory and periodically write the processes into the swap device for providing more processes fit in the main memory simultaneously. (d) What is a Map? Answer: A Map is an Array, which includes the addresses of the free space in the swap device which are allocatable resources, and the number of the resource units is available there. Address Units 1 10,000 This allows First-Fit allocation of contiguous blocks of a resource. Initially the Map contains one entry – address and the total number of resources.Kernel treats each unit of Map as a group of disk blocks. On the allocation and freeing of the resources Kernel updates the Map for accurate information. (e) What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices? Answer: Round Robin scheme is followed by kernel for choosing a swap device among the multiple swap devices in Unix System V. (f) What is a Region? Answer: A Region is a continuous area of a process’s address space . The kernel in a “Region Table” i.e local to the process maintains region. Regions are usually sharable among the process. (g) What are the events done by the Kernel after a process is being swapped out from the main memory? Answer: When Kernel swaps the process out of the primary memory, it performs the according the following : Reference Count of each region of the process is decrements by Kernel . If the it becomes zero, swaps the region out of the main memory, Kernel also allocates the space for the swapping process in the swap device, Kernel also locks the other swapping process while the current swapping operation is going on, In the region table the Kernel saves the swap address of the region. (h) Is the Process before and after the swap are the same? Give reason. Answer: Process before swapping is remains in the primary memory in its original form. The regions may not be occupied fully by the process, there also may be few empty slots in any of the regions & while swapping Kernel do not bother about the empty slots while swapping the process out. After swapping the process remains in the swap device. The regions swapped out must be present but only the occupied region slots but the empty slots that were present before assigning are not. While in swapping condition the process once into the main memory, the Kernel referring to the Process Memory Map, it usually assigns the main memory accordingly taking care of the empty slots in the regions. (i) What do you mean by u-area (user area) or u-block? Answer: u-area contains the private data that is manipulated by the Kernel only. This is local to the Process, that is each process is allocated a u-area. (j) What are the entities that are swapped out of the main memory while swapping the process out of the main memory? Answer: All memory space occupied by the process, process’s u-area, and Kernel stack are theoretically swapped out,.If the process’s u-area contains the Address Translation Tables for the process then Kernel implementations will not swap the u-area. 2. What is Fork swap? Answer: It is a system call which create a child process. When “fork()” system call is called by the parent process , the child process is created and if there is short of memory then the child process is sent to the read-to-run state in the swap device, and return to the user state without swapping the parent process. When the memory will be available the child process must be swapped into the main memory. 3. What is Expansion swap? Answer: At the time when any process requires more memory than it is currently allocated, the expansion swap is performed by Kernel . for doing this Kernel reserves enough space in the swap device. Then the address interpretation mapping is adjusted for the new virtual address space but the physical memory is not allocated. At the end Kernel swaps the process into the assigned space in the swap device.And later on when the Kernel swaps the process into the main memory this assigns memory according to new address translation mapping. 4. How the Swapper works? Answer: It is the only process that swaps the processes. The Swapper operates only in the Kernel mode and it usually not uses System calls instead it uses internal Kernel functions for swapping. It is the archetype for all kernel process. 5. What are the processes that are not bothered by the swapper? Give Reason. Zombie process which do not take any up physical memory. Processes locked in memories are updating the region of the process. Kernel rather than the ‘ready-to-run’ processes swaps only the sleeping processes , as they have the higher probability of being scheduled than the Sleeping processes. 6. What are the requirements for a swapper to work? Answer: The swapper works on the highest scheduling priority. Initially it will look for any sleeping process, if not found then it will look for the ready-to-run process for swapping. But the major requirement for the swapper to work the ready-to-run process must be core-resident for at least 2 seconds before swapping out. And for swapping in the process must have been resided in the swap device for at least 2 seconds. If the requirement is not fulfilled then the swapper will go into the wait state on that event and it is awaken once in a second by the Kernel. 7. What are the criteria for choosing a process for swapping into memory from the swap device? Answer: The time of resident the processes in the swap device, the processes priority & the amount of time the processes had been swapped out. 8. What are the criteria for choosing a process for swapping out of the memory to the swap device? The process’s memory resident time, The Priority of the process and Nice value. 9. What do you mean by nice value? Answer: It is the value that controls the priority of the process. This value that is returned by the nice()is called by system . The equation for using nice value is: Priority = (base- priority) + (“recent CPU usage”/constant) + (nice value) Only the nice value can supply by the administrator. 10. What are states that the page can be in, after causing a page fault? Only on swap device not in memory. In the main memory on the free page list, In an executable file. * 69.DNS INTERVIEW QUESTIONS & ANSWERS >What is the main purpose of a DNS server? DNS servers are used to resolve FQDN hostnames into IP addresses and vice versa. >What is the port no of dns ? 53. >What is a Forward Lookup? Resolving Host Names to IP Addresses. >What is Reverse Lookup? It?s a file contains host names to IP mapping information. >What is a Resource Record? It is a record provides the information about the resources available in the N/W infrastructure. >What are the diff. DNS Roles? Standard Primary, Standard Secondary, & AD Integrated. >What is a Zone? Zone is a sub tree of DNS database. >Secure services in your network require reverse name resolution to make it more difficult to launch successful attacks against the services. To set this up, you configure a reverse lookup zone and proceed to add records. Which record types do you need to create? PTR Records >SOA records must be included in every zone. What are they used for ? SOA records contain a TTL value, used by default in all resource records in the zone. SOA records contain the e-mail address of the person who is responsible for maintaining the zone. SOA records contain the current serial number of the zone, which is used in zone transfers. >By default, if the name is not found in the cache or local hosts file, what is the first step the client takes to resolve the FQDN name into an IP address ? Performs a recursive search through the primary DNS server based on the network interface configuration . > What is primary, Secondary, stub & AD Integrated Zone? Primary Zone: - zone which is saved as normal text file with filename (.dns) in DBS folder. Maintains a read, write copy of zone database. Secondary Zone: - maintains a read only copy of zone database on another DNS server. Provides fault tolerance and load balancing by acting as backup server to primary server. Stub zone: - contains a copy of name server and SOA records used for reducing the DNS search orders. Provides fault tolerance and load balancing. > How do you manually create SRV records in DNS? This is on windows server go to run ---> dnsmgmt.msc rightclick on the zone you want to add srv record to and choose "other new record" and choose service location(srv). > What is the main purpose of SRV records ? SRV records are used in locating hosts that provide certain network services. > Before installing your first domain controller in the network, you installed a DNS server and created a zone, naming it as you would name your AD domain. However, after the installation of the domain controller, you are unable to locate infrastructure SRV records anywhere in the zone. What is the most likely cause of this failure ? The zone you created was not configured to allow dynamic updates. The local interface on the DNS server was not configured to allow dynamic updates. > Which of the following conditions must be satisfied to configure dynamic DNS updates for legacy clients ? The zone to be used for dynamic updates must be configured to allow dynamic updates. The DHCP server must support, and be configured to allow, dynamic updates for legacy clients. > At some point during the name resolution process, the requesting party received authoritative reply. Which further actions are likely to be taken after this reply ? After receiving the authoritative reply, the resolution process is effectively over. > Name 3 benefits of using AD-integrated zones. Active Directory integrated DNS enables Active Directory storage and replication of DNS zone databases. Windows 2000 DNS server, the DNS server that is included with Windows 2000 Server, accommodates storing zone data in Active Directory. When you configure a computer as a DNS server, zones are usually stored as text files on name servers that is, all of the zones required by DNS are stored in a text file on the server computer. These text files must be synchronized among DNS name servers by using a system that requires a separate replication topology and schedule called a zone transfer However, if you use Active Directory integrated DNS when you configure a domain controller as a DNS name server, zone data is stored as an Active Directory object and is replicated as part of domain replication. > Your company uses ten domain controllers, three of which are also used as DNS servers. You have one companywide AD-integrated zone, which contains several thousand resource records. This zone also allows dynamic updates, and it is critical to keep this zone up-to-date. Replication between domain controllers takes up a significant amount of bandwidth. You are looking to cut bandwidth usage for the purpose of replication. What should you do? Change the replication scope to all DNS servers in the domain. >You are administering a network connected to the Internet. Your users complain that everything is slow. Preliminary research of the problem indicates that it takes a considerable amount of time to resolve names of resources on the Internet. What is the most likely reason for this? DNS servers are not caching replies.. Local client computers are not caching replies… The cache.dns file may have been corrupted on the server. >What are the benefits of using Windows 2003 DNS when using AD-integrated zones? If your DNS topology includes Active Directory, use Active Directory integrated zones. Active Directory integrated zones enable you to store zone data in the Active Directory database.Zone information about any primary DNS server within an Active Directory integrated zone is always replicated. Because DNS replication is single-master, a primary DNS server in a standard primary DNS zone can be a single point of failure. In an Active Directory integrated zone, a primary DNS server cannot be a single point of failure because Active Directory uses multimaster replication. Updates that are made to any domain controller are replicated to all domain controllers and the zone information about any primary DNS server within an Active Directory integrated zone is always replicated. Active Directory integrated zones: Enable you to secure zones by using secure dynamic update. Provide increased fault tolerance. Every Active Directory integrated zone can be replicated to all domain controllers within the Active Directory domain or forest. All DNS servers running on these domain controllers can act as primary servers for the zone and accept dynamic updates. Enable replication that propagates changed data only, compresses replicated data, and reduces network traffic. If you have an Active Directory infrastructure, you can only use Active Directory integrated zones on Active Directory domain controllers.If you are using Active Directory integrated zones, you must decide whether or not to store Active Directory integrated zones in the application directory partition. You can combine Active Directory integrated zones and file-based zones in the same design. For example, if the DNS server that is authoritative for the private root zone is running on an operating system other than Windows Server 2003 or Windows 2000, it cannot act as an Active Directory domain controller. Therefore, you must use file-based zones on that server. However, you can delegate this zone to any domain controller running either Windows Server 2003 or Windows 2000. >You installed a new AD domain and the new (and first) DC has not registered its SRV records in DNS. Name a few possible causes. The machine cannot be configured with DNS client her own . The DNS service cannot be run. >What are the benefits and scenarios of using Stub zones? Understanding stub zones A stub zone is a copy of a zone that contains only those resource records necessary to identify the authoritative Domain Name System (DNS) servers for that zone. A stub zone is used to resolve names between separate DNS namespaces. This type of resolution may be necessary when a corporate merger requires that the DNS servers for two separate DNS namespaces resolve names for clients in both namespaces. A stub zone consists of: ? The start of authority (SOA) resource record, name server (NS) resource records, and the glue A resource records for the delegated zone. The IP address of one or more master servers that can be used to update the stub zone. The master servers for a stub zone are one or more DNS servers authoritative for the child zone, usually the DNS server hosting the primary zone for the delegated domain name. Use stub zones to: ? Keep delegated zone information current. By updating a stub zone for one of its child zones regularly, the DNS server hosting both the parent zone and the stub zone will maintain a current list of authoritative DNS servers for the child zone. ? Improve name resolution. Stub zones enable a DNS server to perform recursion using the stub zone's list of name servers without needing to query the Internet or internal root server for the DNS namespace. ? Simplify DNS administration. By using stub zones throughout your DNS infrastructure, you can distribute a list of the authoritative DNS servers for a zone without using secondary zones. However, stub zones do not serve the same purpose as secondary zones and are not an alternative when considering redundancy and load sharing. There are two lists of DNS servers involved in the loading and maintenance of a stub zone: ? The list of master servers from which the DNS server loads and updates a stub zone. A master server may be a primary or secondary DNS server for the zone. In both cases, it will have a complete list of the DNS servers for the zone. ? The list of the authoritative DNS servers for a zone. This list is contained in the stub zone using name server (NS) resource records. When a DNS server loads a stub zone, such as widgets.example.com, it queries the master servers, which can be in different locations, for the necessary resource records of the authoritative servers for the zone widgets.example.com. The list of master servers may contain a single server or multiple servers and can be changed anytime. >What are the benefits and scenarios of using Conditional Forwarding? Rather than having a DNS server forward all queries it cannot resolve to forwarders, the DNS server can forward queries for different domain names to different DNS servers according to the specific domain names that are contained in the queries. Forwarding according to these domain-name conditions improves conventional forwarding by adding a second condition to the forwarding process. A conditional forwarder setting consists of a domain name and the IP address of one or more DNS servers. To configure a DNS server for conditional forwarding, a list of domain names is set up on the Windows Server 2003-based DNS server along with the DNS server IP address. When a DNS client or server performs a query operation against a Windows Server 2003- based DNS server that is configured for forwarding, the DNS server looks to see if the query can be resolved by using its own zone data or the zone data that is stored in its cache, and then, if the DNS server is configured to forward for the domain name that is designated in the query (a match), the query is forwarded to the IP address of a DNS Server that is associated with the domain name. If the DNS server has no domain name listed for the name that is designated in the query, it attempts to resolve the query by using standard recursion. >What is the 224.0.1.24 address used for? WINS server group address. Used to support auto discovery and dynamic configuration of replication for WINS servers. For more information, see WINS replication overview WINS server group address. Used to support auto discovery and dynamic configuration of replication for WINS servers. > Describe the importance of DNS to AD ? When Microsoft began development on Active Directory, full compatibility with the domain name system (DNS) was a critical priority. Active Directory was built from the ground up not just to be fully compatible with DNS but to be so integrated with it that one cannot exist without the other. Microsoft's direction in this case did not just happen by chance, but because of the central role that DNS plays in Internet name resolution and Microsoft's desire to make its product lines embrace the Internet. While fully conforming to the standards established for DNS, Active Directory can expand upon the standard feature set of DNS and offer some new capabilities such as AD-Integrated DNS, which greatly eases the administration required for DNS environments. In addition, Active Directory can easily adapt to exist in a foreign DNS environment, such as Unix BIND, as long as the BIND version is 8.2.x or higher. When Microsoft began development on Active Directory, full compatibility with the domain name system (DNS) was a critical priority. Active Directory was built from the ground up not just to be fully compatible with DNS but to be so integrated with it that one cannot exist without the other. Microsoft's direction in this case did not just happen by chance, but because of the central role that DNS plays in Internet name resolution and Microsoft's desire to make its product lines embrace the Internet. > What is the "in-addr.arpa" zone used for? In a Domain Name System (DNS) environment, it is common for a user or an application to request a Reverse Lookup of a host name, given the IP address. This article explains this process. The following is quoted from RFC 1035: "The Internet uses a special domain to support gateway location and Internet address to host mapping. Other classes may employ a similar strategy in other domains. The intent of this domain is to provide a guaranteed method to perform host address to host name mapping, and to facilitate queries to locate all gateways on a particular network on the Internet. "The domain begins at IN-ADDR.ARPA and has a substructure which follows the Internet addressing structure. "Domain names in the IN-ADDR.ARPA domain are defined to have up to four labels in addition to the IN-ADDR.ARPA suffix. Each label represents one octet of an Internet address, and is expressed as a character string for a decimal value in the range 0-255 (with leading zeros omitted except in the case of a zero octet which is represented by a single zero). "Host addresses are represented by domain names that have all four labels specified." Reverse Lookup files use the structure specified in RFC 1035. For example, if you have a network which is 150.10.0.0, then the Reverse Lookup file for this network would be 10.150.IN-ADDR.ARPA. Any hosts with IP addresses in the 150.10.0.0 network will have a PTR (or 'Pointer') entry in 10.150.IN- ADDR.ARPA referencing the host name for that IP address. A single IN- ADDR.ARPA file may contain entries for hosts in many domains. Consider the following scenario. There is a Reverse Lookup file 10.150.IN-ADDR.ARPA with the following contents: Exp : 1.20 IN PTR WS1.ACME.COM. > What are the requirements from DNS to support AD? When you install Active Directory on a member server, the member server is promoted to a domain controller. Active Directory uses DNS as the location mechanism for domain controllers, enabling computers on the network to obtain IP addresses of domain controllers. During the installation of Active Directory, the service (SRV) and address (A) resource records are dynamically registered in DNS, which are necessary for the successful functionality of the domain controller locator (Locator) mechanism. To find domain controllers in a domain or forest, a client queries DNS for the SRV and A DNS resource records of the domain controller, which provide the client with the names and IP addresses of the domain controllers. In this context, the SRV and A resource records are referred to as Locator DNS resource records. When adding a domain controller to a forest, you are updating a DNS zone hosted on a DNS server with the Locator DNS resource records and identifying the domain controller. For this reason, the DNS zone must allow dynamic updates (RFC 2136) and the DNS server hosting that zone must support the SRV resource records (RFC 2782) to advertise the Active Directory directory service. For more information about RFCs, see DNS RFCs. If the DNS server hosting the authoritative DNS zone is not a server running Windows 2000 or Windows Server 2003, contact your DNS administrator to determine if the DNS server supports the required standards. If the server does not support the required standards, or the authoritative DNS zone cannot be configured to allow dynamic updates, then modification is required to your existing DNS infrastructure. For more information, see Checklist: Verifying DNS before installing Active Directory and Using the Active Directory Installation Wizard. Important The DNS server used to support Active Directory must support SRV resource records for the Locator mechanism to function. For more information, see Managing resource records. It is recommended that the DNS infrastructure allows dynamic updates of Locator DNS resource records (SRV and A) before installing Active Directory, but your DNS administrator may add these resource records manually after installation. After installing Active Directory, these records can be found on the domain controller in the following location: systemroot\System32\Config\Netlogon.dns . > What does a zone consist of & why do we require a zone? Zone consists of resource records and we require zone for representing sites. > What is Caching Only Server? When we install 2000 & 2003 server it is configured as caching only server where it maintains the frequently accessed sites information and again when we access the same site for next time it is obtain from cached information instead of going to the actual site. > What is forwarder? When one DNS server can?t receive the query it can be forwarded to another DNS once configured as forwarder. > What is secondary DNS Server? It is backup for primary DNS where it maintains a read only copy of DNS database. > How to enable Dynamic updates in DNS? Start>Program>Admin tools> DNS >Zone properties. > What are the properties of DNS server? INTERFACES, FORWARDERS, ADVANCED, ROUTINGS, SECURITY, MONITORING, LOGGING, DEBUG LOGGING. > Properties of a Zone ? General, SOA, NAMESERVER, WINS, Security, and ZONE Transfer. > What is scavenging? Finding and deleting unwanted records. > What are SRV records? SRV are the service records, there are 6 service records. They are useful for locating the services. > What are the types of SRV records? MSDCS:Contains DCs information. TCP:Contains Global Catalog, Kerberos & LDAP information. UDP:Contains Sites information. Sites:Contains Sites information. Domain DNS Zone:Conations domain?s DNS specific information. Forest DNS zone:Contains Forest?s Specific Information. > Where does a Host File Reside? c:\windows\system32\drivers\etc. > What is SOA? Start of Authority: useful when a zone starts. Provides the zone startup information. > What is a query? A request made by the DNS client to provide the name server information. > What are the diff. types of Queries? Recursion, iteration. > Tools for troubleshooting DNS? DNS Console, NSLOOKUP, DNSCMD, IPCONFIG, Logs. > What is WINS server? where we use WINS server? difference between DNS and WINS? WINS is windows internet name service used to resolve the NetBIOS(computer name)name to IP address.This is proprietary for Windows.You can use in LAN.DNS is a Domain Naming System, which resolves Host names to IP addresses. It uses fully qualified domain names. DNS is an Internet standard used to resolve host names. > What is new in Windows Server 2003 regarding the DNS management? When DC promotion occurs with an existing forest, the Active Directory Installation Wizard contacts an existing DC to update the directory and replicate from the DC the required portions of the directory. If the wizard fails to locate a DC, it performs debugging and reports what caused the failure and how to fix the problem. In order to be located on a network, every DC must register in DNS DC locator DNS records. The Active Directory Installation Wizard verifies a proper configuration of the DNS infrastructure. All DNS configuration debugging and reporting activity is done with the Active Directory Installation Wizard. > SOA records must be included in every zone. What are they used for? SOA records contain a TTL value, used by default in all resource records in the zone. SOA records contain the e-mail address of the person who is responsible for maintaining the zone. SOA records contain the current serial number of the zone, which is used in zone transfers. By default, if the name is not found in the cache or local hosts file, what is the first step the client takes to resolve the FQDN name into an IP address? Performs a recursive search through the primary DNS server based on the network interface configuration. > How do I clear the DNS cache on the DNS server? Go to cmd prompt and type ipconfig /flushdns . > What is the main purpose of SRV records? SRV records are used in locating hosts that provide certain network services. > Before installing your first domain controller in the network, you installed a DNS server and created a zone, naming it as you would name your AD domain. However, after the installation of the domain controller, you are unable to locate infrastructure SRV records anywhere in the zone. What is the most likely cause of this failure? The zone you created was not configured to allow dynamic updates. The local interface on the DNS server was not configured to allow dynamic updates. > What is the "." zone in my forward lookup zone? This setting designates the Windows 2000 or Windows Server 2003 DNS server to be a root hint server and is usually deleted. If you do not delete this setting, you may not be able to perform external name resolution to the root hint servers on the Internet. > Do I need to configure forwarders in DNS? No. By default, Windows 2000 DNS uses the root hint servers on the Internet; however, you can configure forwarders to send DNS queries directly to your ISP's DNS server or other DNS servers. Most of the time, when you configure forwarders, DNS performance and efficiency increases, but this configuration can also introduce a point of failure if the forwarding DNS server is experiencing problems. The root hint server can provide a level of redundancy in exchange for slightly increased DNS traffic on your Internet connection. Windows Server 2003 DNS will query root hints servers if it cannot query the forwarders. > Should I point the other Windows 2000-based and Windows Server 2003-based computers on my LAN to my ISP's DNS servers? No. If a Windows 2000-based or Windows Server 2003-based server or workstation does not find the domain controller in DNS, you may experience issues joining the domain or logging on to the domain. A Windows 2000-based or Windows Server 2003-based computer's preferred DNS setting should point to the Windows 2000 or Windows Server 2003 domain controller running DNS. If you are using DHCP, make sure that you view scope option #15 for the correct DNS server settings for your LAN. > Do I need to point computers that are running Windows NT 4.0 or Microsoft Windows 95, Microsoft Windows 98, or Microsoft Windows 98 Second Edition to the Windows 2000 or Windows Server 2003 DNS server? Legacy operating systems continue to use NetBIOS for name resolution to find a domain controller; however it is recommended that you point all computers to the Windows 2000 or Windows Server 2003 DNS server for name resolution. > What if my Windows 2000 or Windows Server 2003 DNS server is behind a proxy server or firewall? If you are able to query the ISP's DNS servers from behind the proxy server or firewall, Windows 2000 and Windows Server 2003 DNS server is able to query the root hint servers. UDP and TCP Port 53 should be open on the proxy server or firewall. > What should I do if the domain controller points to itself for DNS, but the SRV records still do not appear in the zone? Check for a disjointed namespace, and then run Netdiag.exe /fix. You must install Support Tools from the Windows 2000 Server or Windows Server 2003 CD-ROM to run Netdiag.exe. > How do I set up DNS for a child domain? To set up DNS for a child domain, create a delegation record on the parent DNS server for the child DNS server. Create a secondary zone on the child DNS server that transfers the parent zone from the parent DNS server. Note Windows Server 2003 has additional types of zones, such as Stub Zones and forest-level integrated Active Directory zones, that may be a better fit for your environment. Set the child domain controller to point to itself first. As soon as an additional domain controller is available, set the child domain controller to point to this domain controller in the child domain as its secondary. * elisp fun (defun put-the-date () (interactive) (insert (shell-command-to-string "date"))) (global-set-key (kbd "C-c C-d") 'put-the-date ) [[elisp:(put-the-date)]] (message (exec-to-string "pwd")) [[shell:parallel --gnu ::: "/google-chrome \"https://mail.google.com/mail/?voice#inbox\"" "/google-chrome \"https://www.google.com/voice/b/0#inbox\"" "xterm -geometry 230x10+0+0 -e aumix" &]] [[shell:xterm -e /tkquery-timer.sh &> /dev/null & disown]] * * http://www.agilemodeling.com/style/activityDiagram.htm * http://orgmode.org/worg/org-contrib/babel/languages.html * http://plantuml.sourceforge.net/activity.html tum Linux: 20 Iptables Examples For New SysAdmins by NIXCRAFT on DECEMBER 13, 2011 · 72 COMMENTS· LAST UPDATED MARCH 20, 2012 in IPTABLES, LINUX, LINUX DISTRIBUTION Linux comes with a host based firewall called Netfilter. According to the official project site: netfilter is a set of hooks inside the Linux kernel that allows kernel modules to register callback functions with the network stack. A registered callback function is then called back for every packet that traverses the respective hook within the network stack. This Linux based firewall is controlled by the program called iptables to handles filtering for IPv4, and ip6tables handles filtering for IPv6. I strongly recommend that you first read our quick tutorial that explains how to configure a host-based firewall called Netfilter (iptables) under CentOS / RHEL / Fedora / Redhat Enterprise Linux. This post list most common iptables solutions required by a new Linux user to secure his or her Linux operating system from intruders. IPTABLES Rules Example Most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell. Do not type commands on remote system as it will disconnect your access. For demonstration purpose I've used RHEL 6.x, but the following command should work with any modern Linux distro. This is NOT a tutorial on how to set iptables. See tutorial here. It is a quick cheat sheet to common iptables commands. #1: Displaying the Status of Your Firewall Type the following command as root: # iptables -L -n -v Sample outputs: Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Above output indicates that the firewall is not active. The following sample shows an active firewall: # iptables -L -n -v Sample outputs: Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID 394 43586 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 93 17292 ACCEPT all -- br0 * 0.0.0.0/0 0.0.0.0/0 1 142 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- br0 br0 0.0.0.0/0 0.0.0.0/0 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID 0 0 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 0 wanin all -- vlan2 * 0.0.0.0/0 0.0.0.0/0 0 0 wanout all -- * vlan2 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT all -- br0 * 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy ACCEPT 425 packets, 113K bytes) pkts bytes target prot opt in out source destination Chain wanin (1 references) pkts bytes target prot opt in out source destination Chain wanout (1 references) pkts bytes target prot opt in out source destination Where, -L : List rules. -v : Display detailed information. This option makes the list command show the interface name, the rule options, and the TOS masks. The packet and byte counters are also listed, with the suffix 'K', 'M' or 'G' for 1000, 1,000,000 and 1,000,000,000 multipliers respectively. -n : Display IP address and port in numeric format. Do not use DNS to resolve names. This will speed up listing. #1.1: To inspect firewall with line numbers, enter: # iptables -n -L -v --line-numbers Sample outputs: Chain INPUT (policy DROP) num target prot opt source destination 1 DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID 2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 4 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy DROP) num target prot opt source destination 1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 2 DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID 3 TCPMSS tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU 4 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 5 wanin all -- 0.0.0.0/0 0.0.0.0/0 6 wanout all -- 0.0.0.0/0 0.0.0.0/0 7 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy ACCEPT) num target prot opt source destination Chain wanin (1 references) num target prot opt source destination Chain wanout (1 references) num target prot opt source destination You can use line numbers to delete or insert new rules into the firewall. #1.2: To display INPUT or OUTPUT chain rules, enter: # iptables -L INPUT -n -v # iptables -L OUTPUT -n -v --line-numbers #2: Stop / Start / Restart the Firewall If you are using CentOS / RHEL / Fedora Linux, enter: # service iptables stop # service iptables start # service iptables restart You can use the iptables command itself to stop the firewall and delete all rules: # iptables -F # iptables -X # iptables -t nat -F # iptables -t nat -X # iptables -t mangle -F # iptables -t mangle -X # iptables -P INPUT ACCEPT # iptables -P OUTPUT ACCEPT # iptables -P FORWARD ACCEPT Where, -F : Deleting (flushing) all the rules. -X : Delete chain. -t table_name : Select table (called nat or mangle) and delete/flush rules. -P : Set the default policy (such as DROP, REJECT, or ACCEPT). #3: Delete Firewall Rules To display line number along with other information for existing rules, enter: # iptables -L INPUT -n --line-numbers # iptables -L OUTPUT -n --line-numbers # iptables -L OUTPUT -n --line-numbers | less # iptables -L OUTPUT -n --line-numbers | grep 202.54.1.1 You will get the list of IP. Look at the number on the left, then use number to delete it. For example delete line number 4, enter: # iptables -D INPUT 4 OR find source IP 202.54.1.1 and delete from rule: # iptables -D INPUT -s 202.54.1.1 -j DROP Where, -D : Delete one or more rules from the selected chain #4: Insert Firewall Rules To insert one or more rules in the selected chain as the given rule number use the following syntax. First find out line numbers, enter: # iptables -L INPUT -n --line-numbers Sample outputs: Chain INPUT (policy DROP) num target prot opt source destination 1 DROP all -- 202.54.1.1 0.0.0.0/0 2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state NEW,ESTABLISHED To insert rule between 1 and 2, enter: # iptables -I INPUT 2 -s 202.54.1.2 -j DROP To view updated rules, enter: # iptables -L INPUT -n --line-numbers Sample outputs: Chain INPUT (policy DROP) num target prot opt source destination 1 DROP all -- 202.54.1.1 0.0.0.0/0 2 DROP all -- 202.54.1.2 0.0.0.0/0 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state NEW,ESTABLISHED #5: Save Firewall Rules To save firewall rules under CentOS / RHEL / Fedora Linux, enter: # service iptables save In this example, drop an IP and save firewall rules: # iptables -A INPUT -s 202.5.4.1 -j DROP # service iptables save For all other distros use the iptables-save command: # iptables-save > /root/my.active.firewall.rules # cat /root/my.active.firewall.rules #6: Restore Firewall Rules To restore firewall rules form a file called /root/my.active.firewall.rules, enter: # iptables-restore < /root/my.active.firewall.rules To restore firewall rules under CentOS / RHEL / Fedora Linux, enter: # service iptables restart #7: Set the Default Firewall Policies To drop all traffic: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP # iptables -L -v -n #### you will not able to connect anywhere as all traffic is dropped ### # ping cyberciti.biz # wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.2-rc5.tar.bz2 #7.1: Only Block Incoming Traffic To drop all incoming / forwarded packets, but allow outgoing traffic, enter: # iptables -P INPUT DROP # iptables -P FORWARD DROP # iptables -P OUTPUT ACCEPT # iptables -A INPUT -m state --state NEW,ESTABLISHED -j ACCEPT # iptables -L -v -n ### *** now ping and wget should work *** ### # ping cyberciti.biz # wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.2-rc5.tar.bz2 #8:Drop Private Network Address On Public Interface IP spoofing is nothing but to stop the following IPv4 address ranges for private networks on your public interfaces. Packets with non-routable source addresses should be rejected using the following syntax: # iptables -A INPUT -i eth1 -s 192.168.0.0/24 -j DROP # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP #8.1: IPv4 Address Ranges For Private Networks (make sure you block them on public interface) 10.0.0.0/8 -j (A) 172.16.0.0/12 (B) 192.168.0.0/16 (C) 224.0.0.0/4 (MULTICAST D) 240.0.0.0/5 (E) 127.0.0.0/8 (LOOPBACK) #9: Blocking an IP Address (BLOCK IP) To block an attackers ip address called 1.2.3.4, enter: # iptables -A INPUT -s 1.2.3.4 -j DROP # iptables -A INPUT -s 192.168.0.0/24 -j DROP #10: Block Incoming Port Requests (BLOCK PORT) To block all service requests on port 80, enter: # iptables -A INPUT -p tcp --dport 80 -j DROP # iptables -A INPUT -i eth1 -p tcp --dport 80 -j DROP To block port 80 only for an ip address 1.2.3.4, enter: # iptables -A INPUT -p tcp -s 1.2.3.4 --dport 80 -j DROP # iptables -A INPUT -i eth1 -p tcp -s 192.168.1.0/24 --dport 80 -j DROP #11: Block Outgoing IP Address To block outgoing traffic to a particular host or domain such as cyberciti.biz, enter: # host -t a cyberciti.biz Sample outputs: cyberciti.biz has address 75.126.153.206 Note down its ip address and type the following to block all outgoing traffic to 75.126.153.206: # iptables -A OUTPUT -d 75.126.153.206 -j DROP You can use a subnet as follows: # iptables -A OUTPUT -d 192.168.1.0/24 -j DROP # iptables -A OUTPUT -o eth1 -d 192.168.1.0/24 -j DROP #11.1: Example - Block Facebook.com Domain First, find out all ip address of facebook.com, enter: # host -t a www.facebook.com Sample outputs: www.facebook.com has address 69.171.228.40 Find CIDR for 69.171.228.40, enter: # whois 69.171.228.40 | grep CIDR Sample outputs: CIDR: 69.171.224.0/19 To prevent outgoing access to www.facebook.com, enter: # iptables -A OUTPUT -p tcp -d 69.171.224.0/19 -j DROP You can also use domain name, enter: # iptables -A OUTPUT -p tcp -d www.facebook.com -j DROP # iptables -A OUTPUT -p tcp -d facebook.com -j DROP From the iptables man page: ... specifying any name to be resolved with a remote query such as DNS (e.g., facebook.com is a really bad idea), a network IP address (with /mask), or a plain IP address ... #12: Log and Drop Packets Type the following to log and block IP spoofing on public interface called eth1 # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j LOG --log-prefix "IP_SPOOF A: " # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP By default everything is logged to /var/log/messages file. # tail -f /var/log/messages # grep --color 'IP SPOOF' /var/log/messages #13: Log and Drop Packets with Limited Number of Log Entries The -m limit module can limit the number of log entries created per time. This is used to prevent flooding your log file. To log and drop spoofing per 5 minutes, in bursts of at most 7 entries . # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix "IP_SPOOF A: " # iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP #14: Drop or Accept Traffic From Mac Address Use the following syntax: # iptables -A INPUT -m mac --mac-source 00:0F:EA:91:04:08 -j DROP ## *only accept traffic for TCP port # 8080 from mac 00:0F:EA:91:04:07 * ## # iptables -A INPUT -p tcp --destination-port 22 -m mac --mac-source 00:0F:EA:91:04:07 -j ACCEPT #15: Block or Allow ICMP Ping Request Type the following command to block ICMP ping requests: # iptables -A INPUT -p icmp --icmp-type echo-request -j DROP # iptables -A INPUT -i eth1 -p icmp --icmp-type echo-request -j DROP Ping responses can also be limited to certain networks or hosts: # iptables -A INPUT -s 192.168.1.0/24 -p icmp --icmp-type echo-request -j ACCEPT The following only accepts limited type of ICMP requests: ### ** assumed that default INPUT policy set to DROP ** ############# iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT ## ** all our server to respond to pings ** ## iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT #16: Open Range of Ports Use the following syntax to open a range of ports: iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 7000:7010 -j ACCEPT #17: Open Range of IP Addresses Use the following syntax to open a range of IP address: ## only accept connection to tcp port 80 (Apache) if ip is between 192.168.1.100 and 192.168.1.200 ## iptables -A INPUT -p tcp --destination-port 80 -m iprange --src-range 192.168.1.100-192.168.1.200 -j ACCEPT ## nat example ## iptables -t nat -A POSTROUTING -j SNAT --to-source 192.168.1.20-192.168.1.25 #18: Established Connections and Restaring The Firewall When you restart the iptables service it will drop established connections as it unload modules from the system under RHEL / Fedora / CentOS Linux. Edit, /etc/sysconfig/iptables-config and set IPTABLES_MODULES_UNLOAD as follows: IPTABLES_MODULES_UNLOAD = no #19: Help Iptables Flooding My Server Screen Use the crit log level to send messages to a log file instead of console: iptables -A INPUT -s 1.2.3.4 -p tcp --destination-port 80 -j LOG --log-level crit #20: Block or Open Common Ports The following shows syntax for opening and closing common TCP and UDP ports: Replace ACCEPT with DROP to block port: ## open port ssh tcp port 22 ## iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT ## open cups (printing service) udp/tcp port 631 for LAN users ## iptables -A INPUT -s 192.168.1.0/24 -p udp -m udp --dport 631 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 631 -j ACCEPT ## allow time sync via NTP for lan users (open udp port 123) ## iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 123 -j ACCEPT ## open tcp port 25 (smtp) for all ## iptables -A INPUT -m state --state NEW -p tcp --dport 25 -j ACCEPT # open dns server ports for all ## iptables -A INPUT -m state --state NEW -p udp --dport 53 -j ACCEPT iptables -A INPUT -m state --state NEW -p tcp --dport 53 -j ACCEPT ## open http/https (Apache) server port to all ## iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT iptables -A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT ## open tcp port 110 (pop3) for all ## iptables -A INPUT -m state --state NEW -p tcp --dport 110 -j ACCEPT ## open tcp port 143 (imap) for all ## iptables -A INPUT -m state --state NEW -p tcp --dport 143 -j ACCEPT ## open access to Samba file server for lan users only ## iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 137 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 138 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 139 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 445 -j ACCEPT ## open access to proxy server for lan users only ## iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 3128 -j ACCEPT ## open access to mysql server for lan users only ## iptables -I INPUT -p tcp --dport 3306 -j ACCEPT #21: Restrict the Number of Parallel Connections To a Server Per Client IP You can use connlimit module to put such restrictions. To allow 3 ssh connections per client host, enter: # iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 3 -j REJECT Set HTTP requests to 20: # iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 --connlimit-mask 24 -j DROP Where, --connlimit-above 3 : Match if the number of existing connections is above 3. --connlimit-mask 24 : Group hosts using the prefix length. For IPv4, this must be a number between (including) 0 and 32. #22: HowTO: Use iptables Like a Pro For more information about iptables, please see the manual page by typing man iptables from the command line: $ man iptables You can see the help using the following syntax too: # iptables -h To see help with specific commands and targets, enter: # iptables -j DROP -h #22.1: Testing Your Firewall Find out if ports are open or not, enter: # netstat -tulpn Find out if tcp port 80 open or not, enter: # netstat -tulpn | grep :80 If port 80 is not open, start the Apache, enter: # service httpd start Make sure iptables allowing access to the port 80: # iptables -L INPUT -v -n | grep 80 Otherwise open port 80 using the iptables for all users: # iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT # service iptables save Use the telnet command to see if firewall allows to connect to port 80: $ telnet www.cyberciti.biz 80 Sample outputs: Trying 75.126.153.206... Connected to www.cyberciti.biz. Escape character is '^]'. ^] telnet> quit Connection closed. You can use nmap to probe your own server using the following syntax: $ nmap -sS -p 80 www.cyberciti.biz Sample outputs: Starting Nmap 5.00 ( http://nmap.org ) at 2011-12-13 13:19 IST Interesting ports on www.cyberciti.biz (75.126.153.206): PORT STATE SERVICE 80/tcp open http Nmap done: 1 IP address (1 host up) scanned in 1.00 seconds I also recommend you install and use sniffer such as tcpdupm and ngrep to test your firewall settings. Conclusion: This post only list basic rules for Linux users. * perl-1-liner-makes-fractal.pl use PDL; use PDL::IO::Pic;$a=zeroes 300,300; $r=$a->xlinvals(-1.5,0.5);$i=$a->ylinvals(-1,1); $t=$r;$u=$i;for(1..30){$q=$r**2-$i**2+$t;$h=2*$r*$i+ $u;$d=$r**2+$i**2;$a=lclip($a,$_*($d>2.0)*($a==0));($r, $i)=map{$_->clip(-5,5)}($q,$h);}$a->wpic("mandel.gif"); #*To test: # perl -MCPAN -e 'force notest install PDL' # perl /e/perl-1-liner-makes-fractal.pl # geeqie mandel.gif * wc.pl --with addition of "-L"==longest-line-width="$max" #!/usr/bin/env perl use strict; use warnings; sub printwc { my ($fname, $opts, $lines, $words, $chars, $max)=@_; $opts=~/l/ && printf("% 8d", $lines); $opts=~/w/ && printf("% 8d", $words); $opts=~/c/ && printf("% 8d", $chars); $opts=~/L/ && printf("% 8d", $max); $fname ne "-" && print " $fname"; print "\n"; } sub wc { my ($fname)=@_; my $lines=0; my $words=0; my $chars=0; my $max = 0; open(FILE, $fname) || die "Couldn\'t open file $fname"; foreach my $line () { my $len = length($line); $max = $len if $len > $max; $chars+=length($line); $line=~/\n$/ and ++$lines; $line=~s/^[ \t]*//g; $line=~s/[ \t\r\n]*$//g; my @w=split(/[ \t]+/, $line); $words+=@w; } close(FILE); $max = $max - 1; return ($lines, $words, $chars, $max); # return ($lines, $words, $chars); } sub usage { print "Usage: $0 [-cwlL] [*]\n"; exit 1; } my $nfiles=0; my $opts; my ($tot_lines, $tot_words, $tot_chars); my $arg; while($arg=shift(@ARGV) and $arg=~/^-/) { $arg=~/^-[lLwc]+$/ or usage(); $opts.=substr($arg, 1); } $opts or $opts="lLwc"; while($arg) { ++$nfiles; my ($lines, $words, $chars, $max)=wc($arg); $tot_lines+=$lines; $tot_words+=$words; $tot_chars+=$chars; printwc($arg, $opts, $lines, $words, $chars, $max); $arg=shift; } if($nfiles<1) { my ($lines, $words, $chars)=wc("-"); printwc("-", $opts, $lines, $words, $chars); } elsif($nfiles>1) { printwc("total", $opts, $tot_lines, $tot_words, $tot_chars); } exit 0; * perl ./perl-primes-by-using-regexp.pl 1 42 #*To test this program: To run it, you can save the code to a file called primes.pl and then run it like this: # perl primes.pl 1 42 => 2 3 5 7 11 13 17 19 23 29 31 37 41 print join(" ",grep{$_==2?1:$_<2||!($_%2)?0:do{for($b=1,$a=3;$a<=sqrt$_;$a+=2){do{$b=0;last}if!($_%$a)}$b}}(shift..shift)),"\n"; #**Equivalently you can do this in 1 line as a 1-liner as: perl -e 'print join(" ",grep{$_==2?1:$_<2||!($_%2)?0:do{for($b=1,$a=3;$a<=sqrt$_;$a+=2){do{$b=0;last}if!($_%$a)}$b}}(shift..shift)),"\n";' 1 42 => 2 3 5 7 11 13 17 19 23 29 31 37 41 * 1-2-3 setup *PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. GOTTA make sure alerts/notifications are viewable and hearable!!!!!!!!!!!!!!!!!: * PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. to allow remote configuration of this or some other machine!!!!! apt-get update * Can use ubuntu's "tasksel" to install all sorts of pre-defined software suits and servers! mail servers, dns, etc. apt-get install tasksel; tasksel apt-get install vncserver vncserver -geometry 1680x1050 then on the machine you wish to use to view it apt-get update apt-get install xtightvncviewer xtightvncviewer 192.168.1.3:1 echo "deb http://www.mirrorservice.org/sites/ftp.uk.debian.org/debian/ sid main non-free contrib" >> /etc/apt/sources.list echo "deb http://www.linuxcoin.co.uk/apt sensi main" >> /etc/apt/sources.list apt-get update apt-get install autocutsel ** on both machines autocutsel -fork apt-get install devilspie mkdir -p ~/.devilspie if ! cat << EOF > ~/.devilspie/undecorate.ds (if (is (application_name) "MPlayer") (begin (undecorate) ) ) EOF #Then to test: mplayer blah.mp4 & ; devilspie ---should undecorate window #eepitch allows the execution of a huge sequence of "red asterisked" commands #could be used for sys admin frap and/or a class/demo echo "deb http://angg.twu.net/debian . main" >> /etc/apt/sources.list apt-get update apt-get install eev #see the youtube video to learn more about eepitch apt-get install ; apt-get install firefox -f -y --force-yes ** @MUST@ GET THESE EXTENSIONS FOR FIREFOX: LASTPASS,GOOGLEBAR ----ALSO insure these add-ons are in firefox: Firemacs?,ZoteroPlugin? *** SEE other notes file in bitcoinblah.lc in lastpass for more ideas on what to install apt-get install sox apt-get install audacity apt-get install ruby1.9.1 apt-get install rubygems gem install terminal-notifier echo "deb http://debian.sur5r.net/minitube testing main" >> /etc/apt/sources.list echo "deb http://ftp.debian.org/debian/ testing main contrib non-free" >> /etc/apt/sources.list #echo "deb http://www.mirrorservice.org/sites/ftp.mepis.org/mepis/ mepis-11.0.0 main " >> /etc/apt/sources.list #echo "deb http://ftp.mirrorservice.org/sites/ftp.mepis.org/mepis/ mepis-11.0 main " >> /etc/apt/sources.list echo "deb http://ftp.debian.org/debian/ squeeze main contrib non-free " >> /etc/apt/sources.list #echo "deb http://security.debian.org/ squeeze/updates main contrib non-free " >> /etc/apt/sources.list echo "deb http://ftp.debian.org/debian/ squeeze-updates main " >> /etc/apt/sources.list echo "deb http://main.mepis-deb.org/mepiscr/repo/ mepis11cr main non-free" >> /etc/apt/sources.list echo "deb http://restricted.mepis-deb.org/mepiscr/repo/ mepis11cr restricted restricted-non-free" >> /etc/apt/sources.list apt-get update apt-get install scrot * centos/fedora/yum based distros yum install ntp chkconfig ntpd on ntpdate pool.ntp.org /etc/init.d/ntpd start *Need to set up alerts: apt-get install -f -y --force-yes pavucontrol ; echo "play with pavucontrol for sound alerts checks/audio alarms" apt-get install -f -y --force-yes xosd-bin apt-get install -f -y --force-yes zsync apt-get install -f -y --force-yes libxosd2 apt-get install -f -y --force-yes dpkg-awk #apt-get install -f -y --force-yes iotop #apt-get install -f -y --force-yes atop * http://alsa.opensrc.org/.asoundrc <=> "Warning Neither .asoundrc or /etc/asound.conf is normally required."!!! apt-get install -f -y --force-yes pulseaudio-utils gstreamer pulseaudio libsdl1.2 debian-pulseaudio apt-get install -f -y --force-yes pavucontrol apt-get install pulseaudio libao4 paprefs libpulse-mainloop-glib0 pulseaudio-module-jack pavucontrol pulseaudio-module-hal pulseaudio-module-x11 gstreamer0.10-pulseaudio pulseaudio-utils libasound2-plugins paman pulseaudio-module-gconf libgconfmm-2.6-1c2 libpulse-browse0 pavumeter libglademm-2.4-1c2a pulseaudio-esound-compat libpulse0 libpulse-dev pulseaudio-module-bluetooth pulseaudio-module-zeroconf **cp /e/asound.conf /etc/asound.conf **cp /e/asoundrc ~/.asoundrc ** "It is also possible for the user to force Pulseaudio to relinquish it's lock of the audio device. Just precede the command of the program you wish to start with the pasuspender command. For instance: Code: Select all pasuspender audacity ln -s ~/n/n/n/iron-browser/iron-linux/iron /bin *PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. GOTTA make sure evil heater turns off!!!!!!!!!!!!!!!!!: 1. apt-get install lm-sensors => Reading package lists... Done Building dependency tree Reading state information... Done lm-sensors is already the newest version. 2. sensors-detect => "This program will help you determine which kernel modules you need to load to use lm_sensors most effectively." ... Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): Module cpuid loaded successfully. Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... No AMD Family 10h thermal sensors... Success! (driver `k10temp') AMD Family 11h thermal sensors... No Intel digital thermal sensor... No Intel AMB FB-DIMM thermal sensor... No VIA C7 thermal sensor... No VIA Nano thermal sensor... No Some Super I/O chips contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors? (YES/no): Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... Yes Found `ITE IT8720F Super IO Sensors' Success! (address 0x228, driver `it87') Probing for Super-I/O at 0x4e/0x4f Trying family `National Semiconductor'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... No .... Some hardware monitoring chips are accessible through the ISA I/O ports. We have to write to arbitrary I/O ports to probe them. This is usually safe though. Yes, you do have ISA I/O ports even if you do not have any ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): yes Probing for `National Semiconductor LM78' at 0x290... No Probing for `National Semiconductor LM79' at 0x290... No Probing for `Winbond W83781D' at 0x290... No Probing for `Winbond W83782D' at 0x290... No Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): Using driver `i2c-piix4' for device 0000:00:14.0: ATI Technologies Inc SB600/SB700/SB800 SMBus Module i2c-dev loaded successfully. --------------------------------------------------------so lm-sensors found the hardware and checked that the appropriate hardware is loaded----in this example (on the antec skeleton machine the correct module was loaded---if it wasn't I believe something like this would have been suggested and I would have done: modprobe i2c-piix4 ----and/or what seems to have happened was lm-sensors went ahead and loaded the module 3. Then more questions were asked and I typed "yes" when asked if I wanted the lm-sensors program to add the module it believes will help to the "/etc/modules" file: Next adapter: Radeon aux bus DP-auxch (i2c-8) Do you want to scan it? (YES/no/selectively): Now follows a summary of the probes I have just done. Just press ENTER to continue: Driver `it87': * ISA bus, address 0x228 Chip `ITE IT8720F Super IO Sensors' (confidence: 9) Driver `k10temp' (autoloaded): * Chip `AMD Family 10h thermal sensors' (confidence: 9) To load everything that is needed, add this to /etc/modules: #----cut here---- # Chip drivers it87 #----cut here---- If you have some drivers built into your kernel, the list above will contain too many modules. Skip the appropriate ones! Do you want to add these lines automatically to /etc/modules? (yes/NO)yes Successful! Monitoring programs won't work until the needed modules are loaded. You may want to run '/etc/init.d/module-init-tools start' to load them. Unloading i2c-dev... OK Unloading cpuid... OK ----AND THEN IT AUTOMATICALLY DUMPED OUT OF THE lm-sensors PROGRAM! 4. Then it seemed I got useful information by doing: sensors -f => radeon-pci-0100 Adapter: PCI adapter temp1: +127.4°F k10temp-pci-00c3 Adapter: PCI adapter temp1: +81.5°F (high = +158.0°F, crit = +159.8°F) ... apt-get update apt-get install -f * emacs snapshot (daily cutting edge emacsen!) #echo "deb http://emacs.naquadah.org/ stable/" >> /etc/apt/sources.list #echo "deb-src http://emacs.naquadah.org/ stable/" >> /etc/apt/sources.list #wget -q -O - http://emacs.naquadah.org/key.gpg | sudo apt-key add - #apt-get install emacs-snapshot -f -y --force-yes ** To test it: emacs-snapshot daily_cutting_edge_emacsen.j * googlecl api's apt-get install -y -f googlecl ** I did eventually get it installed; but, not sure what I did, I think it was a combo of these commands: apt-get install -y -f gdata cd /.svn svn checkout http://googlecl.googlecode.com/svn/trunk/ googlecl-read-only python setup.py install apt-get update apt-get install -y -f python-setuptools python-distutils-extra python-pkg-resources apt-get install -y -f python-setuptools python-distutils-extra apt-get update apt-get install -y -f python-distutils-extra apt-get install -y -f python-beautifulsoup apt-get install python-gdata apt-get install python-gdata-doc ** To test: google calendar add "Lunch with Jim at noon tomorrow" ** http://code.google.com/apis/gdata/articles/python_client_lib.html *inkmacs anyone!? and/or speechd.el: ** Need a bakup app that loads and makes vector graphics/XML editable: apt-get install -y -f ; apt-get install inkscape -f -y --force-yes apt-get install -y -f ; apt-get install eieio -f -y --force-yes cd /.git ; git clone https://github.com/jave/inkmacs cd /e/n/n/lib/elisp/speechd-dir/speechd-el-2.4 ; make Do the frookie in /e/n/n/lib/elisp/speechd-dir/speechd-el-2.4/README load the (load-library "/usr/local/share/emacs/site-lisp/speechd") *put this on linode ~/.emacs--and insure on all other machines!!! (setq dired-recursive-deletes 'nil) *ack is better than grep--but "apt-get install ack" installs japanese kanji!!: workarounds: use pkg-divert to force the package name to "ack"!!: **http://betterthangrep.com/ ---install App::Ack dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep apt-get install ; apt-get install ack-grep -f -y --force-yes and/or perl -MCPAN -e ' autobundle ' perl -MCPAN -e ' force install notest App::Ack' and/or apt-get install ; apt-get install ack-grep -f -y --force-yes ; curl http://ack.googlecode.com/svn/tags/latest/ack > ~/bin/ack && chmod 0755 !$ and/or cp /home/ack / and/or cpanp install App::Ack apt-get install ; apt-get install perlconsole -f -y --force-yes #*Then can do things like perlconsole ; perlconsole> print (1 .. 42) #**Similarly you can do: perl -e 'print (1 .. 42)' #***Famously you can do things like find the prime numbers between 1 and 137: perl -e 'print join(" ",grep{$_==2?1:$_<2||!($_%2)?0:do{for($b=1,$a=3;$a<=sqrt$_;$a+=2){do{$b=0;last}if!($_%$a)}$b}}(shift..shift)),"\n";' 1 137 => 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 apt-get install ; apt-get install ipython -f -y --force-yes apt-get install ; apt-get install python-mode -f -y --force-yes * the iconic, problematic, extremely annoying isomaster: http://littlesvr.ca/isomaster/releases/ ** USE ONLY THIS VERSION/DO ONLY THE FOLLOWING dpkg -i isomaster_1.3.7-2_i386.deb *** And/or this (I guess) untried: #dpkg -i isomaster_1.3.7-2_amd64.deb || dpkg -i /e/isomaster_1.3.7-2_amd64.deb * To make usb thumb drives #dpkg -i /e/live-usb-install-2.3.1-all.deb ** use unetbootin instead--it worked!-- To make usb drives and use zip tools apt-get install ; apt-get install unetbootin -f -y --force-yes apt-get install ; apt-get install extlinux -f -y --force-yes apt-get install ; apt-get install syslinux -f -y --force-yes *fractals damit!!: rsync -Hab /e/n/n/lib/xtacy/distro.ibiblio.org/pub/linux/distributions/amigolinux/download/XApps/xtacy-1.14/usr / *To install MANPWIN fractal viewer and color cycler:" apt-get install ; apt-get install wine -f -y --force-yes wine /e/SetupManpWIN.exe & *PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. apt-get update apt-get install ; apt-get install r-base -f -y --force-yes apt-get install ; apt-get install r-base-core -f -y --force-yes apt-get install ; apt-get install r-base-recommended -f -y --force-yes apt-get install ; apt-get install r-doc-info -f -y --force-yes apt-get install ; apt-get install r-doc-pdf -f -y --force-yes apt-get install ; apt-get install r-mathlib -f -y --force-yes apt-get install ; apt-get install r-base-html -f -y --force-yes apt-get install ; apt-get install r-doc-html -f -y --force-yes apt-get install ; apt-get install r-base-dev -f -y --force-yes dpkg -i /e/rstudio-0.95.261-i386.deb *PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. Put an editor and browser that can edit anything--and any file of any size--and something that is light and lightning fast: **And some basic compile/configure programs are often needed: apt-get install ; apt-get install qemacs -f -y --force-yes ***google-chrome http://bellard.org/qemacs/ http://ftp.debian.org/debian/pool/main/q/qemacs/ apt-get install ; apt-get install mousepad -f -y --force-yes apt-get install ; apt-get install autoconf -f -y --force-yes apt-get install ; apt-get install automake -f -y --force-yes apt-get install ; apt-get install yasm -f -y --force-yes apt-get install ; apt-get install g++ -f -y --force-yes apt-get install ; apt-get install m4 -f -y --force-yes apt-get install ; apt-get install autopoint -f -y --force-yes apt-get install ; apt-get install gettext -f -y --force-yes apt-get install ; apt-get install gettext-doc -f -y --force-yes apt-get install ; apt-get install libunistring0 -f -y --force-yes apt-get install ; apt-get install curl -f -y --force-yes apt-get install ; apt-get install php5-curl -f -y --force-yes apt-get install ; apt-get install libcurl3-dev -f -y --force-yes apt-get install ; apt-get install make -f -y --force-yes apt-get install ; apt-get install wmctrl -f -y --force-yes apt-get install ; apt-get install tcpxtract -f -y --force-yes apt-get install ; apt-get install ess -f -y --force-yes apt-get install ; apt-get install xlispstat -f -y --force-yes apt-get install ; apt-get install pspp -f -y --force-yes apt-get install ; apt-get install tcpxtract -f -y --force-yes apt-get install ; apt-get install jags -f -y --force-yes apt-get install ; apt-get install xscreensaver -f -y --force-yes apt-get install ; apt-get install xscreensaver-data-extra -f -y --force-yes #dpkg -i /e/shantz-xwinwrap_v0.3.deb || dpkg -i /e/shantz-xwinwrap_0.3-2~ppa~hardy1_amd64.deb dpkg -i /e/shantz-xwinwrap_0.3-2~ppa~hardy1_amd64.deb *Add these lines to /etc/apt/sources.list etc.: echo " " >> /etc/apt/sources.list #echo "deb http://debian.sur5r.net/minitube testing main" >> /etc/apt/sources.list #echo "deb http://ftp.debian.org/debian/ testing main contrib non-free" >> /etc/apt/sources.list apt-get install ; apt-get update ; apt-get install minitube -f -y --force-yes apt-get -f install apt-get clean apt-get autoremove dpkg --configure -a * Still getting the "Errors were encountered while processing": cp /var/lib/dpkg/status /var/lib/dpkg/status.bak emacs /var/lib/dpkg/status * qemu, kvm, kqemu, vde2, uml vnc isomaster (isomaster to edit the crappy files idiots bundle into .iso files--that I often boot up with "qemu" and/or "kvm") apt-get install -f -y --force-yes qemu apt-get install -f -y --force-yes qemu-user-static debootstrap apt-get install -f -y --force-yes vde2 apt-get install -f -y --force-yes umview kernel-patch-viewos libpurelibc1 libumlib0 umview apt-get install -f -y --force-yes qemu-launcher qemuctl apt-get install xtightvncviewer -f -y --force-yes apt-get install rdesktop dpkg -i /debs-new/qemu-launcher_1.8.0~pre0-1_all.deb * Set up GNUEmacsPanDocMode and/or pdf2text/pdf conversion tools (now called/covered by poppler-utils) http://linuxappfinder.com/package/poppler-utils and http://wwwuser.gwdg.de/~jkremer/pandoc-mode.html ** "DO NOT USE THE DEBIAN REPOSITORIES--RIGHT NOW THEY ARE WAY BEHIND!": apt-get remove pandoc apt-get install ; apt-get install cabal-install -f -y --force-yes cabal update cabal install cabal-install cabal update apt-get install ; apt-get install libghc6-zlib-dev zlibc cabal install pandoc ** If all of the above frap fails for you: apt-get install ; apt-get install pandoc -f -y --force-yes *Make sure these are bookmarked in "namoroka"/Tor/Vidalia (firefox browser): http://xqzfakpeuvrobvpj.onion ---ie mybitcoin.com https://betco.in/user/login apt-get install ; apt-get install sysstat -f -y --force-yes apt-get install ; apt-get install isag -f -y --force-yes apt-get install ; apt-get install nmh -f -y --force-yes apt-get install ; apt-get install metamail -f -y --force-yes apt-get install ; apt-get install exmh mh-e mh-book -f -y --force-yes apt-get install ; apt-get install -f -y --force-yes ** http://linuxappfinder.com/package/poppler-utils <=> pdftohtml pdftoppm pdftops (there seems to be a pdf2ps too--installed with ghostscript--so howsabout these): apt-get install ; apt-get install poppler-utils -f -y --force-yes apt-get install ; apt-get install gs -f -y --force-yes *** pdffonts -- font analyzer *** pdfimages -- image extractor *** pdfinfo -- document information *** pdftoabw -- PDF to Abiword converter *** pdftohtml -- PDF to HTML converter *** pdftoppm -- PDF to PPM/PNG/JPEG image converter *** pdftops -- PDF to PostScript (PS) converter *** pdftotext -- text extraction * Django web framework anyone? cd /.svn ; svn co http://code.djangoproject.com/svn/django/trunk/ django/trunk cd /.git ; git clone https://github.com/django/django.git cd /.hg ; hg clone https://bitbucket.org/django/django ** To find where "site-packages" are stored for PYTHON (so paths and links can be set up): python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" => /usr/lib/python2.6/dist-packages *** The above example output would then lead me to change the pseudocode below: echo WORKING-DIR/django-trunk > SITE-PACKAGES-DIR/django.pth **** To this actual code/shell command: echo /.svn/django-trunk > /usr/lib/python2.6/dist-packages/django.pth ***** i.e. a ".pth" file is created in the "dist-packages" dir ** create a symbolic link to the file django-trunk/django/bin/django-admin.py in a directory on your system path, such as /usr/local/bin. For example: ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin *** (In the above line, change WORKING-DIR to match the full path to your new django-trunk directory.) **** This simply lets you type django-admin.py from within any directory, rather than having to qualify the command with the full path to the file. *** So this led me to do this: ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin pseudocode was changed to => ln -s /.svn/django-trunk/django/bin/django-admin.py /usr/local/bin ** To update django dev software: cd /.svn/django-trunk && svn update * Set up "fuse"-ability with google-docs (the method of using fuse to mount google-docs and/or maybe gmail drive too to a local directory on your machine seems to use "google-docs-fs" (don't believe this should be confused with (but maybe related to/uses/runs on) "googleFS" apt-get install ; apt-get install python-fuse -f -y --force-yes apt-get install ; apt-get install python-gdata -f -y --force-yes **webpage http://code.google.com/p/google-docs-fs/wiki/OnlineManual seems to require gdata-python not python-gdata!? diff? apt-get install ; apt-get install gdata-python -f -y --force-yes cd /.hg ; hg clone https://google-docs-fs.googlecode.com/hg/ google-docs-fs *Download the latest .deb from /google-chrome http://code.google.com/p/google-docs-fs/downloads/detail?name=python-gdata_2.0.14-1_all.deb&can=2&q= dpkg -i /e/google-docs-fs-1.0rc1_all.deb dpkg -i /e/python-gdata_2.0.14-1_all.deb #apt-get install ; apt-get install tork -f -y --force-yes #apt-get install ; apt-get install privoxy -f -y --force-yes * Absonuggenlutely need the puppetmaster!!: apt-get install ; apt-get install puppet -f -y --force-yes ** Puppet seems so useful/important=>I'll give it a "P" in my "GELLOPY MetaBrowser project/draft": GELLOPPY == GNU (GNU software as much as possible) Emacs Linux-kernel-node-to-Linux-kernel-node (Linux network is assumed) OrgMode!! PuppetMasterAndPuppetNodes! P[Y]? == PERL and/or PY-thon (and maybe YAML--or some other Y thing I want to focus on--Y-combinator!? **Lock screen after idle time of arg1---requires: apt-get install ; apt-get install xprintidle -f -y --force-yes apt-get install ; apt-get install stalonetray --force-yes apt-get install -y -f alsa-oss alsaplayer mpg321 alsaplayer-alsa alsa-base apt-get install ; apt-get install aumix -f -y --force-yes apt-get install ; apt-get install timidity -f -y --force-yes ***Can't play midi files without a midi module with "timidity"--and these: apt-get install ; apt-get install freepats -f -y --force-yes apt-get install ; apt-get install timidity-daemon -f -y --force-yes apt-get install ; apt-get install k3b -f -y --force-yes apt-get install ; apt-get install vcdimager -f -y --force-yes #apt-get install ; apt-get install alltray -f -y --force-yes ln -s /root/n/n/n/iron-browser/iron-linux/iron /usr/bin --you could stop here and be ready for just about anything; but, depending on what you'll use your machine for, here are the things I suggest doing, in order of importance and/or package dependencies: *PRE-PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. Must monitor temperature and turn off heaters and/or the computer itself if/when it gets too hot!! ** before/more important than getting the monitor working is @only one thing@: making sure that you can be signaled when it fails to work/is unplugged whatever---turning the heater/cooler on/off and not signaling when no reading is made can be very hazardous: apt-get install sox *For amd 64 bit machines: Control the fan/overclocking/temperature: http://sourceforge.net/projects/amdovdrvctrl/ http://sourceforge.net/projects/amdovdrvctrl/files/deb%20binaries/amdoverdrivectrl_1.2.0_amd64.deb/download *For bitcoin mining with mid-range half-decent gpu graphics card--tried this--but it failed 2jun11: apt-get install python-pyopencl subversion cd ~/ wget http://iweb.dl.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.3.21/bitcoin-0.3.21-linux.tar.gz tar xvf bitcoin-0.3.19-linux.tar.gz cd /.svn svn checkout http://svn.json-rpc.org/trunk/python-jsonrpc cd python-jsonrpc/ sudo python setup.py install cd .. mkdir .bitcoin echo "rpcuser=un" > .bitcoin/bitcoin.conf echo "rpcpassword=pw" >> .bitcoin/bitcoin.conf wget --no-check-certificate https://github.com/m0mchil/poclbm/raw/master/BitcoinMiner.cl wget --no-check-certificate https://github.com/m0mchil/poclbm/raw/master/BitcoinMiner.py wget --no-check-certificate https://github.com/m0mchil/poclbm/raw/master/poclbm.py wget --no-check-certificate https://github.com/m0mchil/poclbm/raw/master/sha256.py ~/bitcoin-0.3.21/bin/64/bitcoin -server & python poclbm.py -d 0 --user un --pass pw *Installing dns on own server/linode: apt-get install bind9 **Edit "/etc/init.d/bind9"---or similar see the APR11 issue of lj for more on this * basic "/.blah dirs"---this won't work/not what you want: rsync -Hab /mnt/sdb1/.* / ----but this is what you want: rsync -Hab /mnt/sdb1/.[a-z] / *** since the alert is a sound that plays (a gun and/or a bomb or whatever you want in "/xkill" that signals no reading is done--and the alert is done every few minutes from a program in /etc/crontab (to make sure the reading is made---also insure that if no reading is made then any heat is turned off since no heat is better than too much heat!!) ** need to do these perl commands 1stly!!!---and every so often when/if you screw up the perl configuration/module-tree-structure: *** Do the next line iff having problems/way too many error messages: rm -Rf ~/.cpan ; rm /etc/perl/CPAN/Config.pm perl -MCPAN -e ' autobundle ' ***If you don't have the main script for the usb thermometer yet: apt-get install make wget -O temper_mon.pl http://www.cs.unc.edu/~hays/dev/bash/temper/temper_mon.pl chmod a+x temper_mon.pl mv temper_mon.pl / /temper_mon.pl apt-get install -f apt-get install libusb-dev -f -y --force-yes cpan -fi Bundle::CPAN /install_perl_mods.sh /perldiver.sh apt-get install libusb-dev apt-get install libinline-perl -f -y --force-yes apt-get install libdevice-usb-pcsensor-hidtemper-perl -f -y --force-yes ***The above script should install the following perl modules: cpan -fi Inline::MakeMaker cpan -fi Bundle::CPAN cpan -fi Inline::C cpan -fi ExtUtils::MakeMaker => ... Parse::RecDescent Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] ----I just hit return to accept the yes whenever it queries---chose the default/hit return cpan -fi Inline::MakeMaker cpan -fi Device::USB cpan -fi Device::USB::PCSensor::HidTEMPer The source for this is up at: http://search.cpan.org/dist/Device-USB-PCSensor-HidTEMPer/ Now, you need a file that will call the perl module, mine is named temper_mon.pl cd .. wget -O temper_mon.pl http://www.cs.unc.edu/~hays/dev/bash/temper/temper_mon.pl chmod a+x temper_mon.pl *bitcoin apt-get install m2crypto apt-get install python-pycurl apt-get install python-argparse /.git/black-market-client/bmc.py -h /.git/black-market-client/bmc.py register => "Registered. Keep the file named /root/.blackmarket3.rsa safe." * gotta have parrallel: cp /parallel /usr/local/bin || cd /debs-new/parallel-????? ; bunzip2 /debs-new/parallel-?????.tar.bz2 ; tar xvf parallel-????.tar ; ./configure ; make install **Make sure you have the latest version!!: parallel -V|grep "^GNU parallel 20" *install bamboo artist tablet apt-get install ; apt-get install g++ -f -y --force-yes apt-get install xserver-xorg-input-wacom apt-get install xinput apt-get install xserver-xorg-input-all apt-get install libhal-dev apt-get install build-essential libx11-dev libxi-dev x11proto-input-dev modprobe wacom * gotta have main scripting languages apt-get install -f -y --force-yes tcl apt-get install -f -y --force-yes blt apt-get install -f -y --force-yes ruby *QuickLisp apt-get install ; apt-get install sbcl -f -y --force-yes apt-get install ; apt-get install darcs sbcl-doc sbcl-source slime apt-get install ; apt-get install cl-swank -f -y --force-yes * in lxde set this "DigitalClockSettings->Action when Clicked: /osd_cat-time-and-date.sh **Trying a "back road route" to installing LaTeX: latexmk apt-get install ; apt-get install latexmk -f -y --force-yes apt-get install babel apt-get install cweb-latex apt-get install rcs-latex apt-get install texlive-doc-en apt-get install scalable-cyrfonts-tex apt-get install auctex apt-get install catdvi apt-get install dvipng apt-get install lacheck apt-get install -y acroread apt-get install -y latex2rtf apt-get install -y latex2rtf-doc apt-get install ; apt-get install acroread-plugins -f -y --force-yes apt-get install ; apt-get install mozilla-acroread -f -y --force-yes apt-get install ; apt-get install texinfo -f -y --force-yes apt-get install ; apt-get install perl-doc -f -y --force-yes apt-get install ; apt-get install texi2html -f -y --force-yes apt-get install ; apt-get install latex2html -f -y --force-yes #apt-get install ; apt-get install texlive-generic-recommended texinfo-doc-nonfree tex-common -f -y --force-yes #apt-get install ; apt-get install tetex-extra -f -y --force-yes ** pdfjam may be usefull => pdfnup, which allows one or more PDF files to be "n-upped" , pdfpun, similar to pdfnup but arranges the source pages right-to-left , pdfjoin, which combines the pages of multiple PDF files , pdf90, pdf180 and pdf270 which rotate the pages , pdfflip which reflects the pages of one or more PDF files , pdfbook which arranges pages into 2-up "signatures" (like psbook does for PostScript files), suitable for binding into a book , pdfjam-pocketmod which converts 8 pages from a single PDF file into a pocket-sized booklet , pdfjam-slides6up and pdfjam-slides3up *** A potential drawback of pdfjam and other scripts based upon it is that any hyperlinks in the source PDF are lost. #apt-get install ; apt-get install pdfjam texlive-fonts-recommended texlive-latex-recommended texlive-latex-recommended-doc * other stuff apt-get install -f -y --force-yes screen apt-get install -f -y --force-yes surfraw apt-get install -f -y --force-yes surfraw-extra apt-get install -f -y --force-yes info apt-get install -f -y --force-yes texinfo-doc-nonfree apt-get install -f -y --force-yes texinfo * need version control systems apt-get install -f -y --force-yes git apt-get install -f -y --force-yes git-core apt-get install -f -y --force-yes git-doc apt-get install -f -y --force-yes git-gui ** some wayly kuul git repositories git clone git://git.debian.org/surfraw/surfraw.git *Other ways to get and use software--using additional package managers (that "play nice"/extend/supplement APT's ability to install and use software--in the case of NIX: an infinite number of coexisting software versions!!) apt-get install -f -y --force-yes zeroinstall-injector apt-get install -f -y --force-yes plash apt-get install -f -y --force-yes cabextract apt-get install -f -y --force-yes rpm apt-get install -f -y --force-yes alien ** Test ZeroInstall/0launch: 0launch http://0install.net/2006/3rd-party/PySol.xml ** Get NIX--the best way is to configure and compile it (says on the NIX website): wget nixos ; ./configure ; make ; make install * need to make sure lxde has a few tweeks Settings->OpenBoxConfigurationManager->Appearance->[x] Windows retain a border when undecorated * essential accessibility packages--install these 1st!! apt-get install -f -y --force-yes kdeaccessibility apt-get install -f -y --force-yes flite * need to be able to decrypt some files: apt-get install -f -y --force-yes mcrypt * make sure that the Google software repository is in sources.list # Google software repository deb http://dl.google.com/linux/deb/ stable non-free main * get these for things related to "whats-going-on-the-network.sh" apt-get install -f -y --force-yes sysstat apt-get install -f -y --force-yes icmpinfo apt-get install -f -y --force-yes tcpdump apt-get install -f -y --force-yes gnuplot apt-get install -f -y --force-yes tcptrace apt-get install -f -y --force-yes wireshark * essential packaging packages--install these 1st!! apt-get install -f -y --force-yes python-software-properties echo "python-software-properties provides apt-get install -f -y --force-yes isoquery add-apt-repository ppa:ferramberto/minitube apt-get update && apt-get install minitube * for x10/house temperature/control apt-get install bottlerocket apt-get install xfig * Essential packages for emergency cdrom live distros like "lubuntu-remaster1.sh" apt-get install -f -y --force-yes encfs apt-get install -f -y --force-yes emacs21 apt-get install -f -y --force-yes emacs22 apt-get install -f -y --force-yes emacs23 apt-get install -f -y --force-yes mplayer2 apt-get install -f -y --force-yes org-mode apt-get install -f -y --force-yes emacs-jabber apt-get install ; apt-get install org-mode -f -y --force-yes apt-get install ; apt-get install gnuplot -f -y --force-yes apt-get install ; apt-get install gnuplot-mode -f -y --force-yes apt-get install ; apt-get install ditaa -f -y --force-yes apt-get install ; apt-get install s5 -f -y --force-yes dpkg -i /e/plantuml_7707-1_all.deb ; mkdir /usr/local/share/plantuml ; wget http://sourceforge.net/projects/plantuml/files/plantuml.jar/download -O /usr/local/share/plantuml/plantuml.jar apt-get update ; apt-get install ; apt-get install graphiz -f -y --force-yes *** i.e. graphiz/"dot" required an "update" ** of course a jabber server is needed: do the stuff on the website below and/or install firefox and use: http://jwchat.org/ http://www.debian-administration.org/articles/42 *** and/or just create a room like http://briangpowellms.speeqe.com/ and email an invitation to your perspective "victim" *** cd /.git ; git clone git://emacs-jabber.git.sourceforge.net/gitroot/emacs-jabber/emacs-jabber apt-get install encfs mv /home/encfs-raw / mv /home/mepis21 / mkdir /e /mepis21 and/or do this: modprobe fuse ; echo "e...."| encfs -S /encfs-raw /e * Gotta play with GNU Parrallel!!: emacs /debs-new/parallel-20101222/README ---make sure its installed somehow!!!---get the fallback/similar package just in case "GNU QUEUE" ---see http://ftp.gnu.org/gnu/gnu-queue/ * dbus investigation tools apt-get install qt4-dev-tools * Set up wacom Bamboo touchpad/mouse/multitouch: apt-get install wacom-tools -y ** See http://linuxwacom.sourceforge.net/index.php/howto/xsetwacom *** "The xsetwacom is a command-line Wacom driver configuration tool. It changes the pressure sensitivity, click threshold, button functions, cursor mode and speed, and much more without having to manually modify XF86Config or xorg.conf file. *Set up the tempermental google-chrome---Definitely the 1st thing I did: Googled for google-chrome and downloaded "google-chrome-stable_current_i386.deb" to ~/Downloads * cd ~/Downloads * Edited my sources.list file to look exactly like this: # See sources.list(5) for more information # This file should be edited through synaptic # MEPIS improvements, overrides and updates--the MEPIS magic deb ftp://ftp.mirrorservice.org/sites/ftp.mepis.org/mepis/ mepis-8.5 main deb ftp://ftp.mirrorservice.org/sites/ftp.mepis.org/mepis/ mepis-8.0 main # MEPIS master pools, please use only if mirror is slow or down deb ftp://ftp.mepis.com/mepis/ mepis-8.5 main # deb ftp://ftp.mepis.com/mepis/ mepis-8.0 main deb ftp://ftp.debian.org/debian/ lenny main contrib non-free # deb-src ftp://ftp.debian.org/debian/ lenny main contrib non-free deb http://security.debian.org/ lenny/updates main contrib non-free deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free # Some Debian Multimedia software might be illegal in some jurisdictions deb http://www.debian-multimedia.org lenny main non-free * Needed to install some other packages that the googe "stable" version depends on and failed to install many times: apt-get install -f -y --force-yes gconf2-common => "Unmet dependencies. Try 'apt-get -f install'" ** So I did this of course: apt-get -f install => Setting up gconf2-common (2.22.0-1) ...Setting up libidl0 (0.8.10-0.1) ...Setting up liborbit2 (1:2.14.13-0.1) ... * Definitely this was the last thing I did (for at least the 10th time) dpkg -i --force-depends google-chrome-stable_current_i386.deb ** To test: google-chrome * @need@ to install temperature usb thermometer---to turn off heater when too hot ** These may help apt-get install -f -y --force-yes tk8.5 apt-get install -f -y --force-yes expect apt-get install -f -y --force-yes expectk ----to get "expect" in the mix for use by cpan sudo cpan -fi CPAN::FirstTime apt-get install -f -y --force-yes wicd apt-get install -f -y --force-yes network-manager-kde *remastering .iso files softwares: apt-get install xfprint4 -y apt-get install mousepad -y apt-get install isomaster -y apt-get install gv html2ps t1-cyrillic wdiff -y *Change the wallpaper: Right-Click on the desktop. Choose "Folder View Settings"=>"Appearance"=>"Wallpaper"--chose "Slide Show" from the available types--then set up like good old KDE3 *Download the latest google-chrome dpkg -i google-chrome...deb apt-get -f install google-chrome (test it and make sure it comes up) * edit the /etc/apt/apt.conf file and adding the line below: APT::Cache-Limit 60000000; vi /etc/apt/apt.conf * install qemu and the android google-linux operating system development emulator so you can make android apps and make money and buy food and maybe survive a few more years: apt-get install openjdk-6-jdk apt-get install ant ** Download the Android linux release from http://developer.android.com/sdk/index.html to the Desktop and unzip. cp android-sdk_r07-linux_x86.tgz.tar ~/Desktop cd ~/Desktop mkdir ~/opt tar xvf android-sdk_r07-linux_x86.tgz.tar mv /root/n/n/lib/android/android-sdk-linux_x86 ~/opt/android emulator ----to test that the android emulator works *###################################################################################################1 Set the friggin "locales"!! apt-get install -f -y language-pack-en-base export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 locale-gen en_US.UTF-8 dpkg-reconfigure locales **PRE-PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. Must syncronize clocks daily with ntpd and/or rdate #apt-get install ; apt-get install rstart -f -y --force-yes apt-get install -f -y --force-yes ntp apt-get install -f -y --force-yes ntp-doc apt-get install -f -y --force-yes rdate apt-get install -y -f xautomation apt-get install -y -f xwit apt-get update -f mkdir /.replay *add this line but remember to comment it out later: deb ftp://ftp.us.debian.org/debian/ sid main non-free ** gotta do: apt-get update -f (for the new repositories to be active) ----DO NOT DO "UPGRADE" OR "DIST UPGRADE" OR "DIST ANYTHING"--IT WILL DELETE ALL OF YOUR FAVORITE (PROBABLY UNUSUAL) PACKAGES LIKE "ALLTRAY"----DO A LOT OF "apt-get update -f" and/or "apt-get install -f" -=---but make sure that the "sid"/unstable line is commented out before you do this *Need to firstly install a bakup maker---best right now: blu-ray disk writer--------------Therefore: Newest version (version that writes blu-ray (bakup) disks at least) of K3B is the 1st thing thats "gotta be on the machine": apt-get install g++ -f -y --force-yes cd /debs-new/k3b-2.0.1 ; mkdir build ; cd build ; apt-get install -y -f cmake ; cmake .. ; ----------this is failing: recommend using knoppix-dvd to bring up the latest version of "k3b" for burning dookie/makin' bakups!!! *need to firstly install "whohas" and "netselect" and "netselect-apt" to find the newest and best or needed .deb packages----and to do that you need these first: apt-get install -y -f libwww-perl dpkg -i /debs-new/whohas_0.24-1_all.deb apt-get -f install *dpkg -i /debs-new/whohas_0.24-1_all.deb || apt-get install -y -f whohas libxml-simple-perl libwww-perl *apt-get install netselect-apt;apt-get install -y -f netselect;whohas -s [mplayer2 emacs21 sc perl] ***whohas -s emacs21 => ... Debian libgraphicsmagick1-dev 1.1.11-3.2 testing http://packages.debian.org/lenny/libgraphicsmagick1-dev Debian libgraphicsmagick1 1.1.11-3.2 unstable http://packages.debian.org/sid/libgraphicsmagick1 Debian libgraphicsmagick1-dev 1.1.11-3.2 unstable http://packages.debian.org/sid/libgraphicsmagick1-dev Debian libgraphicsmagick1-dev 1.2.4-1 experimenta http://packages.debian.org/experimental/libgraphicsmagick1-dev ***apt-get -t experimental install libgraphicsmagick1-dev And/or apt-get install -y -f libgraphicsmagick1-dev=1.2.4-1 **After finding wayly kuul version you want [eg emacs21 ***And using netselect and/or **see/master http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html#s-default-version ***Where version is the version of Debian you want to use as the main distribution. The versions you can use are stable, testing and unstable. To install packages from another version, then, you must use APT in the following way: # apt-get -t distribution install package For that to work, though, you need at least one APT source line in your /etc/apt/sources.list for the distribution you want the package from, and the package must exist on that source. You can also request a specific version of a package using the following sintax: # apt-get install -y -f package=version For example, the line below will install version 2.2.4-1 of the nautilus package.: # apt-get install -y -f nautilus=2.2.4-1 IMPORTANT: the `unstable' version of Debian is the version to which the newest versions of Debian packages are uploaded first. This distribution sees all of the changes that packages go through, both small ones and more drastic ones which affect many packages or the whole system. For this reason, this version of the distribution should not be used by inexperienced users or by those who need proven stability. The `testing' distribution is not necessarily better than `unstable', because it does not receive security updates quickly. For servers and other production systems stable should always be used. **Edit crucial sites into /etc/apt/sources.list [given output from above] before apt-get installs/updates--especially of these crucial software pieces: Insure that these crucial software [cp them maybe]: xv[only when necessary],emacs21,perl,sc and these *Use "netselect" and "netselect-apt" **Each time I install Debian - and I have done it scores of times on multiple machines, I get frustrated in choosing the right Debian mirror for updating the package database on my machine using 'apt-get update', or installing a new package for that matter. Some of the questions that I had to find a solution for were ... Do I choose the Debian mirror in my country (India) or do I use one of the US servers ? Is there any way to find which of the two are the fastest for my geographic location ? It might sound ironical, but experience tells me that the truism of choosing a Debian apt mirror closest to ones location does not hold true for me. Because at all times, when I have used a mirror from India, it is dead slow. And believe it or not, the responsiveness of the mirror will do a great deal of difference to how fast you are able to update your Debian machine. Enter netselect-apt, a package which helps one to find and use the fastest Debian mirror for his region. What this script does in conjunction with 'netselect' command is, it first downloads a list of all the Debian apt mirrors from the official Debian website using wget. The list is saved in a file named 'mirrors_full' in your current directory. It then checks the responsiveness of each of the servers in the list and then selects the fastest among them. Finally it writes the necessary code in the sources.list file and saves it in your current directory. Considering that on last count there are a total of 248 Debian mirrors to choose from, that is a pretty tedious job. In order to use netselect-apt, the first thing you have to do in your newly installed Debian machine is download and install the netselect-apt package. This can be done as follows : # apt-get install -y -f netselect-apt The netselect-apt package depends on the netselect package and so it will also be automatically installed. You can pass a couple of options while invoking the netselect-apt command. For instance, I have Debian Etch installed on my machine. And if I want to find the fastest Debian Etch repository mirror for my geographic region, I run the netselect-apt command as follows : # netselect-apt etch If I want it to include non-free software section as well while creating the sources.list file, then I use the -n option : # netselect-apt -n etch You can also ask netselect-apt to select only ftp servers instead of http ones by passing the -f option. # netselect-apt -n -f etch Apart from etch, you can pass the following options - stable, testing, unstable, experimental, woody, sarge and sid. If you choose not to pass any options, then by default netselect-apt uses 'stable' as the option. Once it finishes its work, you will find a newly created sources.list file in your current directory which will have the necessary code pointing to the fastest Debian server for your location. Now all you have to do is to copy the sources.list file to /etc/apt/ directory and do an apt-get update. # cp ./sources.list /etc/apt/sources.list # apt-get update Please note that the speed of the servers change over a period of time and is dependent on a variety of external factors. So the server that netselect-apt chooses today need not be the fastest one for you say, a couple of weeks hence. So if you are in the habit of installing and updating software all the time, it will be prudent to run netselect-apt once every week or so and update your sources.list file to point to the fastest mirror. *If you really need to use "sid" the unstable tree---uncomment it but remember comment it back up *The way that packages leave incoming ---> experimental ---> unstable ---> testing is layed out on the Debian home site. Stable is the distribution when all the packages in testing are 'frozen' and no new ones are allowed to come into it. The release is made. If its stable its STABLE. You won't find a more stable GNU/Linux platform than Debian stable (you'd have to compare it with a FreeBSD release. apt-get upgrade upgrades what you have on the system already but doesn't introduce new packages unless absolutely necessary. apt-get dist-upgrade upgrades everything on your system and resolves any new dependancies as well, thus introducing more new stuff tou your system. To get from stable to testing or unstable, you have to point your /etc/apt/sources.list to testing or unstable folders on your update mirrors instead of stable. Hope this helped a bit. BTW, if you have a bit of time and you loke OS stuff, you might want to scour the Debian site. There's a lot of really neat stuff that's going on. Debian Hurd, Debian/NetBSD, etc. Cool. *Never do these with "sid"/unstable-debian-library in the : apt-get upgrade and/or apt-get dist upgrade *PRE-PRE-PRE-STEP 1. mkdir ~/tmp --and use it often!--rather than /tmp which may change and be affected by numerous things! mkdir ~/tmp ; chmod -s ~/tmp ; chmod +t ~/tmp * editing the /etc/apt/apt.conf file and adding the line below: APT::Cache-Limit 40000000; *edit /etc/apt/sources.list ----make sure there is a line in sources.list that has a reference to an "unstable" repository (always stay on the cutting edge!!)---like a line like this: deb ftp://ftp.us.debian.org/debian/ sid main non-free ---and take out/uncomment the "mepis 8.5" line and do: apt-get update -y apt-get install -f -y --force-yes qemacs ; apt-get update -y apt-get install -f -y --force-yes zile ; apt-get update -y apt-get install -f -y --force-yes emacs21 ; apt-get update -y apt-get install -f -y --force-yes emacs21-el ; apt-get update -y apt-get install -f -y --force-yes emacs22 ; apt-get update -y apt-get install -f -y --force-yes emacs22-el ; apt-get update -y apt-get install -f -y --force-yes emacs23 ; apt-get update -y apt-get install -f -y --force-yes emacs23-el ; apt-get update -y apt-get install -f -y --force-yes emacs24 ; apt-get update -y apt-get install -f -y --force-yes emacs24-el ; apt-get update -y apt-get update -f **Edit the sources.list ----comment out the "sid" unstable!! **cat /home/etc/apt/sources.list >> /etc/apt/sources.list *Installing a Mepis Operating System is as easy as 1-2-3: **Set the monitor size options: vi /etc/X11/xorg.conf and insure something like this section: ... SubSection "Display" Depth 8 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 15 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 16 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 24 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 32 Modes "1024x768" "800x600" EndSubSection ... **Insure you have swap (swap files and/or partitions--put something like the following line in "/etc/fstab" /dev/hda4 swap swap defaults 0 0 **Do a mkswap on the partition or file: mkswap /dev/sda5 **Then of course swapon -a ---or just: swapon /dev/sda5 ***maybe add to crontabs: 25 1 * * * root /etc/init.d/ntp restart **PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. "make" @NEEDS@ to be interactive: rsync -Hab --no-perms --chmod u+rwx /home/u / cp /tkquery /bin cp /quickClip /bin **quickClip needs wish and tcl/tk apt-get install -f -y --force-yes tk8.5 cp /wcat /bin **For ubuntu/kubuntu distros the root user must exist and have a desktop available: ***set up the root user sudo passwd root ***emacs /etc/kde4/kdm/kdmrc Change the "AllowRootLogin" to "true" ***may have to do init 2 sudo su init 5 ----and/or: startx ****Notes:Ubuntu: How to enable the root account Ubuntu is one of the few Linux distributions out there that will not enable the root account (actually it is the only one I have seen myself, but hey, there might be others that I am not aware of). This is a very good idea and you should probably try to learn to use sudo for daily maintenance. But in case you want to enable root login on your Ubuntu system this little post will show you how you can do that. As you have noticed during the Ubuntu installation there was no question about the root password, as you might have been used to see during other Linux distribution installation process. This is why the root account is inactive and can\u2019t be used (no password configured) until we will setup a proper password for it. To do this, we simply need to run: ***** sudo passwd root This will ask for a new root password and once you confirm it, you can start using the root account to login. In case you will want to disable back the root account, just lock the root account by running: ***** sudo passwd -l root **PRE-PRE-PRE-PRE-PRE-PRE-STEP 1. gotta get emacs21 (until the old software works with new versions of emacs23+): apt-get install -y -f nxml-mode **PRE-PRE-PRE-PRE-PRE-STEP 1. Put any programs you want running regardless of whether someone/you log in to it run as root before the login dialog appears----just as long as it boots up--this file will be run 1st/when and if X/kde is started up: /etc/kde3/kdm/Xsetup: "# Xsetup - run as root before the login dialog appears" emacs /etc/kde3/kdm/Xsetup **PRE-PRE-PRE-PRE-STEP 1. Insure multiple kdm's/xsessions and/or window managers and @BAK-UP WINDOW MANAGERS@ are in place possible for testing and configuring new system: ***edit emacs /etc/kde3/kdm/kdmrc ***change "StaticServers=:0" and "ReserveServers=:1,:2,:3" to: ----to set up multiple displays/multiple desktops--then can run alert software in ":1" that does "xte"/auto machine mouse typing that alerts ":0" display while working there StaticServers=:0,:1 ReserveServers=:2,:3 ****Then can login as NNNNN and ROOT simultaneously and test messaging and multiple "display" applications like: (make-frame-on-display ":1.0") ---then multiple users can each edit same file simultaneously! The oldest groupware I know of!!!!!! ;-) **PRE-PRE-PRE-PRE-STEP 1.1 Install a backup server "xfce4" (and alltray and stalonetray and aumix) on display 3 (ie ":2" since CAF7=":0" and CAF7=":1" and CAF9=":2")---BIG NOTE: DO NOT REBOOT OR SHUT DOWN FROM THE XFCE(OR OTHER ALTERNATE WINDOW MANAGER--IT WILL THEN BECOME THE DEFAULT!!--AND YOU WOULD HAVE TO UNINSTALL XFCE--SEE /stocks.org for notes/icon-buttons on how) rsync -Hab --no-perms --chmod u+rwx /Autostart /root/.kde #*libfreekinect/: OpenKinect: http://www.kinect-hacks.com ** apt-get install nvidia-glx nvidia-glx-dev ; dpkg -i libfreenect-dev-0.0-i686.deb ** Can PyPy be used with OpenKinect some how, for real-time encoding/processing/rendering!?: http://morepypy.blogspot.com/2011/07/realtime-image-processing-in-python.html http://www.youtube.com/v/5DtlBC_Zbq4 ** http://hackaday.com/category/kinect-hacks/ ** To install: Went to OpenKinect/LibFreeKinect websites and did what they suggest; but, the last things I did (that I remember): *** apt-get install nvidia-glx nvidia-glx-dev ; dpkg -i libfreenect-dev-0.0-i686.deb ; emacs /etc/apt/sources (put in the latest MEPIS repositories 11.0 worked) **** apt-get install mesa-common-dev ; apt-get install freeglut3-dev *** vi /etc/X11/xorg.conf ----made sure "nvidia" is not in the xorg.conf--instead "nv" is---use the free driver--not the non-free one---this suggestion is "all over the Internet" **** In fact, best thing to do is to include a snapshot of /etc/X11/xorg.conf : Section "ServerLayout" Identifier "XFree86 Configured" Screen 0 "Screen0" 0 0 #Screen 0 "ATIScreen" 0 0 #Screen 1 "Screen1" RightOf "Screen0" #Option "Xinerama" "true" #Option "Clone" "true" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "PS/2 Mouse" "CorePointer" InputDevice "USB Mouse" "CorePointer" #InputDevice "Touchpad" "SendCoreEvents" #InputDevice "ALPS Touchpad" "SendCoreEvents" #InputDevice "Appletouch" "SendCoreEvents" #InputDevice "Stylus" "SendCoreEvents" #InputDevice "Eraser" "SendCoreEvents" #InputDevice "Cursor" "SendCoreEvents" #InputDevice "Serial Mouse" "CorePointer" # InputDevice "stylus" "SendCoreEvents" # InputDevice "eraser" "SendCoreEvents" # InputDevice "cursor" "SendCoreEvents" # InputDevice "pad" # no core events EndSection Section "InputDevice" Driver "wacom" Identifier "stylus" Option "Device" "/dev/ttyS0" # SERIAL ONLY Option "Device" "/dev/input/wacom" # USB ONLY Option "Type" "stylus" Option "USB" "on" # USB ONLY Option "ForceDevice" "ISDV4" # Serial Tablet PC ONLY EndSection Section "InputDevice" Driver "wacom" Identifier "eraser" Option "Device" "/dev/ttyS0" # SERIAL ONLY Option "Device" "/dev/input/wacom" # USB ONLY Option "Type" "eraser" Option "USB" "on" # USB ONLY Option "ForceDevice" "ISDV4" # Serial Tablet PC ONLY EndSection Section "InputDevice" Driver "wacom" Identifier "cursor" # Wacom tablet mouse Option "Device" "/dev/ttyS0" # SERIAL ONLY Option "Device" "/dev/input/wacom" # USB ONLY Option "Type" "cursor" Option "USB" "on" # USB ONLY Option "ForceDevice" "ISDV4" # Serial Tablet PC ONLY EndSection # This section is for Tablets & TabletPCs that support touch Section "InputDevice" Driver "wacom" Identifier "touch" Option "Device" "/dev/ttyS0" # SERIAL ONLY Option "Device" "/dev/input/wacom-touch" # USB ONLY Option "Type" "touch" Option "ForceDevice" "ISDV4" # Serial Tablet PC ONLY Option "USB" "on" # USB ONLY EndSection # This section is for Intuos3, Intuos4, CintiqV5, Graphire4, Bamboo, or BambooPT Section "InputDevice" Driver "wacom" Identifier "pad" # Tablet buttons Option "Device" "/dev/ttyS0" # SERIAL ONLY Option "Device" "/dev/input/wacom" # USB ONLY Option "Type" "pad" Option "USB" "on" # USB ONLY EndSection Section "ServerFlags" Option "AllowMouseOpenFail" "true" EndSection Section "Files" # Xorg 7.0 font paths FontPath "/usr/share/fonts/X11/100dpi:unscaled" FontPath "/usr/share/fonts/X11/misc:unscaled" # Other font paths FontPath "/usr/share/fonts/truetype/arphic" FontPath "/usr/share/fonts/truetype/freefont" FontPath "/usr/share/fonts/truetype/kochi" FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera" # path to defoma fonts FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" EndSection Section "Module" Load "dbe" Load "dri" Load "extmod" Load "freetype" Load "glx" Load "type1" Load "v4l" Load "vbe" EndSection Section "InputDevice" Identifier "Keyboard0" Driver "keyboard" Option "CoreKeyboard" Option "XkbModel" "pc105" Option "XkbLayout" "us" Option "XKbOptions" "" EndSection Section "InputDevice" Identifier "Serial Mouse" Driver "mouse" Option "Protocol" "Microsoft" Option "Device" "/dev/ttyS0" Option "Emulate3Buttons" "false" Option "Emulate3Timeout" "70" EndSection Section "InputDevice" Identifier "Touchpad" Driver "synaptics" Option "Device" "/dev/psaux" Option "Protocol" "auto-dev" Option "LeftEdge" "1700" Option "RightEdge" "5300" Option "TopEdge" "1700" Option "BottomEdge" "4200" Option "FingerLow" "25" Option "FingerHigh" "30" Option "MaxTapTime" "180" Option "MaxTapMove" "220" Option "VertScrollDelta" "100" Option "HorizScrollDelta" "0" Option "MinSpeed" "0.09" Option "MaxSpeed" "0.18" Option "AccelFactor" "0.0015" Option "SHMConfig" "on" EndSection Section "InputDevice" Driver "synaptics" Identifier "ALPS Touchpad" Option "Device" "/dev/input/mice" Option "Protocol" "event" Option "LeftEdge" "130" Option "RightEdge" "840" Option "TopEdge" "130" Option "BottomEdge" "640" Option "FingerLow" "7" Option "FingerHigh" "8" Option "MaxTapTime" "180" Option "MaxTapMove" "110" Option "EmulateMidButtonTime" "75" Option "VertScrollDelta" "20" Option "HorizScrollDelta" "0" Option "MinSpeed" "0.25" Option "MaxSpeed" "0.50" Option "AccelFactor" "0.030" Option "EdgeMotionMinSpeed" "200" Option "EdgeMotionMaxSpeed" "200" Option "UpDownScrolling" "1" Option "CircularScrolling" "1" Option "CircScrollDelta" "0.1" Option "CircScrollTrigger" "2" Option "SHMConfig" "on" EndSection Section "InputDevice" Identifier "Appletouch" Driver "synaptics" Option "Device" "/dev/psaux" Option "Protocol" "auto-dev" Option "LeftEdge" "100" Option "RightEdge" "1120" Option "TopEdge" "50" Option "BottomEdge" "310" Option "FingerLow" "25" Option "FingerHigh" "30" Option "MaxTapMove" "220" Option "TapButton1" "1" Option "TapButton2" "3" Option "TapButton3" "2" Option "MinSpeed" "0.79" Option "MaxSpeed" "0.88" Option "AccelFactor" "0.0015" Option "SHMConfig" "on" EndSection Section "InputDevice" Identifier "PS/2 Mouse" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "false" Option "Emulate3Timeout" "70" Option "ZAxisMapping" "4 5" Option "Buttons" "5" EndSection Section "InputDevice" Identifier "USB Mouse" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "ExplorerPS/2" Option "ZAxisMapping" "4 5" Option "Buttons" "5" EndSection Section "InputDevice" Identifier "Stylus" Driver "wacom" Option "Mode" "Absolute" Option "Type" "stylus" Option "Device" "/dev/input/wacom" Endsection # Settings for wacom eraser Section "InputDevice" Identifier "Eraser" Driver "wacom" Option "Mode" "Absolute" Option "Type" "eraser" Option "Device" "/dev/input/wacom" Endsection # Settings for wacom cursor (mouse) Section "InputDevice" Identifier "Cursor" Driver "wacom" Option "Mode" "Relative" Option "Type" "cursor" Option "Device" "/dev/input/wacom" Endsection Section "Monitor" Identifier "Monitor0" VendorName "unknown" ModelName "unknown" Option "DPMS" "true" HorizSync 30-75 VertRefresh 55-70 EndSection Section "Monitor" Identifier "Monitor1" VendorName "unknown" ModelName "unknown" Option "DPMS" "true" HorizSync 30-75 VertRefresh 55-70 EndSection Section "Monitor" Identifier "ATIMonitor" VendorName "unknown" ModelName "unknown" Option "DPMS" "true" HorizSync 30-75 VertRefresh 55-70 EndSection Section "Device" Identifier "Card0" Driver "nv" BoardName "unknown" Screen 0 #Option "UseDisplayDevice" "dfp" #Option "MonitorLayout" "crt,crt" #BusID "PCI:1:0:0" #Option "sw_cursor" # needed for some ati cards #Option "hw_cursor" #Option "NoAccel" #Option "ShowCache" #Option "ShadowFB" #Option "UseFBDev" #Option "Rotate" Option "UseInternalAGPGART" "no" Option "XAANoOffscreenPixmaps" "true" # savage special options, use with care #Option "NoUseBios" #Option "BusType" "PCI" Option "DmaMode" "None" # nvidia special options, use with care Option "CursorShadow" "1" Option "CursorShadowAlpha" "63" Option "CursorShadowYOffset" "2" Option "CursorShadowXOffset" "4" Option "FlatPanelProperties" "Scaling = native" Option "NoLogo" "true" Option "UseEDID" "true" Option "AddARGBGLXVisuals" "true" Option "RenderAccel" "true" Option "AllowGLXWithComposite" "true" EndSection Section "Device" Identifier "Card1" Driver "nv" BoardName "unknown" Screen 1 #Option "MonitorLayout" "crt,crt" #BusID "PCI:1:0:0" EndSection Section "Screen" Identifier "Screen0" Device "Card0" Monitor "Monitor0" DefaultColorDepth 24 SubSection "Display" Depth 8 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 15 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 16 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 24 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 32 Modes "1024x768" "800x600" EndSubSection # Only the official NVIDIA driver supports twinview # these setting are an example Option "TwinView" "false" Option "SecondMonitorVendorName" "unknown" Option "SecondMonitorModelName" "unknown" Option "SecondMonitorHorizSync" "30-75" Option "SecondMonitorVertRefresh" "55-70" #Option "MetaModes" "1024x768, 1024x768" Option "TwinViewOrientation" "RightOf" Option "ConnectedMonitor" "dfp,dfp" EndSection Section "Screen" Identifier "Screen1" Device "Card1" Monitor "Monitor1" DefaultColorDepth 24 SubSection "Display" Depth 8 Modes "800x600" EndSubSection SubSection "Display" Depth 15 Modes "800x600" EndSubSection SubSection "Display" Depth 16 Modes "800x600" EndSubSection SubSection "Display" Depth 24 Modes "800x600" EndSubSection SubSection "Display" Depth 32 Modes "800x600" EndSubSection EndSection Section "Screen" Identifier "ATIScreen" Device "Card0" Monitor "ATIMonitor" DefaultColorDepth 24 SubSection "Display" Depth 24 Modes "800x600" EndSubSection EndSection Section "DRI" Mode 0666 EndSection #Section "Extensions" # Option "Composite" "Enable" #EndSection Section "Extensions" Option "Composite" "Disable" EndSection *** ***** And here is the present log: "cat /var/log/Xorg.0.log" X.Org X Server 1.7.7 Release Date: 2010-05-04 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.32.28-dsa-ia32 i686 Debian Current Operating System: Linux nnnnn 2.6.36-1-mepis-smp #1 SMP Mon Dec 27 17:19:20 CST 2010 i686 Kernel command line: root=/dev/sda1 nomce quiet splash vga=788 Build Date: 12 January 2011 03:44:48AM xorg-server 2:1.7.7-11 (Cyril Brulebois ) Current version of pixman: 0.21.2 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Tue Apr 19 15:21:25 2011 (==) Using config file: "/etc/X11/xorg.conf" (==) Using config directory: "/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/share/X11/xorg.conf.d" (==) ServerLayout "XFree86 Configured" (**) |-->Screen "Screen0" (0) (**) | |-->Monitor "Monitor0" (**) | |-->Device "Card0" (**) |-->Input Device "Keyboard0" (**) |-->Input Device "PS/2 Mouse" (**) |-->Input Device "USB Mouse" (**) Option "AllowMouseOpenFail" "true" (==) Automatically adding devices (==) Automatically enabling devices (WW) The directory "/usr/share/fonts/truetype/arphic" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/truetype/kochi" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist. Entry deleted from font path. (**) FontPath set to: /usr/share/fonts/X11/100dpi:unscaled, /usr/share/fonts/X11/misc:unscaled, /usr/share/fonts/truetype/freefont, /usr/share/fonts/truetype/ttf-bitstream-vera, /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, /usr/share/fonts/X11/misc, /usr/share/fonts/X11/100dpi/:unscaled, /usr/share/fonts/X11/Type1, /usr/share/fonts/X11/100dpi, /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, built-ins (==) ModulePath set to "/usr/lib/xorg/modules" (**) Extension "Composite" is disabled (WW) Duplicate core pointer devices. Removing core pointer attribute from "USB Mouse" (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled. (WW) Disabling Keyboard0 (WW) Disabling PS/2 Mouse (WW) Disabling USB Mouse (II) Loader magic: 0x81ecca0 (II) Module ABI versions: X.Org ANSI C Emulation: 0.4 X.Org Video Driver: 6.0 X.Org XInput driver : 7.0 X.Org Server Extension : 2.0 (++) using VT number 7 (--) PCI:*(0:1:0:0) 10de:014d:10de:0349 nVidia Corporation NV43GL [Quadro FX 550] rev 162, Mem @ 0xe8000000/67108864, 0xd8000000/134217728, 0xee000000/16777216, BIOS @ 0x????????/131072 (II) Open ACPI successful (/var/run/acpid.socket) (II) "extmod" will be loaded. This was enabled by default and also specified in the config file. (II) "dbe" will be loaded. This was enabled by default and also specified in the config file. (II) "glx" will be loaded. This was enabled by default and also specified in the config file. (II) "record" will be loaded by default. (II) "dri" will be loaded. This was enabled by default and also specified in the config file. (II) "dri2" will be loaded by default. (II) LoadModule: "dbe" (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so (II) Module dbe: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.0.0 Module class: X.Org Server Extension ABI class: X.Org Server Extension, version 2.0 (II) Loading extension DOUBLE-BUFFER (II) LoadModule: "dri" (II) Loading /usr/lib/xorg/modules/extensions/libdri.so (II) Module dri: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.0.0 ABI class: X.Org Server Extension, version 2.0 (II) Loading extension XFree86-DRI (II) LoadModule: "extmod" (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so (II) Module extmod: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.0.0 Module class: X.Org Server Extension ABI class: X.Org Server Extension, version 2.0 (II) Loading extension SELinux (II) Loading extension MIT-SCREEN-SAVER (II) Loading extension XFree86-VidModeExtension (II) Loading extension XFree86-DGA (II) Loading extension DPMS (II) Loading extension XVideo (II) Loading extension XVideo-MotionCompensation (II) Loading extension X-Resource (II) LoadModule: "glx" (II) Loading /usr/lib/xorg/modules/extensions/libglx.so (II) Module glx: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.0.0 ABI class: X.Org Server Extension, version 2.0 (==) AIGLX enabled (II) Loading extension GLX (II) LoadModule: "v4l" (WW) Warning, couldn't open module v4l (II) UnloadModule: "v4l" (EE) Failed to load module "v4l" (module does not exist, 0) (II) LoadModule: "vbe" (II) Loading /usr/lib/xorg/modules/libvbe.so (II) Module vbe: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.1.0 ABI class: X.Org Video Driver, version 6.0 (II) LoadModule: "record" (II) Loading /usr/lib/xorg/modules/extensions/librecord.so (II) Module record: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.13.0 Module class: X.Org Server Extension ABI class: X.Org Server Extension, version 2.0 (II) Loading extension RECORD (II) LoadModule: "dri2" (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so (II) Module dri2: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.1.0 ABI class: X.Org Server Extension, version 2.0 (II) Loading extension DRI2 (II) LoadModule: "nv" (II) Loading /usr/lib/xorg/modules/drivers/nv_drv.so (II) Module nv: vendor="X.Org Foundation" compiled for 1.7.7, module version = 2.1.17 Module class: X.Org Video Driver ABI class: X.Org Video Driver, version 6.0 (II) NV: driver for NVIDIA chipsets: RIVA 128, RIVA TNT, RIVA TNT2, Unknown TNT2, Vanta, RIVA TNT2 Ultra, RIVA TNT2 Model 64, Aladdin TNT2, GeForce 256, GeForce DDR, Quadro, GeForce2 MX/MX 400, GeForce2 MX 100/200, GeForce2 Go, Quadro2 MXR/EX/Go, GeForce2 Integrated GPU, GeForce2 GTS, GeForce2 Ti, GeForce2 Ultra, Quadro2 Pro, GeForce4 MX 460, GeForce4 MX 440, GeForce4 MX 420, GeForce4 MX 440-SE, GeForce4 440 Go, GeForce4 420 Go, GeForce4 420 Go 32M, GeForce4 460 Go, Quadro4 550 XGL, GeForce4 440 Go 64M, Quadro NVS, Quadro4 500 GoGL, GeForce4 410 Go 16M, GeForce4 MX 440 with AGP8X, GeForce4 MX 440SE with AGP8X, GeForce4 MX 420 with AGP8X, GeForce4 MX 4000, GeForce4 448 Go, GeForce4 488 Go, Quadro4 580 XGL, Quadro4 NVS 280 SD, Quadro4 380 XGL, Quadro NVS 50 PCI, GeForce4 448 Go, GeForce4 MX Integrated GPU, GeForce3, GeForce3 Ti 200, GeForce3 Ti 500, Quadro DCC, GeForce4 Ti 4600, GeForce4 Ti 4400, GeForce4 Ti 4200, Quadro4 900 XGL, Quadro4 750 XGL, Quadro4 700 XGL, GeForce4 Ti 4800, GeForce4 Ti 4200 with AGP8X, GeForce4 Ti 4800 SE, GeForce4 4200 Go, Quadro4 700 GoGL, Quadro4 980 XGL, Quadro4 780 XGL, GeForce FX 5800 Ultra, GeForce FX 5800, Quadro FX 2000, Quadro FX 1000, GeForce FX 5600 Ultra, GeForce FX 5600, GeForce FX 5600XT, GeForce FX Go5600, GeForce FX Go5650, Quadro FX Go700, GeForce FX 5200, GeForce FX 5200 Ultra, GeForce FX 5200, GeForce FX 5200LE, GeForce FX Go5200, GeForce FX Go5250, GeForce FX 5500, GeForce FX 5100, GeForce FX Go5200 32M/64M, Quadro NVS 55/280 PCI, Quadro FX 500/600 PCI, GeForce FX Go53xx Series, GeForce FX Go5100, GeForce FX 5900 Ultra, GeForce FX 5900, GeForce FX 5900XT, GeForce FX 5950 Ultra, GeForce FX 5900ZT, Quadro FX 3000, Quadro FX 700, GeForce FX 5700 Ultra, GeForce FX 5700, GeForce FX 5700LE, GeForce FX 5700VE, GeForce FX Go5700, GeForce FX Go5700, Quadro FX Go1000, Quadro FX 1100, GeForce 6800 Ultra, GeForce 6800, GeForce 6800 LE, GeForce 6800 XE, GeForce 6800 XT, GeForce 6800 GT, GeForce 6800 GT, GeForce 6800 GS, GeForce 6800 XT, Quadro FX 4000, GeForce 6800 GS, GeForce 6800, GeForce 6800 LE, GeForce 6800 XT, GeForce Go 6800, GeForce Go 6800 Ultra, Quadro FX Go1400, Quadro FX 3450/4000 SDI, Quadro FX 1400, GeForce 6600 GT, GeForce 6600, GeForce 6600 LE, GeForce 6600 VE, GeForce Go 6600, GeForce 6610 XL, GeForce Go 6600 TE/6200 TE, GeForce 6700 XL, GeForce Go 6600, GeForce Go 6600 GT, Quadro NVS 440, Quadro FX 550, Quadro FX 550, Quadro FX 540, GeForce 6200, GeForce 6500, GeForce 6200 TurboCache(TM), GeForce 6200SE TurboCache(TM), GeForce 6200 LE, GeForce Go 6200, Quadro NVS 285, GeForce Go 6400, GeForce Go 6200, GeForce Go 6400, GeForce 6250, GeForce 7100 GS, GeForce 6800, GeForce 6800 LE, GeForce 6800 GT, GeForce 6800 XT, GeForce 6200, GeForce 6200 A-LE, GeForce 7800 GTX, GeForce 7800 GTX, GeForce 7800 GT, GeForce 7800 GS, GeForce 7800 SLI, GeForce Go 7800, GeForce Go 7800 GTX, Quadro FX 4500, GeForce 7350 LE, GeForce 7300 LE, GeForce 7300 SE, GeForce Go 7200, GeForce Go 7300, GeForce Go 7400, GeForce Go 7400 GS, Quadro NVS 110M, Quadro NVS 120M, Quadro FX 350M, GeForce 7500 LE, Quadro FX 350, GeForce 7300 GS, GeForce 7650 GS, GeForce 7600 GT, GeForce 7600 GS, GeForce 7300 GT, GeForce 7600 LE, GeForce 7300 GT, GeForce Go 7700, GeForce Go 7600, GeForce Go 7600 GT, Quadro NVS 300M, GeForce Go 7900 SE, Quadro FX 550M, Quadro FX 560, GeForce 7900 GTX, GeForce 7900 GT, GeForce 7900 GS, GeForce 7950 GX2, GeForce 7950 GX2, GeForce 7950 GT, GeForce Go 7950 GTX, GeForce Go 7900 GS, GeForce Go 7900 GTX, Quadro FX 2500M, Quadro FX 1500M, Quadro FX 5500, Quadro FX 3500, Quadro FX 1500, Quadro FX 4500 X2, GeForce 6150, GeForce 6150 LE, GeForce 6100, GeForce Go 6150, Quadro NVS 210S / NVIDIA GeForce 6150LE, GeForce Go 6100, GeForce 6150SE, GeForce 6100 nForce 405, GeForce 6100 nForce 400, GeForce 6100 nForce 420, GeForce 7150M / nForce 630M, GeForce 7000M / nForce 610M, GeForce 7050 PV / nForce 630a, GeForce 7050 PV / nForce 630a, GeForce 7025 / nForce 630a, GeForce 8800 GTX, GeForce 8800 GTS, GeForce 8800 Ultra, Quadro FX 5600, Quadro FX 4600, GeForce 8600 GTS, GeForce 8600 GT, GeForce 8600 GT, GeForce 8600 GS, GeForce 8400 GS, GeForce 9500M GS, GeForce 8600M GT, GeForce 9650M GS, GeForce 8700M GT, Quadro FX 370, Quadro NVS 320M, Quadro FX 570M, Quadro FX 1600M, Quadro FX 570, Quadro FX 1700, GeForce 8400 SE, GeForce 8500 GT, GeForce 8400 GS, GeForce 8300 GS, GeForce 8400 GS, GeForce 8600M GS, GeForce 8400M GT, GeForce 8400M GS, GeForce 8400M G, Quadro NVS 140M, Quadro NVS 130M, Quadro NVS 135M, GeForce 9400 GT, Quadro FX 360M, GeForce 9300M G, Quadro NVS 290, GeForce GTX 295, GeForce GTX 280, GeForce GTX 260, GeForce GTX 285, GeForce GTX 275, GeForce GTX 295, Quadro CX, Quadro FX 5800, Quadro FX 4800, Quadro FX 3800, GeForce 8800 GTS 512, GeForce 9800 GT, GeForce 8800 GT, GeForce 9800 GX2, GeForce 9800 GT, GeForce 8800 GS, GeForce GTS 240, GeForce 9800M GTX, GeForce 8800M GTS, GeForce GTX 280M, GeForce 9800M GT, GeForce 8800M GTX, GeForce 8800 GS, GeForce 9600 GSO, GeForce 8800 GT, GeForce 9800 GTX, GeForce 9800 GTX+, GeForce 9800 GT, GeForce GTS 250, GeForce 9800M GTX, GeForce GTX 260M, Quadro FX 3700, Quadro FX 3600M, Quadro FX 2800M, Quadro FX 3700M, Quadro FX 3800M, GeForce 9600 GT, GeForce 9600 GS, GeForce 9600 GSO 512, GeForce GT 130, GeForce GT 140, GeForce 9800M GTS, GeForce 9700M GTS, GeForce 9800M GS, GeForce 9800M GTS, Quadro FX 1800, Quadro FX 2700M, GeForce 9500 GT, GeForce 9400 GT, GeForce 9500 GT, GeForce 9500 GS, GeForce GT 120, GeForce 9600M GT, GeForce 9600M GS, GeForce 9600M GT, GeForce 9700M GT, GeForce 9500M G, GeForce 9650M GT, GeForce GT 130M, GeForce 9500 GT, Quadro FX 380, Quadro FX 580, Quadro FX 1700M, Quadro FX 770M, GeForce 9300 GE, GeForce 9300 GS, GeForce 8400 GS, GeForce 9300M GS, GeForce G100, GeForce 9200M GS, GeForce 9300M GS, Quadro NVS 150M, Quadro NVS 160M, GeForce G 105M, GeForce G 103M, Quadro NVS 420, Quadro FX 370 LP, Quadro NVS 450, Quadro NVS 295, GeForce 9100, GeForce 8300, GeForce 8200, nForce 730a, GeForce 9200, nForce 980a/780a SLI, nForce 750a SLI, GeForce 8100 / nForce 720a, GeForce 9100M G, GeForce 8200M G, GeForce 9400, GeForce 9400M G, GeForce 9400M, GeForce 9300 / nForce 730i, GeForce G102M, GeForce G102M, GeForce 9400, ION, ION LE, GeForce GT 220, GeForce 210, GeForce GT 230M, GeForce GT 240M, GeForce G210, GeForce 205, GeForce 310, GeForce 210, GeForce 310, GeForce G210M, Quadro FX 380 LP, GeForce GT 240, GeForce GTS 260M, GeForce GTS 250M (II) Primary Device is: PCI 01@00:00:0 (--) NV: Found NVIDIA Quadro FX 550 at 01@00:00:0 (II) Loading sub module "int10" (II) LoadModule: "int10" (II) Loading /usr/lib/xorg/modules/libint10.so (II) Module int10: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.0.0 ABI class: X.Org Video Driver, version 6.0 (II) NV(0): Initializing int10 (II) NV(0): Primary V_BIOS segment is: 0xc000 (--) NV(0): Chipset: "Quadro FX 550" (**) NV(0): Depth 24, (--) framebuffer bpp 32 (==) NV(0): RGB weight 888 (==) NV(0): Default visual is TrueColor (II) Loading sub module "vgahw" (II) LoadModule: "vgahw" (II) Loading /usr/lib/xorg/modules/libvgahw.so (II) Module vgahw: vendor="X.Org Foundation" compiled for 1.7.7, module version = 0.1.0 ABI class: X.Org Video Driver, version 6.0 (==) NV(0): Using HW cursor (--) NV(0): Linear framebuffer at 0xD8000000 (--) NV(0): MMIO registers at 0xE8000000 (II) Loading sub module "i2c" (II) LoadModule: "i2c" (II) Module "i2c" already built-in (II) Loading sub module "ddc" (II) LoadModule: "ddc" (II) Module "ddc" already built-in (II) NV(0): I2C bus "DDC" initialized. (II) NV(0): Probing for analog device on output A... (--) NV(0): ...can't find one (II) NV(0): Probing for analog device on output B... (--) NV(0): ...can't find one (II) NV(0): Probing for EDID on I2C bus A... (II) NV(0): I2C device "DDC:ddc2" registered at address 0xA0. (II) NV(0): ... none found (II) NV(0): Probing for EDID on I2C bus B... (II) NV(0): ... none found (II) NV(0): Unable to detect display type... (==) NV(0): ...Using default of CRT (II) NV(0): Unable to detect which CRTCNumber... (==) NV(0): ...Defaulting to CRTCNumber 0 (II) NV(0): Using CRT on CRTC 0 (--) NV(0): VideoRAM: 131072 kBytes (==) NV(0): Using gamma correction (1.0, 1.0, 1.0) (II) NV(0): Monitor0: Using hsync range of 30.00-75.00 kHz (II) NV(0): Monitor0: Using vrefresh range of 55.00-70.00 Hz (II) NV(0): Clock range: 12.00 to 400.00 MHz (II) NV(0): Not using default mode "640x350" (vrefresh out of range) (II) NV(0): Not using default mode "320x175" (vrefresh out of range) (II) NV(0): Not using default mode "640x400" (vrefresh out of range) (II) NV(0): Not using default mode "320x200" (vrefresh out of range) (II) NV(0): Not using default mode "720x400" (vrefresh out of range) (II) NV(0): Not using default mode "360x200" (vrefresh out of range) (II) NV(0): Not using default mode "640x480" (vrefresh out of range) (II) NV(0): Not using default mode "320x240" (vrefresh out of range) (II) NV(0): Not using default mode "640x480" (vrefresh out of range) (II) NV(0): Not using default mode "320x240" (vrefresh out of range) (II) NV(0): Not using default mode "640x480" (vrefresh out of range) (II) NV(0): Not using default mode "320x240" (vrefresh out of range) (II) NV(0): Not using default mode "800x600" (vrefresh out of range) (II) NV(0): Not using default mode "400x300" (vrefresh out of range) (II) NV(0): Not using default mode "800x600" (vrefresh out of range) (II) NV(0): Not using default mode "400x300" (vrefresh out of range) (II) NV(0): Not using default mode "800x600" (vrefresh out of range) (II) NV(0): Not using default mode "400x300" (vrefresh out of range) (II) NV(0): Not using default mode "1024x768" (vrefresh out of range) (II) NV(0): Not using default mode "512x384" (vrefresh out of range) (II) NV(0): Not using default mode "1024x768" (vrefresh out of range) (II) NV(0): Not using default mode "512x384" (vrefresh out of range) (II) NV(0): Not using default mode "1024x768" (vrefresh out of range) (II) NV(0): Not using default mode "512x384" (vrefresh out of range) (II) NV(0): Not using default mode "1152x864" (vrefresh out of range) (II) NV(0): Not using default mode "576x432" (vrefresh out of range) (II) NV(0): Not using default mode "1280x960" (hsync out of range) (II) NV(0): Not using default mode "640x480" (hsync out of range) (II) NV(0): Not using default mode "1280x1024" (hsync out of range) (II) NV(0): Not using default mode "640x512" (hsync out of range) (II) NV(0): Not using default mode "1280x1024" (hsync out of range) (II) NV(0): Not using default mode "640x512" (hsync out of range) (II) NV(0): Not using default mode "1600x1200" (hsync out of range) (II) NV(0): Not using default mode "800x600" (hsync out of range) (II) NV(0): Not using default mode "1600x1200" (hsync out of range) (II) NV(0): Not using default mode "800x600" (hsync out of range) (II) NV(0): Not using default mode "1600x1200" (hsync out of range) (II) NV(0): Not using default mode "800x600" (hsync out of range) (II) NV(0): Not using default mode "1600x1200" (hsync out of range) (II) NV(0): Not using default mode "800x600" (hsync out of range) (II) NV(0): Not using default mode "1792x1344" (hsync out of range) (II) NV(0): Not using default mode "896x672" (hsync out of range) (II) NV(0): Not using default mode "1792x1344" (hsync out of range) (II) NV(0): Not using default mode "896x672" (hsync out of range) (II) NV(0): Not using default mode "1856x1392" (hsync out of range) (II) NV(0): Not using default mode "928x696" (hsync out of range) (II) NV(0): Not using default mode "1856x1392" (hsync out of range) (II) NV(0): Not using default mode "928x696" (hsync out of range) (II) NV(0): Not using default mode "1920x1440" (hsync out of range) (II) NV(0): Not using default mode "960x720" (hsync out of range) (II) NV(0): Not using default mode "1920x1440" (hsync out of range) (II) NV(0): Not using default mode "960x720" (hsync out of range) (II) NV(0): Not using default mode "832x624" (vrefresh out of range) (II) NV(0): Not using default mode "416x312" (vrefresh out of range) (II) NV(0): Not using default mode "1152x864" (vrefresh out of range) (II) NV(0): Not using default mode "576x432" (vrefresh out of range) (II) NV(0): Not using default mode "1152x864" (hsync out of range) (II) NV(0): Not using default mode "576x432" (hsync out of range) (II) NV(0): Not using default mode "1152x864" (hsync out of range) (II) NV(0): Not using default mode "576x432" (hsync out of range) (II) NV(0): Not using default mode "1152x864" (hsync out of range) (II) NV(0): Not using default mode "576x432" (hsync out of range) (II) NV(0): Not using default mode "1360x768" (monitor doesn't support reduced blanking) (II) NV(0): Not using default mode "1400x1050" (hsync out of range) (II) NV(0): Not using default mode "700x525" (hsync out of range) (II) NV(0): Not using default mode "1400x1050" (hsync out of range) (II) NV(0): Not using default mode "700x525" (hsync out of range) (II) NV(0): Not using default mode "1400x1050" (hsync out of range) (II) NV(0): Not using default mode "700x525" (hsync out of range) (II) NV(0): Not using default mode "1680x1050" (monitor doesn't support reduced blanking) (II) NV(0): Not using default mode "1680x1050" (hsync out of range) (II) NV(0): Not using default mode "840x525" (hsync out of range) (II) NV(0): Not using default mode "1680x1050" (hsync out of range) (II) NV(0): Not using default mode "840x525" (hsync out of range) (II) NV(0): Not using default mode "1680x1050" (hsync out of range) (II) NV(0): Not using default mode "840x525" (hsync out of range) (II) NV(0): Not using default mode "1920x1080" (monitor doesn't support reduced blanking) (II) NV(0): Not using default mode "1920x1200" (monitor doesn't support reduced blanking) (II) NV(0): Not using default mode "1920x1440" (hsync out of range) (II) NV(0): Not using default mode "960x720" (hsync out of range) (II) NV(0): Not using default mode "2048x1536" (hsync out of range) (II) NV(0): Not using default mode "1024x768" (hsync out of range) (II) NV(0): Not using default mode "2048x1536" (hsync out of range) (II) NV(0): Not using default mode "1024x768" (hsync out of range) (II) NV(0): Not using default mode "2048x1536" (hsync out of range) (II) NV(0): Not using default mode "1024x768" (hsync out of range) (II) NV(0): Not using default mode "1600x1200" (width too large for virtual size) (II) NV(0): Not using default mode "1680x1050" (width too large for virtual size) (II) NV(0): Not using default mode "1400x1050" (width too large for virtual size) (II) NV(0): Not using default mode "1280x1024" (width too large for virtual size) (II) NV(0): Not using default mode "1440x900" (width too large for virtual size) (II) NV(0): Not using default mode "1280x960" (width too large for virtual size) (II) NV(0): Not using default mode "1360x768" (width too large for virtual size) (II) NV(0): Not using default mode "1152x864" (width too large for virtual size) (II) NV(0): Not using default mode "1152x864" (width too large for virtual size) (--) NV(0): Virtual size is 1024x768 (pitch 1024) (**) NV(0): *Default mode "1024x768": 75.0 MHz, 56.5 kHz, 70.1 Hz (II) NV(0): Modeline "1024x768"x70.1 75.00 1024 1048 1184 1328 768 771 777 806 -hsync -vsync (56.5 kHz) (**) NV(0): *Default mode "800x600": 40.0 MHz, 37.9 kHz, 60.3 Hz (II) NV(0): Modeline "800x600"x60.3 40.00 800 840 968 1056 600 601 605 628 +hsync +vsync (37.9 kHz) (**) NV(0): Default mode "1024x768": 65.0 MHz, 48.4 kHz, 60.0 Hz (II) NV(0): Modeline "1024x768"x60.0 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync (48.4 kHz) (**) NV(0): Default mode "800x600": 81.0 MHz, 75.0 kHz, 60.0 Hz (D) (II) NV(0): Modeline "800x600"x60.0 81.00 800 832 928 1080 600 600 602 625 doublescan +hsync +vsync (75.0 kHz) (**) NV(0): Default mode "800x600": 36.0 MHz, 35.2 kHz, 56.2 Hz (II) NV(0): Modeline "800x600"x56.2 36.00 800 824 896 1024 600 601 603 625 +hsync +vsync (35.2 kHz) (**) NV(0): Default mode "840x525": 73.1 MHz, 65.3 kHz, 60.0 Hz (D) (II) NV(0): Modeline "840x525"x60.0 73.12 840 892 980 1120 525 526 529 544 doublescan -hsync +vsync (65.3 kHz) (**) NV(0): Default mode "700x525": 61.0 MHz, 64.9 kHz, 60.0 Hz (D) (II) NV(0): Modeline "700x525"x60.0 61.00 700 744 820 940 525 526 532 541 doublescan +hsync +vsync (64.9 kHz) (**) NV(0): Default mode "640x512": 54.0 MHz, 64.0 kHz, 60.0 Hz (D) (II) NV(0): Modeline "640x512"x60.0 54.00 640 664 720 844 512 512 514 533 doublescan +hsync +vsync (64.0 kHz) (**) NV(0): Default mode "720x450": 53.2 MHz, 55.9 kHz, 59.9 Hz (D) (II) NV(0): Modeline "720x450"x59.9 53.25 720 760 836 952 450 451 454 467 doublescan -hsync +vsync (55.9 kHz) (**) NV(0): Default mode "640x480": 54.0 MHz, 60.0 kHz, 60.0 Hz (D) (II) NV(0): Modeline "640x480"x60.0 54.00 640 688 744 900 480 480 482 500 doublescan +hsync +vsync (60.0 kHz) (**) NV(0): Default mode "640x480": 25.2 MHz, 31.5 kHz, 59.9 Hz (II) NV(0): Modeline "640x480"x59.9 25.18 640 656 752 800 480 490 492 525 -hsync -vsync (31.5 kHz) (**) NV(0): Default mode "680x384": 36.0 MHz, 47.4 kHz, 60.0 Hz (D) (II) NV(0): Modeline "680x384"x60.0 36.00 680 704 720 760 384 385 390 395 doublescan +hsync -vsync (47.4 kHz) (**) NV(0): Default mode "680x384": 42.4 MHz, 47.7 kHz, 59.8 Hz (D) (II) NV(0): Modeline "680x384"x59.8 42.38 680 716 784 888 384 385 390 399 doublescan -hsync +vsync (47.7 kHz) (**) NV(0): Default mode "576x432": 48.4 MHz, 63.0 kHz, 70.0 Hz (D) (II) NV(0): Modeline "576x432"x70.0 48.38 576 612 672 768 432 432 434 450 doublescan -hsync +vsync (63.0 kHz) (**) NV(0): Default mode "576x432": 40.8 MHz, 53.7 kHz, 60.1 Hz (D) (II) NV(0): Modeline "576x432"x60.1 40.81 576 608 668 760 432 432 434 447 doublescan -hsync +vsync (53.7 kHz) (**) NV(0): Default mode "512x384": 37.5 MHz, 56.5 kHz, 70.1 Hz (D) (II) NV(0): Modeline "512x384"x70.1 37.50 512 524 592 664 384 385 388 403 doublescan -hsync -vsync (56.5 kHz) (**) NV(0): Default mode "512x384": 32.5 MHz, 48.4 kHz, 60.0 Hz (D) (II) NV(0): Modeline "512x384"x60.0 32.50 512 524 592 672 384 385 388 403 doublescan -hsync -vsync (48.4 kHz) (**) NV(0): Default mode "400x300": 20.0 MHz, 37.9 kHz, 60.3 Hz (D) (II) NV(0): Modeline "400x300"x60.3 20.00 400 420 484 528 300 300 302 314 doublescan +hsync +vsync (37.9 kHz) (**) NV(0): Default mode "400x300": 18.0 MHz, 35.2 kHz, 56.3 Hz (D) (II) NV(0): Modeline "400x300"x56.3 18.00 400 412 448 512 300 300 301 312 doublescan +hsync +vsync (35.2 kHz) (**) NV(0): Default mode "320x240": 12.6 MHz, 31.5 kHz, 60.1 Hz (D) (II) NV(0): Modeline "320x240"x60.1 12.59 320 328 376 400 240 245 246 262 doublescan -hsync -vsync (31.5 kHz) (++) NV(0): DPI set to (96, 96) (II) Loading sub module "fb" (II) LoadModule: "fb" (II) Loading /usr/lib/xorg/modules/libfb.so (II) Module fb: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.0.0 ABI class: X.Org ANSI C Emulation, version 0.4 (II) Loading sub module "xaa" (II) LoadModule: "xaa" (II) Loading /usr/lib/xorg/modules/libxaa.so (II) Module xaa: vendor="X.Org Foundation" compiled for 1.7.7, module version = 1.2.1 ABI class: X.Org Video Driver, version 6.0 (II) Loading sub module "ramdac" (II) LoadModule: "ramdac" (II) Module "ramdac" already built-in (--) Depth 24 pixmap format is 32 bpp (**) NV(0): Option "XaaNoOffscreenPixmaps" "true" (II) NV(0): Using XFree86 Acceleration Architecture (XAA) Screen to screen bit blits Solid filled rectangles 8x8 mono pattern filled rectangles Indirect CPU to Screen color expansion Solid Lines Scanline Image Writes Setting up tile and stipple cache: 32 128x128 slots 32 256x256 slots 16 512x512 slots (==) NV(0): Backing store disabled (==) NV(0): Silken mouse enabled (**) NV(0): DPMS enabled (WW) NV(0): Option "UseInternalAGPGART" is not used (WW) NV(0): Option "DmaMode" is not used (WW) NV(0): Option "CursorShadow" is not used (WW) NV(0): Option "CursorShadowAlpha" is not used (WW) NV(0): Option "CursorShadowYOffset" is not used (WW) NV(0): Option "CursorShadowXOffset" is not used (WW) NV(0): Option "FlatPanelProperties" is not used (WW) NV(0): Option "NoLogo" is not used (WW) NV(0): Option "UseEDID" is not used (WW) NV(0): Option "AddARGBGLXVisuals" is not used (WW) NV(0): Option "RenderAccel" is not used (WW) NV(0): Option "AllowGLXWithComposite" is not used (WW) NV(0): Option "TwinView" is not used (WW) NV(0): Option "SecondMonitorVendorName" is not used (WW) NV(0): Option "SecondMonitorModelName" is not used (WW) NV(0): Option "SecondMonitorHorizSync" is not used (WW) NV(0): Option "SecondMonitorVertRefresh" is not used (WW) NV(0): Option "TwinViewOrientation" is not used (WW) NV(0): Option "ConnectedMonitor" is not used (==) RandR enabled (II) Initializing built-in extension Generic Event Extension (II) Initializing built-in extension SHAPE (II) Initializing built-in extension MIT-SHM (II) Initializing built-in extension XInputExtension (II) Initializing built-in extension XTEST (II) Initializing built-in extension BIG-REQUESTS (II) Initializing built-in extension SYNC (II) Initializing built-in extension XKEYBOARD (II) Initializing built-in extension XC-MISC (II) Initializing built-in extension SECURITY (II) Initializing built-in extension XINERAMA (II) Initializing built-in extension XFIXES (II) Initializing built-in extension RENDER (II) Initializing built-in extension RANDR (II) Initializing built-in extension COMPOSITE (II) Initializing built-in extension DAMAGE SELinux: Disabled on system, not enabling in X server (II) AIGLX: Screen 0 is not DRI2 capable (II) AIGLX: Screen 0 is not DRI capable (II) AIGLX: Loaded and initialized /usr/lib/dri/swrast_dri.so (II) GLX: Initialized DRISWRAST GL provider for screen 0 (II) config/udev: Adding input device Power Button (/dev/input/event2) (**) Power Button: Applying InputClass "evdev keyboard catchall" (II) LoadModule: "evdev" (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so (II) Module evdev: vendor="X.Org Foundation" compiled for 1.7.6.901, module version = 2.3.2 Module class: X.Org XInput Driver ABI class: X.Org XInput driver, version 7.0 (**) Power Button: always reports core events (**) Power Button: Device: "/dev/input/event2" (II) Power Button: Found keys (II) Power Button: Configuring as keyboard (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD) (**) Option "xkb_rules" "evdev" (**) Option "xkb_model" "pc105" (**) Option "xkb_layout" "us" (II) config/udev: Adding input device Power Button (/dev/input/event1) (**) Power Button: Applying InputClass "evdev keyboard catchall" (**) Power Button: always reports core events (**) Power Button: Device: "/dev/input/event1" (II) Power Button: Found keys (II) Power Button: Configuring as keyboard (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD) (**) Option "xkb_rules" "evdev" (**) Option "xkb_model" "pc105" (**) Option "xkb_layout" "us" (II) config/udev: Adding input device HDA Intel Line In at Ext Rear Jack (/dev/input/event5) (II) No input driver/identifier specified (ignoring) (II) config/udev: Adding input device HDA Intel Mic at Ext Front Jack (/dev/input/event6) (II) No input driver/identifier specified (ignoring) (II) config/udev: Adding input device HDA Intel Line Out at Ext Rear Jack (/dev/input/event7) (II) No input driver/identifier specified (ignoring) (II) config/udev: Adding input device HDA Intel HP Out at Ext Front Jack (/dev/input/event8) (II) No input driver/identifier specified (ignoring) (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0) (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall" (**) AT Translated Set 2 keyboard: always reports core events (**) AT Translated Set 2 keyboard: Device: "/dev/input/event0" (II) AT Translated Set 2 keyboard: Found keys (II) AT Translated Set 2 keyboard: Configuring as keyboard (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD) (**) Option "xkb_rules" "evdev" (**) Option "xkb_model" "pc105" (**) Option "xkb_layout" "us" (II) config/udev: Adding input device ImPS/2 Logitech Wheel Mouse (/dev/input/event4) (**) ImPS/2 Logitech Wheel Mouse: Applying InputClass "evdev pointer catchall" (**) ImPS/2 Logitech Wheel Mouse: always reports core events (**) ImPS/2 Logitech Wheel Mouse: Device: "/dev/input/event4" (II) ImPS/2 Logitech Wheel Mouse: Found 3 mouse buttons (II) ImPS/2 Logitech Wheel Mouse: Found scroll wheel(s) (II) ImPS/2 Logitech Wheel Mouse: Found relative axes (II) ImPS/2 Logitech Wheel Mouse: Found x and y relative axes (II) ImPS/2 Logitech Wheel Mouse: Configuring as mouse (**) ImPS/2 Logitech Wheel Mouse: YAxisMapping: buttons 4 and 5 (**) ImPS/2 Logitech Wheel Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200 (II) XINPUT: Adding extended input device "ImPS/2 Logitech Wheel Mouse" (type: MOUSE) (II) ImPS/2 Logitech Wheel Mouse: initialized for relative axes. (II) config/udev: Adding input device ImPS/2 Logitech Wheel Mouse (/dev/input/mouse0) (II) No input driver/identifier specified (ignoring) (II) config/udev: Adding input device PC Speaker (/dev/input/event3) (II) No input driver/identifier specified (ignoring) (II) config/udev: Adding input device ACPI Virtual Keyboard Device (/dev/input/event9) (**) ACPI Virtual Keyboard Device: Applying InputClass "evdev keyboard catchall" (**) ACPI Virtual Keyboard Device: always reports core events (**) ACPI Virtual Keyboard Device: Device: "/dev/input/event9" (II) ACPI Virtual Keyboard Device: Found keys (II) ACPI Virtual Keyboard Device: Configuring as keyboard (II) XINPUT: Adding extended input device "ACPI Virtual Keyboard Device" (type: KEYBOARD) (**) Option "xkb_rules" "evdev" (**) Option "xkb_model" "pc105" (**) Option "xkb_layout" "us" *** ** Also, at some point on some website, I believe it was the libfreekinect directions I was told to create this file and contents: vi /etc/udev/rules.d/51-kinect.rules # ATTR{product}=="Xbox NUI Motor" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666" # ATTR{product}=="Xbox NUI Audio" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666" # ATTR{product}=="Xbox NUI Camera" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666" #startx -- :2 *** install a bakup-of-the-bakup window managers: icewm wm2 xfce4 lxde apt-get install ; apt-get install -y -f wm2 -f -y --force-yes apt-get install ; apt-get install -y -f icewm -f -y --force-yes apt-get install ; apt-get install -y -f icewm-themes -f -y --force-yes apt-get install ; apt-get install -y -f xfce4 -f -y --force-yes rsync -Ha /home/root/.dillo ~/ rsync -Ha /home/root/.icewm ~/ rsync -Ha /home/root/.xmonad ~/ *Bakup browsers apt-get install -y -f lynx-curl ; lynx google.com apt-get install -y -f elinks ; apt-get install -y -f elinks-doc ; elinks google.com apt-get install -y -f galeon ----won't install and work---10Sep10 apt-get install -y -f w3mmee ; apt-get install -y -f w3m-el-snapshot ; w3mmee http://packages.debian.org/search?keywords=w3m-el-snapshot **** To run icewm instead of others just open the menu at the main flashy login page and choose it! *** Need encryption/decryption tools apt-get install -f -y --force-yes mcrypt *** Another bakup window manager will be xmonad apt-get install -y -f xmonad apt-get install -y -f libghc6-xmonad-dev apt-get install -y -f libghc6-xmonad-contrib-dev apt-get install -y -f darcs apt-get install -y -f dwm-tools apt-get install -y -f dzen2 mkdir /.darcs ; cd /.darcs ; darcs get http://code.haskell.org/xmonad ; darcs get http://code.haskell.org/XMonadContrib **** This may be necessary!? (if apt-get doesn't set up a file in /usr/share/xsessions): cp /xmonad.desktop /usr/share/xsessions **** may have to change this line (to wherever apt-get put the executable): Exec=/usr/local/bin/xmonad **** launching a terminal in xmonad with mod-shift-return ***** See http://haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen's_Configuration **PRE-PRE-STEP 1. Always give main user sudo powers: ***Type "visudo" and make the file look like this: # sudoers file. # # This file MUST be edited with the "visudo" command as root. # # See the man page for details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL %users ALL=NOPASSWD:/usr/bin/apt-get -s upgrade nnnnn ALL =NOPASSWD: ALL **PRE-PRE-STEP 1. Always have something like this /etc/apt/sources.list in place # See sources.list(5) for more information # This file should be edited through synaptic # MEPIS improvements, overrides and updates--the MEPIS magic deb ftp://ftp.mepis.com/mepis/ mepis-8.0 main deb ftp://ftp.debian.org/debian/ lenny main contrib non-free # deb-src ftp://ftp.debian.org/debian/ lenny main contrib non-free deb http://security.debian.org/ lenny/updates main contrib non-free # deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free # Some Debian Multimedia software might be illegal in some jurisdictions deb http://www.debian-multimedia.org lenny main # Some extra packages that are maintained by the MEPIS Community # deb http://mepis.blue-pearls.net/repo/ mepis8cr main non-free deb http://emacs.orebokech.com lenny main deb-src http://emacs.orebokech.com lenny main #apt-get update && apt-get install swiftfox-prescott deb http://getswiftfox.com/builds/debian unstable non-free deb http://dl.gna.org/darius-tools/ ./ **PRE-STEP 1. May need reset root password by booting a "rescue cd" [often why you install a new operating system--to rescue old one]: Get a command prompt from rescue cd or thumb drive and type: mkdir /mnt/system;mount /dev/sda1 /mnt/system;chroot /mnt/system;passwd ---or when booting GRUB select the system to be booted and add "1" to the end of the kernel boot command [to boot single user mode--ie "init 1"] and then use the "passwd" command **STEP 1. use knoppix and/or mepis-live to move alles on root drive to /home--move old /home to /home/home--easy emacs dired mv **STEP 2. install mepis and allow mepis to leave /home alone && cp /home/* / [after install] ***mkdir /.w && cp /djia-ndia-spia_added-forms.sc /.w/djia-ndia-spia_added-forms.sc ------since "/.w/djia-ndia-spia_added-forms.sc" will be a "_dev" development file but /djia-ndia-spia_added-forms.sc (and all other files/dirs on "/.") will be "canonical"/best-files/best-template-files ****Make sure all other files used/needed by "/top-blah" program files are in "/.w"! *For a desktop computer that you want to play/view/run the most number of possible file formats read and/or "do" this page top to bottom: https://help.ubuntu.com/community/Medibuntu *General install notes and bare minimum "apt-get install" and config notes made JAN2010: 1a. apt-get install ; apt-get install google-chrome -f -y --force-yes 1b. set download directory in google-chrome to /tmp 1c. need to flash alerts self about installing things, etc.: apt-get install -y -f xosd-bin * to run google chrome as root Inbox x Philosophy x brian powell briangpowellms@gmail.com May 3 to undisclosed recipients Go to terminal. Type:- 1- gedit /usr/bin/google-chrome 2- Gedit window will popup. In the end line with a space write :- --user-data-dir and click save. ----so the last line in the /usr/bin/google-chrome file should look like: exec -a "$0" "$HERE/chrome" "$@" --user-data-dir 1. put the new distro/.iso cdrom in and reboot 2. CtrlAltF1 and login as root, password is of course r..t 3. mount /dev/hda1 3.5 move all dirs like /home/usr /home/etc to some old bakup dir like /home/home_7JAN10 4. mkdir /mnt/hda1/home/home_7JAN10 5. mv /* /mnt/hda1/home/home_7JAN10 6. Install mepis--use the "Do not delete /home" option; don't install any of the frap they suggest and otherwise use every default that they provide and of course use a reiserfs filesystem! 7. boot the new mepis without the cdrom 8. CtrlAltF1 and login as root and use the new password you created of course 9. mv /home/home_7JAN10/* / 9a. Turn off the annoying system bell notifications 10b. use vi to merge the old /home/home_7JAN10/etc/apt/sources.list with the new /etc/apt/sources.list; comment out all the old "unstable"/cutting-edge/experimental sites (for now) apt-get install ; apt-get install aptitude -f -y --force-yes apt-get install ; apt-get install ept-cache -f -y --force-yes apt-get install ; apt-get install wajig -f -y --force-yes # gpg --keyserver subkeys.pgp.net --recv-keys 0x09C5B094 # gpg --export --armor 0x09C5B094 | sudo apt-key add - 11. apt-get install ; apt-get install emacs21 -f -y --force-yes 14. apt-get install ; apt-get install emacs22 -f -y --force-yes echo "deb http://emacs.orebokech.com sid main" >> /etc/apt/sources.list echo "deb-src http://emacs.orebokech.com sid main" >> /etc/apt/sources.list 15. apt-get install ; apt-get install emacs23 -f -y --force-yes 15. /orgmode --if this boots up then you should be "good to go"! 11. Other useful things I did to get "/mepis21" working/everything functioning a little: Click on the mepis icon on tool bar at bottom/in the lower left hand corner and left click on "system settings"->Window behavior...etc. see all old notes on setting up kde(in this file)---most option choices should still apply--especially: "system settings"->Window behavior->FocusStrictlyUnderMouse and Raise with delay: 0 ms!! apt-get install -y -f cat /uu #cp /home/usr/bin/yahooquote /usr/bin apt-get install ; apt-get install libfinance-yahooquote-perl -f -y --force-yes rsync -Hab --no-perms --chmod u+rwx /home/root/u / rsync -Ha /mnt/sdb1/usr/share/perl5 /usr/share || rsync -Ha /home/usr/share/perl5/Finance /usr/share/perl5 #mv /home/etc/kde3 /etc #mv /home/usr/local/share/uzbl /usr/local/share rsync -Ha /home/root/.config/uzbl /root/.config #rsync -Ha /home/root/.kde/share/apps/kdesktop /root/.kde/share/apps rsync -Ha /home/etc/apache2/httpd.conf /etc/apache2 rsync -Ha /home/etc/apache2 /etc rsync -Ha /home/mnt/sda2/debs-huge /mnt/sda2 rsync -Ha /home/mnt/sda2/* /mnt/sda2 rsync -Ha /home/usr/lib/cgi-bin /usr/lib rsync -Ha /home/var/www /var Turn the volume all the way down and do: /oo-emacro-mpg apt-get install ; apt-get install libtiff-doc -f -y --force-yes apt-get install ; apt-get install feh -f -y --force-yes apt-get install ; apt-get install geeqie -f -y --force-yes apt-get install ; apt-get install libexiv2-dev apt-get install ; apt-get install gifsicle -f -y --force-yes apt-get install ; apt-get install gimp -f -y --force-yes apt-get install ; apt-get install xpaint -f -y --force-yes apt-get install ; apt-get install netpbm -f -y --force-yes apt-get install ; apt-get install imagemagick -f -y --force-yes apt-get install ; apt-get install libmagickcore3-extra -f -y --force-yes apt-get install ; apt-get install ufraw-batch -f -y --force-yes #cp /lib_old-libs/libpng.so.2 /lib #cp /lib_old-libs/libtiff.so.3 /lib apt-get install ; apt-get install emacs-goodies-el -f -y --force-yes Test this out/get this working: /oo-emacro Also, need these: apt-get install ; apt-get install sshpass -f -y --force-yes apt-get install ; apt-get install sshfs -f -y --force-yes apt-get install ; apt-get install wine -f -y --force-yes rsync -Ha /home/root/.wine /root ** DirectX helps with making GoogleEarth faster--according to google--this automagically installs DirectX: playonlinux apt-get install ; apt-get install playonlinux -f -y --force-yes dpkg -i /home/google-earth/google-earth-stable-555blah.deb # * Old way I used to install googleearth # 15. set up googleearth: Download GoogleEarthLinux.bin to /debs-new/GoogleEarthLinux.bin # chmod 700 /debs-new/GoogleEarthLinux.bin # mkdir /GoogleEarthLinuxDir ; /debs-new/GoogleEarthLinux.bin --target /GoogleEarthLinuxDir # cd /opt/google-earth/ # mv libstdc++.so.6 libstdc++.so.6.orig # mv libgcc_s.so.1 libgcc_s.so.1.orig # /opt/google-earth/googleearth # --Test by doing: /opt/google-earth/googleearth apt-get install ; apt-get install feh -f -y --force-yes pre 12. run /mepis21 (which automounts "n" etc.) until it boots in all its full glory (i.e. all the directories and files required by .direds-media.el are in place. 12. use vi to merge the old /home/home_7JAN10/etc/hosts with the new /etc/hosts (remember that /etc/hosts" for one machine can be/ought to be very different from another---so make and use a lot of different ones like: /etc/hosts_nnnnn /etc/hosts_ttttt Use iptraf to hardwire ipaddresses to important/security-important sites like your bank: aptitude install iptraf 12. Lastly, need this of course!: cp -f /root_mepis_dell-precision/bashrc /root/.bashrc 12b. insure unneeded network services are @not@ installed: sshd etc.---put nothing on until there is a very good reason! 12b1. Get telnet though---to send mail and use with "expect" etc. apt-get install -y -f tcllib apt-get install -y -f tcl-tls apt-get install -y -f expect apt-get install -y -f telnet apt-get install -y -f retty apt-get install -y -f network-manager-kde 12b2. Set up outgoing mail (only) apt-get install -y -f ssmtp mv /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp_bak.conf mv /etc/ssmtp/revaliases /etc/ssmtp/revaliases_bak cp -f /e/ssmtp.conf /etc/ssmtp cp -f /e/revaliases /etc/ssmtp ** Then to send mail--"simple smtp" example: this worked!!: ssmtp briangpowellms@gmail.com ---Enter---then typed an example message----then hit "Cd" -----and/or something like this: echo "To set up outgoing email (for alerting anyone if anything is wrong on the spreadsheet created above: apt-get install -y -f ssmtp ; And then these: mv /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp_bak.conf ; mv /etc/ssmtp/revaliases /etc/ssmtp/revaliases_bak ; cp -f /e/ssmtp.conf /etc/ssmtp ; cp -f /e/revaliases /etc/ssmtp ---finally to send the alerts; example: Make a file like this call it alert.note: To: emailaddressofpersonswewantalerted@gmail.com \n From: myemailaddress@gmail.com \n Subject: alert an INODE is down, \nThe server is down! ---then of course have the alert logic/program/BASH/PERL/SC software do: ssmtp emailaddressofpersonswewantalerted@gmail.com < alert.note " 12b2.1 gotta do this!: cp /home/etc/crontab /etc ----and make sure this line is at the top: MAILTO="" ----otherwise mail will be sent to root about every little thang 12b3. echo "MultiDriver=true" >> /etc/kde3/kmixrc cat /etc/kde3/kmixrc **And/or echo "MultiDriver=true" >> /etc/kde4/kmixrc cat /etc/kde4/kmixrc 12c. move that friggin print screen to the F9 key!!: put this in 1-2-3 opsys setup: Regional&Assessibility->InputActions->PrintScreen->Keyboardshortcut->SelectKeyboardShortcut->F9 Inbox X 12d. install a bakup alternative shell "fish" apt-get install ; apt-get install fish -f -y --force-yes apt-get install ; apt-get install xsel -f -y --force-yes apt-get install ; apt-get install doc-base -f -y --force-yes 12e. May @want@ ** May need to do this if you decide to use "~/.kde/Autostart": apt-get install ; apt-get install kcontrol-autostart -f -y --force-yes 13. also apt-get install ; apt-get install kstart -f -y --force-yes apt-get install ; apt-get install emacs-snapshot-gtk -f -y --force-yes apt-get install ; apt-get install gnuplot -f -y --force-yes apt-get install ; apt-get install gnuplot-mode -f -y --force-yes apt-get install ; apt-get install engauge-digitizer -f -y --force-yes apt-get install ; apt-get install engauge-digitizer-doc -f -y --force-yes ln -s /usr/bin/emacs22-x /usr/bin/emacs22 rsync -Ha /home/root/.kde/share/apps/kdesktop /root/.kde/share/apps rsync -Ha /home/root/.vlc /root apt-get install ; apt-get install xpenguins -f -y --force-yes apt-get install ; apt-get install sc -f -y --force-yes rsync -Ha /home/usr/share/xpenguins/themes /usr/share/xpenguins rsync -Ha /home/root/.mozilla* /root 15b. cd /.cvs ; cvs upd 16. cd /.git ; git clone --depth 1 git://git.sv.gnu.org/emacs.git cd /.git/emacs git pull apt-get install -y -f aptitude aptitude install build-essential aptitude install xorg-dev aptitude install libgtk2.0-dev aptitude install libjpg-dev aptitude install libgif-dev aptitude install libtiff-dev aptitude install libm17n-dev aptitude install libpng12-dev aptitude install librsvg2-dev aptitude install libotf-dev cd /.git/emacs ./configure make bootstrap sudo make install 17. may have to do something like: rm /usr/local/share/emacs/23.1.50/lisp/org/org.elc --and then edit the /usr/local/share/emacs/23.1.50/lisp/org/org.el and insure this is in there--at the bottom is best of course: (setq org-confirm-elisp-link-function 'nil) 17a. aptitude install openoffice.org 18. need ConTeXt (especially texlive etc.) for orgmode: ** Taken from http://wiki.contextgarden.net/Debian_installation put this in sources.list: # for texlive deb http://people.debian.org/~preining/TeX/ tl2007/ deb-src http://people.debian.org/~preining/TeX/ src/ # for lmodern deb http://people.debian.org/~preining/TeX/ lmodern/ deb-src http://people.debian.org/~preining/TeX/ lmodern/ # for context deb http://people.debian.org/~preining/TeX/ context/ deb-src http://people.debian.org/~preining/TeX/ context/ # for tex-gyre deb http://people.debian.org/~preining/TeX/ tex-gyre/ deb-src http://people.debian.org/~preining/TeX/ tex-gyre/ *** Follow all directions at http://wiki.contextgarden.net/Debian_installation !! **** The above process suggests this too: aptitude install libxml-parser-perl *** Packages above don't seem to get configured/set up until this is done: aptitude install fontforge * This may work later on some other install: ln -s /usr/bin/emacs-snapshot-gtk /usr/bin/emacs23 **a working emacs23 may be installed using CVS so I tried: * Get source code from CVS. I did not select a specific branch, because, per the Emacs Wiki, both multi-tty and unicode-2 branches were merged into trunk. apt-get install ; apt-get install cvs -f -y --force-yes $ cd /.cvs $ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/cvsroot/emacs co emacs * Read the INSTALL and INSTALL.CVS files in /.cvs/emacs * Install prerequisites: apt-get install ; apt-get install build-essential -f -y --force-yes apt-get install ; apt-get install xorg-dev -f -y --force-yes apt-get install ; apt-get install libgtk2.0-dev -f -y --force-yes apt-get install ; apt-get install texinfo -f -y --force-yes apt-get install ; apt-get install pandoc -f -y --force-yes apt-get install ; apt-get install libjpeg-dev libgif-dev libtiff4-dev -f -y --force-yes apt-get install ; apt-get install libncurses5-dev -f -y --force-yes * Configure. The argument --prefix=/home/sofeng/lib/emacs-cvs means I am installing Emacs in /home/sofeng/lib/emacs-cvs. As of this writing, GTK (i.e. pretty window chrome) is configured by default. cd /.cvs/emacs ./configure --prefix=/home/sofeng/lib/emacs-cvs * Per the INSTALL.CVS file, I needed to do a make bootstrap instead of make because some files, such as byte-compiled lisp files are not stored in CVS. Note, this takes a long time (about 10 min for me). make bootstrap * Make (Optional) make * Test it (Optional) src/emacs -q * Install make install * Finally, I added ~/lib/emacs-cvs/bin to my PATH. ln -s /.cvs/emacs/src/emacs /usr/bin/emacs23 *Get KDE working/acceptable!!! **A few wayly kuul essentials: **cp /transparent-pixel.png /usr/share/icons; chmod 644 /usr/share/icons/transparent-pixel.png **ControlCenter: ***Desktop->... ***MultipleDesktops->NumberOfDesktops->2 ***MultipleDesktops->NumberOfDesktops->MouseWheelSwitchesDesktop ***Panels->[Go thru each tab] ***Desktop->Behavior->... ***Desktop->Behavior->FileIcons [click on all--all files should be viewable dammit!!] ***Desktop->Behavior->DeviceIcons [click on all--all devices should be viewable dammit!!] ***Desktop->WindowBehavior->... ***WindowBehavior->"TitleBar" [Turn off double-click on titlebar causes "shade"] ***WindowBehavior->Focus->Policy->FocusStrictlyUnderMouse ***WindowBehavior->Focus->AutoRaise ***WindowBehavior->Advanced->ActiveDesktopBorders->AlwaysEnabled ***WindowBehavior->Advanced->ActiveDesktopBorders->DesktopSwitchDelay->1000 msec ***WindowBehavior->Focus->AutoRaise->Delay->0 msec ***WindowBehavior->Focus->Navigation [All toggled on] ***WindowBehavior->Moving->WindowSnapZone->20 ***Apperance & Themes->... ***Background->CenterTiled,random dirs every 10 mins, ***Colors->DesertRed!!!!!! ***WindowDecorations->BorderWidth->0 ***WindowDecorations->TitleBarHeight->13 ***WindowDecorations->WindowDecoration->KDE 2 ***WindowDecorations->WindowDecoration->BorderSize->Normal ***WindowDecorations->WindowDecoration->DrawTitlebarStippleEffect [Toggled off] ***WindowDecorations->WindowDecoration->DrawGrabBarBelowWindow [Toggled off] ***WindowDecorations->WindowDecoration->DrawGradients [Toggled on] ***Fonts: Sans Serif 7 [For everygthing] **"Add Applet To Panel" [NOT "Add application to Panel"!!!!!!!!!] the SoundMixer application applet to the toolbar and put "/playlist-sd" on the 2nd desktop--so must readjust volume each time new tune/video plays **Konsole: ***Settings->Schema->WhiteOnBlack ***Settings->SaveAsDefault **Used to be (but try new ideas like use /stocks.org instead): Insure that "align icons to grid" is off and then do init 2 && cp /IconPositions ~/.kde/share/apps/kdesktop/IconPositions && init 5 ***Used to be (but try new ideas like use /stocks.org instead): cp /home/root/Desktop/*.desktop /root/Desktop **PRE-STEP 3.: apt-get install ; apt-get install emacs21 -f -y --force-yes apt-get install ; apt-get install emacs22 -f -y --force-yes apt-get install ; apt-get install emacs23 -f -y --force-yes || ln -s /.git/emacs/src/emacs /usr/bin/emacs23 ***If you accidentally deleted the /.blah-versioning system: ****See /bakup_blah.sh and reverse the usual bakup process! I.e. copy the .blah dirs from the linode/whatever-backup-site-or-drive!! ***Do all that is needed to bring up "/mepis21": apt-get install ; apt-get install xplanet -f -y --force-yes apt-get install ; apt-get install openssl -f -y --force-yes apt-get install ; apt-get install xplanet-images -f -y --force-yes apt-get install ; apt-get install xpenguins -f -y --force-yes ln -s /mnt/sdb1/.w / rsync -Habu /home/usr/share/xpenguins/themes /usr/share/xpenguins rsync -Habu /usr_share_xpenguins_themes/xpenguins/themes /usr/share/xpenguins find /usr/share/xpenguins **** UZBL browser install: Dependencies * git (for downloading) * pkgconfig (for Make/gcc) * libwebkit 1.1.4 or higher * libsoup 2.24 or higher (dep for webkit/gtk+) * gtk 2.14 or higher apt-get install git -f -y --force-yes apt-get install git-core -f -y --force-yes apt-get install -t unstable libwebkit-dev -f -y --force-yes apt-get install pkgconfig -f -y --force-yes apt-get install libwebkit -f -y --force-yes apt-get install libsoup -f -y --force-yes apt-get install gtk -f -y --force-yes Optional/Recommended The following tools are quite useful, and some of them are used in the sample scripts: * socat (for socket communication) * dmenu (with vertical patch) * zenity * bash * python (cookies.py) * perl (formfiller.pl) apt-get install socat -f -y --force-yes apt-get install dmenu -f -y --force-yes apt-get install zenity -f -y --force-yes apt-get install python -f -y --force-yes cd /.git git clone git://github.com/Dieterbe/uzbl.git [ $ git checkout origin/experimental ] # optional. see below cd uzbl make sudo make install **STEP 3. Before the next step may want to check "/etc/apt/sources.list" and insure that not too many confusing sites are used an 10:07 1cv2tex2doc-project_mak.makefile -rw------- 1 root root 13465 2009-07-15 10:07 1cv2tex2doc-project_mak.makefile~ drwx------ 11 root root 3680 2009-d try to draw from as few sites as possible--the .deb packages thru apt. ----apt-get these to get "/mepis21" working right [do this to comment out/in relevant dirs dired ought to be visiting a lot on this node/distro: emacs /root/n/n/lib/elisp/.direds-media.el]: ***Stub: apt-get install ; apt-get install -f -y --force-yes apt-get install ; apt-get install make -f -y --force-yes **** Compiling a dev branch of emacs: "configure: error: The following required libraries were not found: libXpm libgif/libungif ***** apt-cache search libtiff libtiff-doc - TIFF manipulation and conversion documentation libtiff-opengl - TIFF manipulation and conversion tools libtiff-tools - TIFF manipulation and conversion tools libtiff4 - Tag Image File Format (TIFF) library libtiff4-dev - Tag Image File Format library (TIFF), development files libtiffxx0c2 - Tag Image File Format (TIFF) library -- C++ interface pngtools - series of tools for PNG (Portable Network Graphics) images ***Using the stub and getting crucial packages: apt-get install ; apt-get install python-opengl -f -y --force-yes apt-get install ; apt-get install libgtkglext1 -f -y --force-yes apt-get install ; apt-get install brutalchess -f -y --force-yes apt-get install ; apt-get install gnuchess -f -y --force-yes apt-get install ; apt-get install xboard -f -y --force-yes apt-get install ; apt-get install dreamchess --force-yes apt-get install ; apt-get install crafty -f -y --force-yes apt-get install ; apt-get install glchess -f -y --force-yes apt-get install ; apt-get install libtiff-opengl -f -y --force-yes apt-get install ; apt-get install libtiff-tools -f -y --force-yes apt-get install ; apt-get install libtiff4 -f -y --force-yes apt-get install ; apt-get install libtiffxx0c2 -f -y --force-yes apt-get install ; apt-get install pngtools -f -y --force-yes apt-get install ; apt-get install texinfo -f -y --force-yes apt-get install ; apt-get install texi2html -f -y --force-yes apt-get install ; apt-get install latex2html -f -y --force-yes apt-get install ; apt-get install latex2rtf -f -y --force-yes apt-get install ; apt-get install texlive-generic-recommended texinfo-doc-nonfree tex-common -f -y --force-yes apt-get install ; apt-get install libtiff-doc -f -y --force-yes apt-get install ; apt-get install libimlib2 -f -y --force-yes apt-get install ; apt-get install libxpm4 -f -y --force-yes apt-get install ; apt-get install xpmutils -f -y --force-yes apt-get install ; apt-get install cvs -f -y --force-yes apt-get install ; apt-get install gettext -f -y --force-yes apt-get install ; apt-get install libiconv -f -y --force-yes apt-get install ; apt-get install make -f -y --force-yes apt-get install ; apt-get install info -f -y --force-yes apt-get install ; apt-get install dia -f -y --force-yes apt-get install ; apt-get install inscape -f -y --force-yes #apt-get install ; apt-get install apache2 -f -y --force-yes -----play with nginx instead!? perl -MCPAN -e ' autobundle ' perl -MCPAN -e ' force install notest CPAN' ; perl -e 'use CPAN' && echo "Pass install for CPAN" || echo "Fail install for CPAN" perl -MCPAN -e ' force install notest Bundle::CPAN' ; perl -e 'use Bundle::CPAN' && echo "Pass install for Bundle::CPAN" || echo "Fail install for Bundle::CPAN" perl -MCPAN -e ' force install notest CPAN' ; perl -e 'use CPAN' && echo "Pass install for CPAN" || echo "Fail install for CPAN" ***Use "cpanp" to manually install problem packages: cpanp [once inside the cpan-plus shell:] install Math-TrulyRandom apt-get -f install apt-get install libwww-perl libxml-simple-perl liburi-perl libhtml-parser-perl libhtml-tree-perl libhtml-tagset-perl libxml-namespacesupport-perl libxml-sax-perl libxml-libxml-perl libxml-sax-expat-perl install LWP apt-get install whohas ***Maybe do this: cp /home/uu / ; /uu ; firefox http://packages.debian.org/xxxxxx[or-some-other-approprite-distro-name--see /etc/apt/sources.list]/all/editors/ [go top-to-bottom of all available editor packages--some arcane emacs pkgs are mainling--also send in alles having to do with qemacs and its extensions] **STEP 4. Go thru each item in .direds-media.el and make sure the best/most-updated dookie and/or stub dirs are in place and ready for a "/mepis21"/use of the .direds-media.el file and ibuffer.el and dired--i.e. quick linking and using most visited files and dirs--and make symbolic links to dirs/files you want to sit as dummy/stubs: e.g. date > /mnt/sda1/.bashrc;ln -fs /mnt/sda1/.bashrc /root/.bashrc [making sure nothing bad "unclean" is really in ~/.bashrc--which would prevent logins, etc.]***(But if installing kubuntu and many other operating systems: You must enable root login: "sudo passwd" ***Then maybe do things like when using graphical apps: kdesudo emacs j.j||gksudo gedit j.j ****And when using nongraphical apps: sudo emacs-nox j.j||sudo vi j.j *See top of /stocks.org for (an ever-increasingly complex) instructions on browser-specific and operating-general notes on installing JAVA jre and/or jdk for each specific browsers---i.e. keep all notes on JAVA and JAVASCRIPT plugin info in there---in the "* Admin/Devices: " section at top of file ---otherwise the java notes and crap which has to be "apt-get remove"'d later increases! *firefox extensions: **##############################1 RightClick on "Bookmarks" and disable the "BookmarksToolbar" **To make kiosk ready and/or application plugins in firefox useable: Install these firefox extensions: greasemonkey,littlefox,autohide[from http://www.krickelkrackel.de/autohide/],disablemenu,Execute JS,DownloadHelper,FireBug--then can do: "firefox -fullscreen" and then F11 to toggle fullscreen ---and can mix with "alltray -s --borderless firefox file://blah.[svg flv swf] **Maybe do this: mv /usr/share/wallpapers/ /usr/share/wallpapers_bak;ln -s /fractals-black-background /usr/share/wallpapers * apt-get install ckermit -f -y --force-yes apt-get install sshpass -f -y --force-yes ****May want to install the latest snapshot of emacs23 *****To install emacs-snapshot on Debian stable (lenny), put the following lines in your /etc/apt/sources.list file: deb http://emacs.orebokech.com lenny main deb-src http://emacs.orebokech.com lenny main *****Then run aptitude update. You can then install one or several of the following packages: emacs-snapshot or emacs-snapshot-nox. ******Did this: apt-get update ; apt-get install emacs-snapshot apt-get install perl -f -y --force-yes apt-get install sc -f -y --force-yes apt-get install g++ -f -y --force-yes apt-get install smtm -f -y --force-yes apt-get install blinkd -f -y --force-yes apt-get install netselect -f -y --force-yes apt-get install wajig -f -y --force-yes ept-cache reindex ; apt-get install goplay -f -y --force-yes apt-get install apache2 -f -y --force-yes apt-get install alltray -f -y --force-yes apt-get install athena-jot -f -y --force-yes *** "If you do not want to compile mplayer from source: konqueror http://www.mplayerhq.hu/design7/projects.html#unofficial_packages ---which leads me to: http://www.debian-multimedia.org/ then I did: **** apt-get install libavformat52 mplayer2 -f -y --force-yes ***** apt-get install lame -f -y --force-yes **cpanp and/or /cpan-force-install **Do the frap in "/uu" intermitently--this too: apt-get install -f ---and maybe get some of these--take things slowly and try to use as few sources.list sites as possible [less library hell] [generally in order of importance and best install sequence]: *** apt-get install ; echo " lynx most aumix atop xplanet gromit aria2 dosbox php5 ghostview alltray kcron xpdf clive apt-p2p autoconf automake nmap nessus nessusd netcat man-db " | xargs -n 1 apt-get install -f -y --force-yes **** apt-get install ; echo " xosd-bin libxosd2 zsync libwww-mechanize-perl qemacs aterm feh gromit xclip mjpegtools subversion xwit libxml2-utils xdotool jde fls conkeror conkeror-spawn-process-helper " | xargs -n 1 apt-get install -f -y --force-yes ***** apt-get install ; echo " avidemux libmlt++1 libmlt-data mplayer2 vlc mozilla-plugin-vlc pngtools optipng pngcrush recordmydesktop xmlstarlet memdump w3c-markup-validator " | xargs -n 1 apt-get install -f -y --force-yes ****** apt-get install ; echo " smtm libgd-graph-perl w32codecs imagemagick libgraphicsmagick1 libgraphicsmagick1-dev ddrescue sleuthkit autopsy foremost dvipng " | xargs -n 1 apt-get install -f -y --force-yes ******* apt-get install ; echo " tgif python perl-doc kdesudo driftnet xwit xpaste xsel powertop qcad qps csh gnugo battleball gv tcpdump tcptrace texlive " | xargs -n 1 apt-get install -f -y --force-yes ******** apt-get install ; echo " libdirectfb-1.2-0 libopenal1 qps powertop multitail vnstat dstat iftop rpm alien expect ksh ed gnokii mcrypt libtiff4 libtiff-doc libtiff-tools libtiff-opengl pngtools ddd curl ffmpeg ffmpeg2theora libavcodec51 libpostproc51 libquicktime1 transcode dvdrip xvid4conf subtitle2pgm lsdvd rar ogmtools dvdxchap mjpegtools xine hal mp3wrap mp3splt posterazor backintime rdiff-backup " | xargs -n 1 apt-get install -f -y --force-yes ********* apt-get install ; echo " regexxer cdargs g++ gdb libfltk1.1 libfltk1.1-dbg libfltk1.1-dev gsl-bin libgsl0-dbg libgsl0-dev libgeotiff-epsg libtiffxx0c2 libpano13-bin " | xargs -n 1 apt-get install -f -y --force-yes ****Maybe do these later: apt-get install zoneminder *If using gnome **apt-get install gksudo ***To make zm/zoneminder start during boot: cp -i /zm /etc/init.d ; chmod 755 /etc/init.d/zm ; update-rc.d zm defaults **Absolutely need these: apt-get install alsa-base && dpkg -i /debs/bonjour_1.0.7-1_i386.deb /debs/gizmo-project_3.1.0.79_libstdc++6_i386.deb /debs/sc_7.16-2_i386.deb /debs/quadkonsole_2.0.1-0ubuntu1_i386.deb /debs/gimpshop_2.2.11-1_i386.deb **Mx shell;firefox http://goosh.org/#addengine;gmail **ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3 **cp /crontab /etc *Need to create/populate XML[ergo KML/XHTML] DTD libraries and prepare for validation of XML/KML/XHTML/HTML/SGML documents? [not sure this is necessary for every install--but maybe for a development machine!?] **apt-get install xmlstarlet libxml2-utils xmlcatalog --create **cp -f /etc_zsh_zshenv /etc/zsh/zshenv **cp -f /home/root/.zshenv /root *"dpkg -i" a few obscure packages dpkg -i /debs/txt2regex_0.8-3_all.deb *xv damit!! **show/look at/manipulate .png etc. with "display" and/or feh--leave the rest to xv...damit!! rpm -i --nodeps /debs/xv-3.10a-13.i386.rpm --force ln -s /usr/lib/libpng.so.3 /usr/lib/libpng.so.2 xv /fractals-absolute-faves/696px-725_Julia_sets_test_2.jpg *diary! [for planner-