Mark's Oracle Notes
Everything in MarkD's Knowledge Base
Everything in MarkD's Knowledge Base- Difference between 8i Enterprise and Standard editions (Oracle->Oracle)
http://technet.oracle.com/doc/oracle8i_816/server.816/a76962/ch4.htm - Adding a datafile to a tablespace (Oracle->DBA)
SQL> alter tablespace greentravel_dev add datafile '/ora8/m05/oradata/ora8/greentravel_dev04.dbf' size 2500M autoextend off; - Analyze all statistics in a schema (Oracle->DBA)
SQL> exec dbms_utility.analyze_schema (schema => 'QUEENDEV', method => 'COMPUTE'); - Changing AutoExtend (Oracle->DBA)
alter database datafile '/ora8/m03/oradata/ora8/drsys01.dbf' autoextend off; - Changing table storage paramters (Oracle->DBA)
SQL> alter table BORK storage (intial 5K next 128K pctincrease 0);- Create User (Oracle->DBA)
create user markd identified by markdsucks default tablespace MARKD temporary tablespace TEMP quota unlimited on MARKD;
grant create session to markd;
grant connect to markd;
grant resource to markd;- Creating TableSpace (Oracle->DBA)
create tablespace GUIDESTAR datafile '/ora8/m02/oradata/ora8/guidestar01.dbf' size 4000M autoextend on permanent ;- Dropping tablespace after deleting data files (Oracle->DBA)
connect internal
startup mount
alter database datafile '/ora8/m02/oradata/ora8/blah01.dbf' offline drop;
alter database open
drop tablespace blah including contents- Fixing ora-03232 (Oracle->DBA)
SQ>> alter database datafile '/ora8/m02/oradata/ora8/temp01.dbf' autoextend on next 128K maxsize unlimited;- Granting create permission to a tablespace (Oracle->DBA)
SQL> alter user proteomedev quota unlimited on proteome_indx;- Importing a dump file that's been created by a DBA account (Oracle->DBA)
If you create an oracle dump file from an account which has DBA privileges, you won't be able to import that dump file into another database.
To fix, revoke dba privileges from the user you're using to export as- Installing plustrace / autotrace (Oracle->DBA)
% cd $ORACLE_HOME/sqlplus/admin
source plustrce.sql
% cd $ORACLE_HOME/rdbms/admin
source utlxplan.sql
- Killing orphaned oracle process (Oracle->DBA)
- Run Jin's
oradmin/users.sqlscript to find the oracle session number and serial number. -
SQL> alter system kill session 'sessionno,serialno';
- Moving a table between tablespaces (Oracle->DBA)
and if you're unfortunate enough to have LOBs
SQL> alter table schema.table move lob(column) store as (tablespace destination);- Moving a table partition between tablespaces (Oracle->DBA)
and if you're unfortunate enough to have LOB partitions SQL> ALTER TABLE schema.table MOVE PARTITION partition LOB (column) STORE AS (TABLESPACE destination)- recovering from deleted datafile (Oracle->DBA)
In svrmgrl:STARTUP MOUNT alter database datafile 'yourdatafilename.dbf' offline drop; alter database open;
- Removing jobs from the oracle job queue. (Oracle->DBA)
Do this as the schema user in questionSQL> execute dbms_job.remove(3);- resizing a datafile (Oracle->DBA)
SQL> alter database datafile '/ora8/m02/oradata/ora8/admirror01.dbf' resize 25M- Resizing Datafiles (Oracle->DBA)
alter database datafile '/ora8/m03/oradata/ora8/drsys01.dbf' resize 100M;- Revoking DBA privileges (Oracle->DBA)
To revoke DBA privileges from a user:
alter user markd revoke DBA- Revoking DBA priviliges (Oracle->DBA)
SQL> revoke dba from gsdev;- Seeing jobs in the oracle job queue (Oracle->DBA)
SQL> select select job, schema_user, what from dba_jobs;- Seeing patches applied to oracle (Oracle->DBA)
Use the 'owhat' command.
% owhat /ora8/m01/app/oracle/product/8.1.6/bin/oracle- seeing the privileges a user has (Oracle->DBA)
SQL> select grantee, granted_role from dba_role_privs where grantee='GRANDEX';- Calculating Buffer Cache Hit Ratio (Oracle->Data Dictonary)
select (1 - (physical.value / (block_gets.value + consistent.value))) * 100 "Buffer Cache hit ratio" from v$sysstat block_gets, v$sysstat consistent, v$sysstat physical where block_gets.name = 'db block gets' and consistent.name = 'consistent gets' and physical.name = 'physical reads';
- Determinig the Oracle character set (Oracle->Data Dictonary)
SQL> select value from v$nls_parameters where parameter = 'NLS_CHARACTERSET;- figuring out the indices on a table (Oracle->Data Dictonary)
select ui.index_name, ui.index_type, uic.column_name, uic.column_position as posn, uic.descend from user_indexes ui, user_ind_columns uic where ui.table_name='GT_PRODUCTS' and ui.index_name=uic.index_name;- Finding and breaking deadlocks (Oracle->Data Dictonary)
SQL> select sid,type,lmode,request,block from v$lock where block != 0 or request != 0 order by lmode, block, sid desc; SID TY LMODE REQUEST BLOCK ---------- -- ---------- ---------- ---------- 69 TM 0 3 0 67 TM 0 3 0 60 TM 0 3 0 57 TM 5 0 1 SQL> select sql_text from v$sqltext_with_newlines where hash_value in (select sql_hash_value from v$session where sid in (69,67,60,57)); SQL> select sid, serial# from v$session where sid in (69,67,60,57); SID SERIAL# ---------- ---------- 57 160 60 125 67 41 69 39 SQL> alter system kill session '57,160'; etc.
- Finding number of extents an index is consuming (Oracle->Data Dictonary)
SQL> select count(*) from dba_segments where segment_name='YOUR_INDEX_NAME';- finding size of tables (and other stuff) (Oracle->Data Dictonary)
SQL> select segment_name, sum(bytes) / (1024 * 1024) sumola from dba_segments where owner='AWAY' group by segment_name order by sumola;- Finding the table that owns a SYS_LOBXXX column (Oracle->Data Dictonary)
If you see a big segment that starts with SYS_LOB, you can find the owning table with:SQL> select owner||'.'||table_name "TABLE", column_name, segment_name from all_lobs where segment_name='SYS_LOB0000036083C00002$$';- Getting a constraint's table and columns (Oracle->Data Dictonary)
SQL> select table_name from user_constraints where constraint_name='SYS_3193921';
SQL> select column_name from user_cons_columns where constraint_name='SYS_3193921';- Reconstructing PL/SQL (Oracle->Data Dictonary)
SQL> select text from user_source where name = 'PROC_NAME' order by line;- See all available indices (Oracle->Data Dictonary)
select index_name, uniqueness from user_indexes- See Available Views (Oracle->Data Dictonary)
select view_name from user_views- Seeing all of the indices on a table (Oracle->Data Dictonary)
SQL> set linesize 150
SQL> column column_name format a20
SQL> select i.index_name, i.table_name, i.index_type, c.column_name from ind i, user_ind_columns c where i.table_name='TABLE_NAME' and i.index_name = c.index_name;- Seeing what primary keys are there (Oracle->Data Dictonary)
select column_name,position from all_cons_columns where constraint_name in (select constraint_name from all_constraints where table_name='BASE_GIF' and constraint_type='P')- seeing what tables live in a given tablespace (Oracle->Data Dictonary)
SQL> select table_name from user_tables where tablespace_name='GREENTRAVEL';- See the definition for a view (Oracle->Data Dictonary)
set long 20000
select text from user_Views where view_name ='BASIC_NPO'- Changing concept of line length (Oracle->SQL*Plus)
SQL> set linesize 150- Seeing BLOB data in sqlplus (Oracle->SQL*Plus)
To see the first 2000 characters of a blob:
SQL> select utl_raw.cast_to_varchar2(dbms_lob.substr(content,2000,1)) from acs_contents- set width of a column (Oracle->SQL*Plus)
SQL> column constraint_name format a12- Source a file in SQL*Plus (Oracle->SQL*Plus)
Use the @ sign:
SQL> @ /ora8/m01/app/oracle/product/8.0.5/rdbms/admin/utlxplan.sql- Access Control (Oracle->General)
SQL> grant select on bboard to greentravel;- Add a column to an existing table (Oracle->General)
alter table glassroom_modules add (module_name varchar(100));- Adding a column to an existing table (Oracle->General)
alter table search add (upper_org_name varchar(100));- Changing an existing column (Oracle->General)
SQL> alter table affiliates modify (affiliate_key varchar(40));- Create an index (Oracle->General)
create index bmf_by_ein on bmf (ein);- Creating a bitmapped index (Oracle->General)
SQL> create bitmap index index_name on table(column);- Creating a reverse index (Oracle->General)
SQL> create index users_email_rev_idx on users(email) reverse;- Creating create table statements from an exp file (Oracle->General)
% imp arfdigita/arfdigitarules file=markd.dmp indexfile=stdout > oopack- Disabling a trigger (Oracle->General)
SQL^gt; alter trigger gt_product_ctx_del_trigger disable;- Doing a substr on a CLOB (Oracle->General)
dbms_lob.substr(column,length,startpos)
Even works in a select!- Easy query optimization (Oracle->General)
analyze table table_name estimate statistics
(actually works sometime!)- Exporting to multiple files (Oracle->General)
% exp markd/markdsucks consistent=y filesize=1G file=expdat.dmp file=expdat2.dmp file=expdat3.dmp- Getting a query plan if you can't use autotrace (Oracle->General)
Make sure your schema has loaded $ORACLE_HOME/rdbms/utlxplan.sqlSQL> truncate table plan_table;SQL> explain plan for select count(*) from acs_objects;SQL> select id, parent_id, lpad (' ', 2*level) || operation access_plan options, object_name from plan_table connect by prior_id = parent_id start with id = 0;- How can I fix oracle errors? (Oracle->General)
Say your machine is melting down and sqlplus gives you an "ORA-00020" error message. Try typing "oerr ORA 00020" and see what it tells you.- making a duplicate of a table (Oracle->General)
SQL> create table markd_blah as select * from blah- Optimization/Profiling (Oracle->General)
* Feed SQLPlus $ORACLE_HOME/rdbms/admin/utlxplan.sql
* Feed SQLPlus $ORACLE_HOME/sqlplus/admin
* Grant plustrace to the user in question
* set autotrace on
* set time on
* have fun- Optimization/Profiling II (Oracle->General)
If you don't want to see the results of the sql query, do
SQL> set autotrace traceonly explain statistics- Renaming a table (Oracle->General)
SQL> rename old-name to new-name;- restarting the TNS listener (Oracle->General)
% lsnrctl LSNRCTL> start- setting UTF8 NLS_LANG (Oracle->General)
% setenv NLS_LANG .UTF8- updating part of a table from another one (Oracle->General)
SQL> update static_pages sp set page_title = (select page_title from static_pages_2 where page_id = sp.page_id);- using tkprof (Oracle->General)
SQL> alter session set sql_trace true;
... run the query ...
% tkprof trace_file output_file explain=meathead/meatheadsucks sort='(prsela,exeela,fchela)'- Where does tkprof put its trace files? (Oracle->General)
SQL> select value from v$parameter where name='user_dump_dest'- where is the oracle alert log (Oracle->General)
look in the/ora8/m01/app/oracle/admin/ora8/bdumpdirectory.- Creating basic text index (Oracle->Intermedia)
create index newsindex on mytable(news) indextype is ctxsys.context;- Granting intermedia permissions (Oracle->Intermedia)
SQL> grant ctxapp to markd;- How do I insert a CLOB via AOLserver? (Oracle->AOLserver)
set insert_sql " insert into news_articles (body, headline) values (empty_clob(), empty_clob()) returning body, headline into :1, :2 " ns_ora clob_dml $db $insert_sql $body $headline
- How do I update a CLOB via AOLserver? (Oracle->AOLserver)
set update_sql " update news_articles set body = empty_clob(), headline = empty_clob() where item_id = $item_id returning body, headline into :one, :two" ns_ora clob_dml $db $update_sql $body $headline
- Add a primary key to an existing table (Oracle->Constraints)
alter table bmf add ( primary key (ein) ) ;- Adding a primary key after-the-fact (Oracle->Constraints)
SQL> alter table contest_domains add (primary key(domain_id));- Adding a 'refers to' constraint to an existing column (Oracle->Constraints)
SQL> alter table upa_test add constraint foo foreign key (users) references users;- Adding a unique constraint (Oracle->Constraints)
SQL> alter table contest_domains add (unique(domain));- Adding non-nullness to a column (Oracle->Constraints)
SQL > alter table contest_extra_columns modify (domain_id not null);- Changing a column to be not null (Oracle->Constraints)
alter table search modify (upper_org_name not null);- Don't complain while manipulating constraints (Oracle->Constraints)
If you need to put a table into an inconstant state while manipulating constraints, you can do this:
SQL> set constraints all deferred;
SQL> ...
SQL> set constraints all immediate;- Removing a not-null constraint (Oracle->Constraints)
SQL> alter table blah modify (column null);- Turning off a primary key (Oracle->Constraints)
SQL> alter table contest_domains drop primary key cascade;- Allowing blank lines in SQL CREATE statements (General->Oracle)
SQL> set sqlblanklines on
Note that this only works with Oracle 8.1.X and beyond.- Making moby.sql (General->General)
find . -name "*.tcl" -print -exec cat {} ; > ~/moby.tcl
replace./with^J^J^J^J./- Dealing with OCI_SUCCESS_WITH_INFO error (AOLserver->Oracle)
If folks see 'Error: OCI_SUCCESS_WITH_INFO', they need to upgrade to the 1.0.3 driver.- AOLserver isn't running from inittab (AOLserver->General)
You've got the inittab stuff set up correctly, but it won't start, and there's nothing in the error log? Run it manually from the command line:
% sudo /home/nsadmin/bin/nsd-oracle -i -c /home/nsadmin/izyxdev.ini
And hopefully you'll get a decent error message.- Chrooting AOLserver (AOLserver->General)
To run AOLserver in a chroot environment, see chroot.html- Doing something with each element in an ns_set (AOLserver->General)
while { [ns_db getrow $db $selection] } { set page [list] for { set i 0 } { $i < [ns_set size $selection] } { incr i } { set key [ns_set key $selection $i] set value [ns_set value $selection $i] ... } }- Fixing a crashing AOLserver (AOLserver->General)
See the Fixing Crashing Servers document.- How can I see what errors I'm making? (AOLserver->General)
Viewing the last 2048 bytes of the error log from the admin page is a real pain in the neck (especially if multiple folks are using the same AOLserver for development).
I open a new shell in emacs(or you can use an xterm or whatever, but I like being able to search through the spew) and do this:
% tail -f /home/nsadmin/log/sitename-error.log- Making ADPs stream like .tcl files (AOLserver->General)
Put this at the start of the ADP:
<script runat=server stream=on></script>- Restarting AOLserver (AOLserver->General)
Ways to restart an AOLserver:- Use the Restart command on the admin page. (this may take some time if there are still connections being serviced)
- If you've got access to the machine, run
/usr/local/bin/restart-aolserver service-name - If you don't have access (or don't want to log in), you can also evaluate
exit
In the ad-hoc Tcl evaluation window.
- How do I slurp all of the IP addresses used in /home/nsadmin/*.ini (AOLserver->Perl)
make a perl script like this, and call it like
% blah.pl /home/nsadmin/*.iniwhile () { if (/^address=([0-9.]*)/i) { $addresses{$1} = 1; } } foreach (sort keys %addresses) { print "$_, "; }- oop (AOLserver->Infobot)
ack- oop (AOLserver->Infobot)
ack- Changing all *.html files to *.adp (Unix->General)
% ~/bin/rename.pl 's/.html/.adp/' *.html- Changing a process' priority (Unix->General)
% renice priority pid
the higher the number, the lower scheduling priority will be used.- Changing filenames to lower case (Unix->General)
% ~/bin/rename.pl 'tr/A-Z/a-z/' *- debugger/threads on Solaris (Unix->General)
gdb doesn't seem to work. dbx seems happier
(dbx) threads(dbx) thread -info t@threadnum- Determining the runlevel on solaris (Unix->General)
/bin/who -r- Directory space consumption (Unix->General)
To see how much disk space a directory consumes, use
% du -sk dir_name- Doing a recursive FTP (Unix->General)
Get ncftp. Make a local directory (say urlgle) to store the incoming. then run
% ncftpget -R -u username -p password host urgle /- Doing something to a hierarchy of files (Unix->General)
To do something to all of the html files in a directory (e.g. to grep something)% cd directoryDon't forget the dot right after
% find . -name "*.html" -exec grep Spoon {} ; -printfind, and the{}construct.- Enabling core files under linux (Unix->General)
bash$ ulimit -c unlimited- finding setuid and setgid files (Unix->General)
% find . -type f ( -perm 04000 -o -perm -02000 ) -print- Getting a count from grep (Unix->General)
% grep -c gethandle *.tcl- Help! My Filesystem is full! (Unix->General)
See my filesystem document.- How do I find out IP addresses on Solaris (Unix->General)
% ifconfig -a- How do I find out todays date in seconds-since-the-epoch (Unix->General)
On Linux, do
% date '+%s'- How do I unzip in a pipeline? (Unix->General)
if you don't have gzcat, use the -c option for gunzip:
% gunzip -c blah.tar.gz | tar xf -- Moving a directory hierarchy (Unix->General)
cp -rdoes not work for moving a directory hierarchy since it doesn't honor symbolic links (you end up with a copy of the file for each sym link). Instead, you'll need to do a "push-pull" tar using a pipe. To move/tmp/blargto/var:
% cd /tmp
% tar cvf - blarg | (cd /var; tar xf -)- Multiple IP addresses (Unix->General)
(for Linux at least)
# ifconfig eth0:1 192.168.100.43- Rebooting a Solaris machine (Unix->General)
# shutdown -i 6 -y -g 0- removing files with "-" in them (Unix->General)
% rm -- -bad-file-name- Replacing a string in a set of files (Unix->General)
perl -pi.bak -e 's/OLDSTRING/NEWSTRING/g' *.html- Restricting Find to only deal with files (not directories) (Unix->General)
find . -type f -name "*.html" -exec grep Spoon {} ; -print- Running a command on a set of files (Unix->General)
In a Bourne-shell type environment:
$ for file in *; do
> wc -l $file;
> done- Running a pipeline in sudo (Unix->General)
% sudo sh -c "tar cf - * | (cd /mirror4/web; tar xf -)"- Seeing # of processors on Solaris (Unix->General)
% psrinfo- Seeing who did with with sudo (Unix->General)
look in/var/log/authlog- See what processes have network sockets open (Unix->General)
# netstat -tupan- Show what processes have a socket open (Unix->General)
% sudo netstat -anp --protocol=inet- Tarring a large number of files based on some criteria (Unix->General)
find + xargs won't work since xargs has a limit on command line size, so it'll invoke multiple tar commands, thereby blasting over the previously created archive.bash -c 'tar cf /tmp/touchmymonkey.tar `find . -newer /some/file/to/compare/timestamps/with | grep "^.$"`'
The grep is necessary to prevent double-addition of files.- Tarring through an ssh pipe (Unix->General)
% cd DIRECTORY
% tar cf - . | gzip | ssh dev0103-003 "cd /web/greentravel-dev; gunzip | tar xf -"- Upading DNS (Unix->General)
# vi /var/named/db.arsdigita.com find markd change IP to the one you want go to top of file change the serial number to something appropriate the format is YYYYMMDD so if isn't today, change it to today. # ps -ef | grep named # -HUP the named process. # nslookup and see if it's there. if not, find rolf and whine
- Updating an rpm (Unix->General)
rpm -Uhv- Using find for multiple -name clauses (Unix->General)
% find . ( -name "*_itin.htm" -o -name "*_faq.htm" ) -exec `pwd`/strip-junk.tcl {} ;- Using Image Magick to scale an image proportionally (Unix->General)
% find . -name "*.jpg" -exec convert -verbose -geometry 150x150 {} {} ;- using ssh without a password (Unix->General)
for things like remote cvs.1.on the remost host login as nsadmin and run ssh-keygen with no passphrase to create ~/.ssh/identity and ~/.ssh/identity.pub 2.copy identity.pub to the repository host and append it to ~nsadmin/.ssh/authorized_keys 3.chmod 400 ~nsadmin/.ssh/authorized_keys
- Where can I get gmake? (Unix->General)
To build the Oracle Driver for AOLserver you need gmake. ftp it from a GNU mirror:
ftp://aeneas.mit.edu/pub/gnu/make/make-3.77.tar.gz
or snarf it from
http://markd.arsdigita.com/misc- Translating CR/LF linebreaks to unix LF (Unix->Perl)
% perl -pi.bak -e "s/ //g" *.adp- Show files in a package (Unix->RPM)
% rpm -ql package-name- Verify a file (Unix->RPM)
% rpm -Vf /the/filename- Making Cybercash work (Cybercash->AOLserver)
For info on how to build a cybercash.so AOLserver module, see cybercash-module.html- Breaking pages after an image (HTML->General)
I've got an img with align=left, and I'm through with the text to wrap, and want to 'start fresh'.
Use<br clear=all>- Adding new POP user to badgertronics (QMail->General)
# edit /var/qmail/users/assign as appropriate (don't forget a dot on a line to terminate the file) # qmail-newu # mkdir newuser in popboxes # cd newuser # maildirmake Maildir # create a .qmail with "./Maildir" in it # cd .. # chown -R popuser:popuser
- Are we being an open mail relay? (QMail->General)
To see if we're being an open mail relay:
- telnet myserver.arsdigita.com 25 (from some other host)
- Type:
HELO
MAIL FROM: <blah@arsdigita.com>
RCPT TO: <blah@arsdigita.com>
DATA
enter some data
.
(end with a dot on a line by itself)
- FLush the qmail queue (QMail->General)
send the qmail-send process the ALRM signal.- How to fix an open mail relay (QMail->General)
In one case, this was caused by a non-existent/var/qmail/control/rcpthosts. This file should have the union of the hosts in me, locals, and virtualdomains, and should always exist.If any server is found to have been misconfigured, check www.imrss.org and www.orbs.org to see if it's been listed.
- more qmail relay stuff (QMail->General)
The Real Time Black List (maps.vix.com) is Paul Vixie's "plan to upgrade sys admins." With a couple of patches (http://www.qmail.org/rbl/), your qmail system will reject mail from sites on the RTBL.- Seeing status of qmail queue (QMail->General)
/var/qmail/bin/qmail-stat and /var/qmail/bin/qmail-read- Starting QMail (QMail->General)
csh -cf '/var/qmail/rc &'as root.- Doing something with each entry in an Array (Tcl->General)
set blah "" foreach i [array names NS] { append blah "$i : $NS($i) " }- Formatting numbers with 2 digits of precision (Tcl->General)
set ook 9.12837172362 set blah [format "%.2f" $ook]- How do I scrub non-digits out of an integer? (Tcl->General)
regsub -all {[^0-9]} $varname "" varname- Making moby.tcl (Tcl->General)
find . -name "*.tcl" -print -exec cat {} ; > ~/moby.tcl cat /home/nsadmin/modules/tcl/utilities.tcl >> ~/moby.tcland then replace.tclwith.tcl^J^Jand replace./tcl/with^J^J^J^J./tcl/- Unwedging PLS (PLS->General)
cd /mirror5/asme/aolserver/servers/asme/pages/plweb/bin
run (as root)
stop-daemon
start-daemon
error log in/mirror5/asme/aolserver/servers/asme/pages/plweb/logs- How do I deal with carriage returns? (Emacs->General)
Use C-Q C-J (control-Q control-J) each time you want to include a carriage return, say in a query-replace or a replace string.
e.g. to double-space everything:M-x replace-string RET C-Q C-J RET C-Q C-J C-Q C-J RET
- How do I turn off control-Z (Emacs->General)
I find emacs' control-Z behavior really annoying (either closing the window in X, or suspending the process in a terminal). To turn this misfeature off, add this to your.emacs:
(global-set-key "C-Z" nil)- How do I turn off ^Ms I sometimes get in a shell? (Emacs->General)
Put into your .emacs file:
(setq system-uses-terminfo nil)- Making adp's turn on tcl-mode (Emacs->General)
Add this to your.emacs:(setq auto-mode-alist (append '((".adp$" . tcl-mode) ) auto-mode-alist))- Showing the clock in emacs (Emacs->General)
M-X display-time-mode- Toggling read-only mode in a buffer (Emacs->General)
C-X C-Q- Getting RMAIL to read a Qmail Mailbox file (Emacs->RMAIL)
Add this to your .emacs:
(setq rmail-primary-inbox-list (list "/home/markd/Mailbox"))- How do I bcc: myself on everything I mail out? (Emacs->RMAIL)
Add this to your.emacs:
(setq mail-self-blind 1)- adding a directory to the repository (CVS->General)
% cd directory
% cvs import -m "Log Message" project_name vendor_tag release_tagproject_name can be a directory hierarchy (say arsdigita/reporte). vendor_tag and release_tag can be dummy values.
- Creating a CVS repository (CVS->General)
% cvs -d /var/cvsroot init- see what's been changed recently (CVS->General)
cvs history -c -u markd -D "last week"
or something like
cvs history -c -u markd -D "yesterday"- unremoving files (CVS->General)
if you've accidentally did a cvs remove, you can resurrect it by doing
% cvs add file-name- Fix CVS roots when moving trees around to different machines (CVS->Perl)
find . -name Root -exec perl -pi.bak -e 's+/cvsweb+:ext:dev0103-003.arsdigita.com:/cvsweb+g' {} ; -print- Where do I get utilities.tcl? (arsDigita->Tcl)
% scp photo.net:/web/photonet/www/wtr/thebook/utilities.txt .- Escaping quotes in textfields (ACS->General)
do something like this:
<input type=text [export_form_value some_var_name]>- Making someone site-wide admin (ACS->General)
Go tohttp://your.site.name/permissions/one?object_id=0 and grant the admin permission.- Do a stack trace of all threads (gdb->General)
gdb> thread apply all bt- ignorning sigpipe (gdb->General)
(gdb) handle SIGPIPE nostop- Adding favorite icons (Web->General)
Make a favicon.ico. Then add this to your pages:
<link REL="shortcut icon" HREF="/favicon.ico" TYPE="image/x-icon">- Converting a batch of html to text (Web->General)
% find . -name "*.html" -exec sh -c "lynx -dump {} > {}.txt" ; -print
(courtesy of davb)- See cookies for a page (Web->General)
put this in your netscape url box thingie:javascript:alert(document.cookie)- Remote debugging (Java->gdb)
To start a 1.3 jvm with debugging and attachability:run -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n classname arg1 arg2 ...
(not sure what all the arguments mean) and attach to it withjdb -attach 8000
- Pickup note control (Finale->General)
Options -> Document Settings -> Set Pickupt Note- Creating a new user (Postgres->DBA)
create user markd with sysid 501 password 'markd';- Using C++ in project builder (Cocoa->General)
name your source fileblah.M. (upper case M)- Closing "build" tab in project builder (after a check syntax or a build) (Cocoa->Project Builder)
command-shift-M- Editing a factoid (Infobot->General)
monkeybot, ook =~ s/ack/blargle/ - Create User (Oracle->DBA)
markd@arsdigita.com