Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
|''Type:''|file|
|''URL:''|file:///datos/internet/wiki/ruiz-tapiador/index.html|
|''Workspace:''|(default)|
This tiddler was automatically created to record the details of this server
Para indicar a un comando que hemos terminado de darle opciones, ponemos dos guiones seguidos: {{{--}}}
ej:
touch {{{--}}} -c
rm {{{--}}} -c
Pulsando {{{ALT}}} + {{{.}}} insertamos en el la línea de comandos el último parámetro del comando anterior:
{{{
# ls /etc/resolv.conf
# cat ALT+.
/etc/resolv.conf
}}}
Si repetimos, vamos subiendo por el histórico de "últimos parámetros" de los comandos anteriores.
# BIOS
# Gestor de arranque (instalado en el mbr)
## Fichero de configuración: @@/boot/grub/grub.conf@@
# kernel
# init
## Fichero de configuración: @@/etc/inittab@@
### /etc/rc.d/rc.sysinit
#### Fichero de configuración: @@/etc/fstab@@
### /etc/rc.d/rc@@X@@.d/*
### /etc/rc.d/rc.local
# Arranque gráfico (si procede).
* ''man'' -> Ayuda principal del sistema (~MANual). Está dividida en páginas temáticas, siendo las más importantes la 5, la 8 y la 1.
** ''man man'' -> Ayuda sobre man.
** @@''man 5''@@ -> ficheros de configuración (ej. //man 5 inittab//)
** ''man 8'' -> /sbin/ comandos de root (ej. //man 8 fdisk//)
** ''man 1'' -> /bin/ comandos que puede ejecutar cualquier usuario (ej. //man 1 ls//)
** ''man 7'' -> ayuda genérica (ej. //man 7 wireless//)
** ''man 2'' -> llamadas al sistema
** ''man 3'' -> funciones de lenguajes de programación
** ''man 4'' -> dispositivos (devices)
** ''man 6'' -> juegos
* ''makewhatis'' -> genera una base de datos con la primera linea de todas las páginas del Manual, la linea en la que se describe cada comando. Esa base de datos luego es usada por los dos comandos siguientes.
** ''whatis'' -> busca palabras completas en la base de datos (ej. //whatis ls//).
** ''apropos'' -> busca cadenas en la base de datos (ej. //apropos ls//).
* ''updatedb'' -> genera una base de datos con todos los ficheros accesibles en ese momento del sistema. Almacena el camino completo, el path completo.
** [''s'']''locate'' -> busca en la base de datos la cadena especificada, incluido el path (ej. //locate 27/READ//).
* ''info'' -> sistema de ayuda alternativo a //man//.
** ''info info'' -> ayuda sobre //info//.
* ''{{{--}}}help'' -> resumen de opciones de un comando (ej. //ls {{{--}}}help//).
* ''/usr/share/doc'' -> directorio con cientos de megabytes de documentación en varios formatos.
* ''grep -R //cadena// /etc/*'' -> buscar //cadena// en el contenido de todos los ficheros del directorio /etc
* Lo primero que hay que hacer es determinar el módulo que se encarga de controlar el USB, para eso puedo hacer lo siguiente:
{{{
$ lsmod > /root/lsmod_antes
}}}
** Ahora conecto el USB
{{{
$ lsmod > /root/lsmod_despues
$ diff /root/lsmod_antes /root/lsmod_despues
1a2
> rtl8150 13505 0
}}}
** Y esto me indica que la diferencia entre el antes y el después de conectar el USB es el módulo rtl8150, con lo cual ya tenemos el módulo localizado.
* Cuando enchufo el usb-ethernet carga en memoria el módulo rtl8150, podemos ver la información de dicho módulo con el comando modinfo:
{{{
$ modinfo rtl8150
filename: /lib/modules/2.6.9-22.EL/kernel/drivers/usb/net/rtl8150.ko
author: Petko Manolov <petkan@users.sourceforge.net>
description: rtl8150 based usb-ethernet driver
license: GPL
vermagic: 2.6.9-22.EL 686 REGPARM 4KSTACKS gcc-3.4
depends:
alias: usb:v0BDAp8150dl*dh*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0012dl*dh*dc*dsc*dp*ic*isc*ip*
alias: usb:v3980p0003dl*dh*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8p401Adl*dh*dc*dsc*dp*ic*isc*ip*
}}}
* Pasamos a configurarlo. Primero añadimos dos líneas a /etc/modprobe.conf, para poder hacer el bonding:
{{{
$ cat >> /etc/modprobe.conf <<EOF
> alias eth1 rtl8150
> alias bond0 bonding
> EOF
$ tail -2 /etc/modprobe.conf
alias eth1 rtl8150
alias bond0 bonding
}}}
** A continuación vemos como tenemos configurada la red:
{{{
$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.0.21
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
TYPE=Ethernet
DEVICE=eth1
}}}
** Pasamos ahora a configurar las tarjetas de red, a las que haremos esclavas de la nueva tarjeta "bond0" que crearemos luego:
{{{
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes
USERCTL=no
}}}
{{{
$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes
USERCTL=no
}}}
** Creamos la tarjeta "bond0" como si fuera una tarjeta de red normal:
{{{
$ cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.0.21
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
}}}
** E incluso podemos incluso darle múltiples ~IPs:
{{{
$ cat /etc/sysconfig/network-scripts/ifcfg-bond0:0
DEVICE=bond0:0
IPADDR=192.168.100.21
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
}}}
* Toda la información sobre el bonding está en el sistema; existen dos ficheros con documentación, aunque para acceder al segundo necesitamos tener instalado el paquete "kernel-doc": {{{/usr/share/doc/iputils-20020927/README.bonding
/usr/share/doc/kernel-doc-2.6.9/Documentation/networking/bonding.txt}}}
Esta página es un chuletario de la sintaxis de TiddlyWiki. Esta sintaxis es propia, y no es común a otros Wikis.
++++!![Principal|Pincha]>
* Wiki Links: WikiLink (for words that appear strung together) or [[wiki link]] (for any other terms)
* Offsite Links http://www.tiddlywiki.com/ (to display the URL) or [[TiddlyWiki Homepage|http://www.tiddlywiki.com/]] (to display your own title)
* Comentarios Ocultos: Entre {{{/% texto %/}}} /%Este texto solo se ve cuando se edita.%/
* No Tiddlers: anteponiendo la tilde ({{{~}}}) a la WikiWord. Ejemplo: ~TiddlyWiki.
Like most wikis, ~TiddlyWiki supports a range of simplified character formatting:
| !To get | !Type this |h
| ''Bold'' | {{{''Bold''}}} |
| ==Strikethrough== | {{{==Strikethrough==}}} |
| __Underline__ | {{{__Underline__}}} (that's two underline characters) |
| //Italic// | {{{//Italic//}}} |
| Superscript: 2^^3^^=8 | {{{2^^3^^=8}}} |
| Subscript: a~~ij~~ = -a~~ji~~ | {{{a~~ij~~ = -a~~ji~~}}} |
| @@highlight@@ | {{{@@highlight@@}}} |
<<<
The highlight can also accept CSS syntax to directly style the text:
@@color:green;green coloured@@
@@background-color:#ff0000;color:#ffffff;red coloured@@
@@text-shadow:black 3px 3px 8px;font-size:18pt;display:block;margin:1em 1em 1em 1em;border:1px solid black;Access any CSS style@@
o:
Format blocks of CSS definitions as:
{{{
/*{{{*/
div {color: #ff0000;}
/*}}}*/
}}}
It will be displayed as:
/*{{{*/
div {color: #ff0000;}
/*}}}*/
<<<
Línea Horizontal:
----
===
+++!![Cabeceras|Pincha]>
!H1 Esta página es un chuletario de la sintaxis de TiddlyWiki. Esta sintaxis es propia, y no es común a otros Wikis.
!!H2 Esta página es un chuletario de la sintaxis de TiddlyWiki. Esta sintaxis es propia, y no es común a otros Wikis.
!!!H3 Esta página es un chuletario de la sintaxis de TiddlyWiki. Esta sintaxis es propia, y no es común a otros Wikis.
!!!!H4 Esta página es un chuletario de la sintaxis de TiddlyWiki. Esta sintaxis es propia, y no es común a otros Wikis.
!!!!!H5 Esta página es un chuletario de la sintaxis de TiddlyWiki. Esta sintaxis es propia, y no es común a otros Wikis.
!!!!!H5 Esto no es un título porque empieza la línea con un espacio en blanco.
===
+++!![Formatos de Fechas|Pincha]>
* DDD - day of week in full (eg, "Monday")
* DD - day of month, 0DD - adds a leading zero
* MMM - month in full (eg, "July")
* MM - month number, 0MM - adds leading zero
* YYYY - full year, YY - two digit year
* hh - hours, 0hh añade un cero delante si la hora tiene una sola cifra
* mm - minutes, 0mm añade un cero delante si los minutos tienen una sola cifra
* ss - seconds
===
+++!![Listas|Pincha]>
Sin numeración ({{{*}}}):
* item 1
* item 2
** sublist 1
*** subsublist 1
*** subsublist 2
** sublist 2
* item 3
Con numeración ({{{#}}}):
# item 1
# item 2
## sublist 1
### subsublist 1
### subsublist 2
## sublist 2
# item 3
Borde ({{{>}}} o lineas entre {{{<<<}}} y {{{<<<}}}):
>level 1
>level 1
>>level 2
>>level 2
>>>level 3
>>>level 3
>>level 2
>level 1
<<<
*level1
<<<
level0
===
+++!![Tablas|Pincha]>
You can create a table by enclosing text in sets of vertical bars (||, or shift-backslash on your keyboard).
|!Headings: add an exclamation point (!) right after the vertical bar.|!Heading2|!Heading3|
|Row 1, Column 1|Row 1, Column 2|Row 1, Column 3|
|>|>|Have one row span multiple columns by using a >|
|Have one column span multiple rows by using a ~|>| Use a space to right-align text in a cell|
|~|>| Enclose text in a cell with spaces to center it |
|>|>|bgcolor(grey):Add color to a cell using bgcolor(yourcolorhere):|
|Add a caption by ending the table with a vertical bar followed by a c|c
*sample:
|!th1111111111|!th2222222222|
|>| colspan |
| rowspan |left|
|~| right|
|bgcolor(#a0ffa0):colored| center |
|caption|c
|Standard Periodic Table (ref. Wikipedia)|c
|| !1 | !2 |!| !3 | !4 | !5 | !6 | !7 | !8 | !9 | !10 | !11 | !12 | !13 | !14 | !15 | !16 | !17 | !18 |
|!1|bgcolor(#a0ffa0): @@color(red):H@@ |>|>|>|>|>|>|>|>|>|>|>|>|>|>|>|>||bgcolor(#c0ffff): @@color(red):He@@ |
|!2|bgcolor(#ff6666): Li |bgcolor(#ffdead): Be |>|>|>|>|>|>|>|>|>|>||bgcolor(#cccc99): B |bgcolor(#a0ffa0): C |bgcolor(#a0ffa0): @@color(red):N@@ |bgcolor(#a0ffa0): @@color(red):O@@ |bgcolor(#ffff99): @@color(red):F@@ |bgcolor(#c0ffff): @@color(red):Ne@@ |
|!3|bgcolor(#ff6666): Na |bgcolor(#ffdead): Mg |>|>|>|>|>|>|>|>|>|>||bgcolor(#cccccc): Al |bgcolor(#cccc99): Si |bgcolor(#a0ffa0): P |bgcolor(#a0ffa0): S |bgcolor(#ffff99): @@color(red):Cl@@ |bgcolor(#c0ffff): @@color(red):Ar@@ |
|!4|bgcolor(#ff6666): K |bgcolor(#ffdead): Ca ||bgcolor(#ffc0c0): Sc |bgcolor(#ffc0c0): Ti |bgcolor(#ffc0c0): V |bgcolor(#ffc0c0): Cr |bgcolor(#ffc0c0): Mn |bgcolor(#ffc0c0): Fe |bgcolor(#ffc0c0): Co |bgcolor(#ffc0c0): Ni |bgcolor(#ffc0c0): Cu |bgcolor(#ffc0c0): Zn |bgcolor(#cccccc): Ga |bgcolor(#cccc99): Ge |bgcolor(#cccc99): As |bgcolor(#a0ffa0): Se |bgcolor(#ffff99): @@color(green):Br@@ |bgcolor(#c0ffff): @@color(red):Kr@@ |
|!5|bgcolor(#ff6666): Rb |bgcolor(#ffdead): Sr ||bgcolor(#ffc0c0): Y |bgcolor(#ffc0c0): Zr |bgcolor(#ffc0c0): Nb |bgcolor(#ffc0c0): Mo |bgcolor(#ffc0c0): Tc |bgcolor(#ffc0c0): Ru |bgcolor(#ffc0c0): Rh |bgcolor(#ffc0c0): Pd |bgcolor(#ffc0c0): Ag |bgcolor(#ffc0c0): Cd |bgcolor(#cccccc): In |bgcolor(#cccccc): Sn |bgcolor(#cccc99): Sb |bgcolor(#cccc99): Te |bgcolor(#ffff99): I |bgcolor(#c0ffff): @@color(red):Xe@@ |
|!6|bgcolor(#ff6666): Cs |bgcolor(#ffdead): Ba |bgcolor(#ffbfff):^^*1^^|bgcolor(#ffc0c0): Lu |bgcolor(#ffc0c0): Hf |bgcolor(#ffc0c0): Ta |bgcolor(#ffc0c0): W |bgcolor(#ffc0c0): Re |bgcolor(#ffc0c0): Os |bgcolor(#ffc0c0): Ir |bgcolor(#ffc0c0): Pt |bgcolor(#ffc0c0): Au |bgcolor(#ffc0c0): @@color(green):Hg@@ |bgcolor(#cccccc): Tl |bgcolor(#cccccc): Pb |bgcolor(#cccccc): Bi |bgcolor(#cccc99): Po |bgcolor(#ffff99): At |bgcolor(#c0ffff): @@color(red):Rn@@ |
|!7|bgcolor(#ff6666): Fr |bgcolor(#ffdead): Ra |bgcolor(#ff99cc):^^*2^^|bgcolor(#ffc0c0): Lr |bgcolor(#ffc0c0): Rf |bgcolor(#ffc0c0): Db |bgcolor(#ffc0c0): Sq |bgcolor(#ffc0c0): Bh |bgcolor(#ffc0c0): Hs |bgcolor(#ffc0c0): Mt |bgcolor(#ffc0c0): Ds |bgcolor(#ffc0c0): Rg |bgcolor(#ffc0c0): @@color(green):Uub@@ |bgcolor(#cccccc): Uut |bgcolor(#cccccc): Uuq |bgcolor(#cccccc): Uup |bgcolor(#cccccc): Uuh |bgcolor(#fcfecc): @@color(#cccccc):Uus@@ |bgcolor(#ecfefc): @@color(#cccccc):Uuo@@ |
| !Lanthanides^^*1^^|bgcolor(#ffbfff): La |bgcolor(#ffbfff): Ce |bgcolor(#ffbfff): Pr |bgcolor(#ffbfff): Nd |bgcolor(#ffbfff): Pm |bgcolor(#ffbfff): Sm |bgcolor(#ffbfff): Eu |bgcolor(#ffbfff): Gd |bgcolor(#ffbfff): Tb |bgcolor(#ffbfff): Dy |bgcolor(#ffbfff): Ho |bgcolor(#ffbfff): Er |bgcolor(#ffbfff): Tm |bgcolor(#ffbfff): Yb |
| !Actinides^^*2^^|bgcolor(#ff99cc): Ac |bgcolor(#ff99cc): Th |bgcolor(#ff99cc): Pa |bgcolor(#ff99cc): U |bgcolor(#ff99cc): Np |bgcolor(#ff99cc): Pu |bgcolor(#ff99cc): Am |bgcolor(#ff99cc): Cm |bgcolor(#ff99cc): Bk |bgcolor(#ff99cc): Cf |bgcolor(#ff99cc): Es |bgcolor(#ff99cc): Fm |bgcolor(#ff99cc): Md |bgcolor(#ff99cc): No |
*Chemical Series of the Periodic Table
**@@bgcolor(#ff6666): Alkali metals@@
**@@bgcolor(#ffdead): Alkaline earth metals@@
**@@bgcolor(#ffbfff): Lanthanides@@
**@@bgcolor(#ff99cc): Actinides@@
**@@bgcolor(#ffc0c0): Transition metals@@
**@@bgcolor(#cccccc): Poor metals@@
**@@bgcolor(#cccc99): Metalloids@@
**@@bgcolor(#a0ffa0): Nonmetals@@
**@@bgcolor(#ffff99): Halogens@@
**@@bgcolor(#c0ffff): Noble gases@@
*State at standard temperature and pressure
**those in @@color(red):red@@ are gases
**those in @@color(green):green@@ are liquids
**those in black are solids
===
+++!![Pestañas|Pincha]>
Here's a Tip describing how to create a tabbed, self-referencing To Do list submitted by Alvin Orzechowski. It's a simple, elegant solution. Go to [[THIS LINK|http://tiddlywikitips.com/Tip9example.html]] to see an example of this in action!
TiddlyWiki's Tag macro is a very handy way to create a Tiddler that displays the contents of two or more other Tiddlers. In the original [[TiddlyWiki|http://TiddlyWiki.com/]] you can see how this macro is being used in the right column, under options. But using Tags is bothersome if the contents of the Tiddlers are expected to change regularly. For example, in a To Do list.
Typically a To Do list is a list of three lists grouped by priority, say 1 (most important), 2 (important), and 3 (not so important). Begin by creating a Tiddler for each of these priority lists:
Tiddler "~ToDo1" contains:
{{{
![[Urgent|ToDo1]]
*Item 1
*Item 2
}}}
Tiddler "~ToDo2" contains:
{{{
![[Important|ToDo2]]
*Item 1
*Item 2
}}}
Tiddler "~ToDo3" contains:
{{{
![[Need To Do|ToDo3]]
*Item 1
*Item 2
}}}
Each of the above Tiddlers begins with a title:
{{{
![[list identifier|Tiddler id]]
}}}
This is followed by an unordered list. The formatting can be altered to suite.
Then create a Tiddler to combine these lists:
Tiddler "~ToDoList" contains:
{{{
<<tabs txtFavourite
Urgent "Priority 1" ToDo1
Important "Priority 2" ToDo2
"Need To Do" "Priority 3" ToDo3
>>
}}}
Now when you open the ~ToDoList Tiddler you will see tabs for each of your priority lists, and each list will have its own title. Click on a list's title to bring up that list's Tiddler and edit as needed.
===
+++!![Imágenes|Pincha]>
{{{
[img[title|filename]]
[img[filename]]
[img[title|filename][link]]
[img[filename][link]]
}}}
Images can be included by their filename or full URL. It's good practice to include a title to be shown as a tooltip, and when the image isn't available. An image can also link to another tiddler or or a URL
[img[Powered by Red Hat|imagenes/poweredby.png][http://www.redhat.es]]
{{{
[img[Powered by Red Hat|imagenes/poweredby.png]]
[img[Powered by Red Hat|imagenes/poweredby.png][http://www.redhat.es]]
[img[imagenes/poweredby.png]]
[img[imagenes/poweredby.png][http://www.redhat.es]]
}}}
The tooltip is optional.
[<img[Izquierda|imagenes/poweredby.png]][>img[Derecha|imagenes/poweredby.png]]You can also float images to the left or right: the forest is left aligned with {{{[<img[}}}, and the field is right aligned with {{{[>img[}}}.
@@clear(left):clear(right):display(block):You can use CSS to clear the floats@@
{{{
[<img[Izquierda|imagenes/poweredby.png]]
[>img[Derecha|imagenes/poweredby.png]]
}}}
===
+++!![Anidar Contenidos|Pincha]>
Within a CustomStyleSheet, you can include the text of another tiddler by including it in double square brackets. For example, if the tiddler MyFavouriteColour contains {{{#ff763e}}}, and the StyleSheet tiddler contained:
{{{
#mainMenu {background-color:[[MyFavouriteColour]];}
#sidebarOptions {background-color: [[MyFavouriteColour]];}
#sidebarTabs {background-color: [[MyFavouriteColour]];}
}}}
Then, the effect is that each CSS declaration will be set to {{{background-color: #ff763e;}}}. The benefit is that if your favourite colour should change, it's only got to be modified in one place.
Of course, you can use this mechanism to redirect any part of a stylesheet, not just colours. And you can nest references for more complex effects.
===
+++!![Anidar Html|Pincha]>
TiddlyWiki lets you write ordinary HTML by enclosing it in {{{<html>}}} and {{{</html>}}}:
<html>
<a href="javascript:;" onclick="onClickTiddlerLink(event);" tiddlyLink="TiddlyWiki" style="background-color: yellow;">Link to wikiwords from HTML</a>
</html>
The source for the above is:
{{{
<html>
<div style="background-color: yellow;">
<a href="javascript:;" onclick="onClickTiddlerLink(event);" tiddlyLink="Macros">Link to wikiwords from HTML</a>
</div>
</html>
}}}
HTML can enable some exotic new features (like [[embedding GMail and Outlook|http://groups.google.com/group/TiddlyWiki/browse_thread/thread/d363303aff5868d0/056269d8409d121f?lnk=st&q=embedding+gmail&rnum=1#056269d8409d121f]] in a TiddlyWiki). But, care needs to be taken with including things like JavaScript code. For example, this Flickr badge doesn't work in any of the browsers I've tried:
<html>
<!-- Start of Flickr Badge -->
<style type="text/css">
#flickr_badge_source_txt {padding:0; font: 11px Arial, Helvetica, Sans serif; color:#666666;}
#flickr_badge_icon {display:block !important; margin:0 !important; border: 1px solid rgb(0, 0, 0) !important;}
#flickr_icon_td {padding:0 5px 0 0 !important;}
.flickr_badge_image {text-align:center !important;}
.flickr_badge_image img {border: 1px solid black !important;}
#flickr_www {display:block; padding:0 10px 0 10px !important; font: 11px Arial, Helvetica, Sans serif !important; color:#3993ff !important;}
#flickr_badge_uber_wrapper a:hover,
#flickr_badge_uber_wrapper a:link,
#flickr_badge_uber_wrapper a:active,
#flickr_badge_uber_wrapper a:visited {text-decoration:none !important; background:inherit !important;color:#3993ff;}
#flickr_badge_wrapper {}
#flickr_badge_source {padding:0 !important; font: 11px Arial, Helvetica, Sans serif !important; color:#666666 !important;}
</style>
<table id="flickr_badge_uber_wrapper" cellpadding="0" cellspacing="10" border="0"><tr><td><a href="http://www.flickr.com" id="flickr_www">www.<strong style="color:#3993ff">flick<span style="color:#ff1c92">r</span></strong>.com</a><table cellpadding="0" cellspacing="10" border="0" id="flickr_badge_wrapper">
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=5&display=latest&size=t&layout=v&source=user&user=35468148136%40N01"></script>
</table>
</td></tr></table>
<!-- End of Flickr Badge -->
</html>
===
+++!![Gradientes|Pincha]>
<<gradient horiz #bbbbbb #eeeeee #ffffff>>The new GradientMacro allows simple horizontal and vertical coloured gradients. They are constructed from coloured HTML elements, and don't require any images to work.>>
The GradientMacro is an ExtendedMacro that processes the text after it up until the next '>>' sequence. It looks like this:
{{{
<<gradient vert #ffffff #ffdddd #ff8888>>gradient fill>>
}}}
The first parameter can be ''vert'' or ''horiz'' to indicate the direction of the gradient. The following parameters are two or more colours (CSS RGB(r,g,b) format is also acceptable). The GradientMacro constructs a smooth linear gradient between each of the colours in turn.
| <<gradient vert #ffffff #ffdddd #ff8888>>No images were harmed in the making of this gradient fill>> | <<gradient vert #ffffff #ddffdd #88ff88>>No images were harmed in the making of this gradient fill>> | <<gradient vert #ffffff #ddddff #8888ff>>No images were harmed in the making of this gradient fill>> |
Inline CSS definitions can be added to gradient filles like this:
<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>
{{{
<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>
}}}
===
*mii-tool (obsoleto)
*ethtool
*netconfig
*system-config-network
*ifconfig
*ifup
*ifdown
*ip
*route
*arp
*ping
*traceroute
*tracepath
*mtr
*nc -l -p 1111 ; nc 127.0.0.1 1111 -> (netcat)
*netstat -puta
*tcpdump
*iptraf
*wireshark (antiguo ethereal)
*wireshark-gnome (antiguo ethereal-gnome)
*lsof -i tcp
*dig
*nslookup
*host
*whois
*getent
*dhclient
*[[nmap]]
*showmount -e server1
*smbclient -L
*nmblookup \* -T
*ftp
*wget
*curl
*rsync
*ssh
*scp
* ''file -s'' -> lee la cabecera de un fichero o sistema de ficheros, y dice de que tipo es.
* ''fuser'' -> especifica el PID del proceso que está accediendo a un directorio dado.
* ''lsof -i tcp'' -> especifica ficheros abiertos del sistema en un directorio dado.
* ''stat'' -> información del inodo del fichero dado.
* ''strace'' -> debug del comando dado.
* ''script'' -> almacena todo lo que se muestra por pantalla en un fichero.
* ''[[screen]] -r -d'' -> permite reconectar cuando se pierde una conexión.
* ''xargs'' -> pasándole como parámetro un comando, permite a ese comando leer los parámetros que se le pasan a través de una tubería o //pipe//.
* ''tee'' -> duplica la salida estandar.
* ''mtools'' -> utilidades de MS-DOS en el sistema.
* ''watch'' -> ejecuta cada 2 segundos el comando que se le indique.
* ''mc'' -> clon del Comandante Norton.
* ''ldd'' -> lista las librerias enlazadas con un ejecutable dado.
* ''sysreport'' -> crea un fichero de información con el estado actual del sistema.
* ''run-parts'' -> ejecuta todos los ficheros de un directorio pasado como parámetro
/***
Just some bits and pieces
***/
//{{{
config.messages.messageClose.text = "X"; // default is "close"
config.views.wikified.defaultText = ""; // default is "The tiddler '%0' doesn't yet exist. Double-click to create it"
//}}}
++++[/etc/sysconfig/network-scripts/ifcfg-eth0]>
/*{{{*/
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.254
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
ONBOOT=yes
/*}}}*/
*@@¡Puede estar triplicado!@@, si hemos usado la herramienta de configuración gráfica, triplica el fichero:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/networking/devices/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/ifcfg-eth0
*Resuelve el potencial problema creando un enlace duro entre los tres, pero se puede romper el enlace. Para comprobar que está bien, hay que ejecutar {{{locate -r ifcfg-eth0$ | xargs ls -i1}}} y ver que los tres ficheros tienen el mismo inodo. En caso de que esté mal, hay que rehacer de forma manual el enlace duro.
*Para rehacer el enlace duro, primero borramos los dos ficheros creados por la herramienta gráfica: {{{rm -f /etc/sysconfig/networking/devices/ifcfg-eth0 /etc/sysconfig/networking/profiles/default/ifcfg-eth0}}} . Y después rehacemos los enlaces duros volviendo a ejecutar la herramienta gráfica o con las órdenes:
**{{{ln /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/networking/devices/ifcfg-eth0}}}
**{{{ln /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/networking/profiles/default/ifcfg-eth0}}}
===
++++[/etc/sysconfig/network]>
/*{{{*/
NETWORKING=yes
HOSTNAME=server1.example.com
GATEWAY=192.168.0.254
NISDOMAIN=notexample
/*}}}*/
===
++++[/etc/resolv.conf]>
/*{{{*/
search example.com cracker.org
nameserver 192.168.0.254
nameserver 80.45.0.80
/*}}}*/
===
++++[/etc/hosts]>
/*{{{*/
127.0.0.1 localhost.localdomain localhost
192.168.0.254 server1.example.com server1
/*}}}*/
===
++++[/etc/nsswitch.conf]>
/*{{{*/
/etc/nsswitch.conf
/*}}}*/
===
++++[/etc/host.conf]>
/*{{{*/
order hosts,bind
/*}}}*/
===
* Pulsando CTRL+U borramos toda la línea del prompt.
* Pulsando CTRL+R buscamos en el histórico de comandos.
* Pulsando CTRL+L limpiamos la pantalla sin limpiar la línea del prompt.
* Pulsando CTRL+D salimos del entorno actual (es lo mismo que teclear {{{exit}}}).
/***
|''Name:''|CryptoFunctionsPlugin|
|''Description:''|Support for cryptographic functions|
***/
//{{{
if(!version.extensions.CryptoFunctionsPlugin) {
version.extensions.CryptoFunctionsPlugin = {installed:true};
//--
//-- Crypto functions and associated conversion routines
//--
// Crypto "namespace"
function Crypto() {}
// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
{
var be = Array();
var len = Math.floor(str.length/4);
var i, j;
for(i=0, j=0; i<len; i++, j+=4) {
be[i] = ((str.charCodeAt(j)&0xff) << 24)|((str.charCodeAt(j+1)&0xff) << 16)|((str.charCodeAt(j+2)&0xff) << 8)|(str.charCodeAt(j+3)&0xff);
}
while (j<str.length) {
be[j>>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
j++;
}
return be;
};
// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
{
var str = "";
for(var i=0;i<be.length*32;i+=8)
str += String.fromCharCode((be[i>>5]>>>(24-i%32)) & 0xff);
return str;
};
// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
{
var hex = "0123456789ABCDEF";
var str = "";
for(var i=0;i<be.length*4;i++)
str += hex.charAt((be[i>>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
return str;
};
// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
{
return Crypto.be32sToHex(Crypto.sha1Str(str));
};
// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
{
return Crypto.sha1(Crypto.strToBe32s(str),str.length);
};
// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
{
// Add 32-bit integers, wrapping at 32 bits
add32 = function(a,b)
{
var lsw = (a&0xFFFF)+(b&0xFFFF);
var msw = (a>>16)+(b>>16)+(lsw>>16);
return (msw<<16)|(lsw&0xFFFF);
};
// Add five 32-bit integers, wrapping at 32 bits
add32x5 = function(a,b,c,d,e)
{
var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
return (msw<<16)|(lsw&0xFFFF);
};
// Bitwise rotate left a 32-bit integer by 1 bit
rol32 = function(n)
{
return (n>>>31)|(n<<1);
};
var len = blen*8;
// Append padding so length in bits is 448 mod 512
x[len>>5] |= 0x80 << (24-len%32);
// Append length
x[((len+64>>9)<<4)+15] = len;
var w = Array(80);
var k1 = 0x5A827999;
var k2 = 0x6ED9EBA1;
var k3 = 0x8F1BBCDC;
var k4 = 0xCA62C1D6;
var h0 = 0x67452301;
var h1 = 0xEFCDAB89;
var h2 = 0x98BADCFE;
var h3 = 0x10325476;
var h4 = 0xC3D2E1F0;
for(var i=0;i<x.length;i+=16) {
var j,t;
var a = h0;
var b = h1;
var c = h2;
var d = h3;
var e = h4;
for(j = 0;j<16;j++) {
w[j] = x[i+j];
t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=16;j<20;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=20;j<40;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=40;j<60;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=60;j<80;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
h0 = add32(h0,a);
h1 = add32(h1,b);
h2 = add32(h2,c);
h3 = add32(h3,d);
h4 = add32(h4,e);
}
return Array(h0,h1,h2,h3,h4);
};
}
//}}}
/***
|''Name:''|DeprecatedFunctionsPlugin|
|''Description:''|Support for deprecated functions removed from core|
***/
//{{{
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};
//--
//-- Deprecated code
//--
// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
};
// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = function(w)
{
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var text = lookaheadMatch[1];
if(config.browser.isIE)
text = text.replace(/\n/g,"\r");
createTiddlyElement(w.output,"pre",null,null,text);
w.nextMatch = lookaheadRegExp.lastIndex;
}
};
// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)
{
createTiddlyElement(place,"br");
};
// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
var i = this.indexOf(item);
return i == -1 ? null : i;
};
// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
return store.getLoader().internalizeTiddler(store,this,title,divRef);
};
// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
return store.getSaver().externalizeTiddler(store,this);
};
// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
return store.allTiddlersAsHtml();
}
// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
refreshPageTemplate(title);
}
// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)
{
story.displayTiddlers(srcElement,titles,template,animate);
}
// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)
{
story.displayTiddler(srcElement,title,template,animate);
}
// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;
// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");
}
//}}}
El módulo ''usb_storage'' es el que se encarga de gestionar los dispositivos USB de almacenamiento. Para impedir el uso de estos dispositivos en el sistema, tenemos que deshabilitar este módulo.
En el fichero /etc/modprobe.conf añadimos la siguiente linea:
{{{
install usb_storage wall "Los dispositivos de almacenamiento USB han sido deshabilitados" && /bin/false
}}}
Previo a esto tenemos que asegurarnos de que el módulo usb_storage no está cargado en memoria: rmmod usb_storage
Cada vez que enchufemos un pendrive o disco usb al sistema, mostrará el mensaje anterior y dará error, con lo que no se podrá sacar información del sistema mendiante ningún dispositivo USB.
Para cuando hagan ping a tu máquina, que no conteste. Hay dos formas:
* iptables -I OUTPUT -p icmp {{{--}}}icmp-type echo-reply -j DROP
* echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Generales:
*[img[imagenes/en.gif]] http://www.yolinux.com - Cientos de enlaces clasificados temáticamente
*[img[imagenes/en.gif]] http://www.tldp.org - The Linux Documentation Project
*[img[imagenes/en.gif]] http://bhami.com/rosetta.html - Equivalencias de comandos entre distintas versiones de UNIX
*[img[imagenes/en.gif]] http://www.linuxrsp.ru/win-lin-soft/table-eng.html - Tabla de equivalencias de software entre Windows y Linux
*[img[imagenes/en.gif]] http://www-130.ibm.com/developerworks/linux - Página de Linux de IBM
Red Hat:
*[img[imagenes/en.gif]] http://www.redhat.com - Red Hat Inc.
*[img[imagenes/es.gif]] http://www.redhat.es - Red Hat España
*[img[imagenes/es.gif]] http://www.redhat.es/training - Cursos oficiales Red Hat en España
*[img[imagenes/en.gif]] http://kbase.redhat.com/faq - Red Hat Knowledgebase
*[img[imagenes/en.gif]] http://www.redhat.com/magazine - Red Hat Magazine
*[img[imagenes/en.gif]] http://www.redhat.com/docs - Documentación de Red Hat
*[img[imagenes/en.gif]] http://www.redhat.com/security - Seguridad en Red Hat Enterprise Linux
*[img[imagenes/en.gif]] ftp://ftp.redhat.com/pub/redhat/linux/updates/enterprise/ - Fuentes de Red Hat Enterprise Linux
*[img[imagenes/en.gif]] http://www.centos.org/ - CentOS, Clon libre de Red Hat Enterprise Linux
*[img[imagenes/en.gif]] https://projects.centos.org/trac/livecd/ - ~LiveCd de ~CentOS 5.1, clon libre de Red Hat Enterprise Linux 5 Update 1
*[img[imagenes/en.gif]] http://download.packages.ro/metalink/centos/ - metalinks ( http://en.wikipedia.org/wiki/Metalink ) para bajarse CentOS
Fedora:
*[img[imagenes/en.gif]] http://fedoraproject.org/wiki/ - Fedora Project
*[img[imagenes/en.gif]] http://www.fedorafaq.org/ - FAQ no oficial de configuración de Fedora
*[img[imagenes/en.gif]] http://easylinux.info/wiki/Fedora_frog - Script automático para configurar Fedora
*[img[imagenes/en.gif]] http://download.packages.ro/metalink/fedora/ - metalinks ( http://en.wikipedia.org/wiki/Metalink ) para bajarse Fedora
Repositorios para RHEL:
*[img[imagenes/en.gif]] http://fedoraproject.org/wiki/EPEL - Extra Packages for Enterprise Linux (EPEL)
*[img[imagenes/es.gif]] http://www.alcancelibre.org/staticpages/index.php/al-desktop - AL Desktop (Alcance libre)
*[img[imagenes/en.gif]] http://wiki.centos.org/Repositories - ~CentOS
Revistas:
*[img[imagenes/es.gif]] http://barrapunto.com - Barrapunto.com
*[img[imagenes/es.gif]] http://www.diariolinux.com - ~DiarioLinux
*[img[imagenes/es.gif]] http://www.todo-linux.com/index.php - ~Todo-Linux
*[img[imagenes/es.gif]] http://www.linuxjuegos.com - Juegos para Linux
/%
*[img[imagenes/es.gif]]
*[img[imagenes/en.gif]]
%/
* Página de Red Hat acerca del examen:
** https://www.redhat.com/training/rhce/examprep.html
* Información general sobre el Examen RHCE/RHCT:
** Es total y absolutamente práctico, no hay ninguna parte de teoria.
** Está dividido en dos secciones:
*** Una sección de troubleshooting, de resolución de problemas. Se corrige en el momento, y se dice la nota. Se puede corregir todas las veces que se quiera, pero siempre después de rebotar la máquina.
*** Una sección de instalación y configuración de un servidor desde cero (la máquina estará completamente vacia). Se corrige cuando todo el mundo haya acabado y NO se dice la nota en el momento. Cuando esta sección se acaba, la gente se puede ir directamente. El resultado se empaqueta, se encripta y se manda a Red Hat. Normalmente, esa misma tarde/noche se tiene el resultado en el email proporcionado por el propio examinado.
** Dentro del examen RHCE, está el RHCT imbuido. Esto implica que alguien que se presente al examen RHCE, si no lo aprueba, todavía podría sacarse el título RHCT si pasa la parte correspondiente. En todo momento se indica que problemas pertenecen a cada título.
** Para el examen solo se permite llevar un bolígrafo. Se proporcionará a los alumnos papel para que puedan escribir todo lo que quieran en él, pero luego ese papel se lo queda el examinador. No se permite nada más.
** El DVD de documentación oficial de Red Hat Enterprise Linux estará en todo momento accesible a través de la red. Se puede consultar siempre que se quiera (a menos que la máquina no tenga red en ese momento).
** El DVD de instalación oficial de Red Hat Enterprise Linux estará en todo momento accesible a través de la red. Se podrá acceder a los RPM siempre que se quiera (a menos que la máquina no tenga red en ese momento).
** La red se monitoriza para evitar conexiones no autorizadas.
* Para pasar el examen se necesita lo siguiente:
** ''RHCT'':
*** Troubleshooting: 5 problemas en una hora, hay que resolver el 100%.
*** Instalación: Conseguir un 70% en 2 horas.
** ''RHCE'':
*** Troubleshooting: 5 problemas en una hora, hay que resolver el 100%. Hay 5 problemas más, de los cuales hay que resolver un 60% (3) en hora y media. Es decir, en total hay que resolver el 80% de los 10 problemas propuestos en las 2 horas y media de tiempo total, de los cuales los 5 primeros son obligatorios dentro de la primera hora. Si sólo se sacan los 5 obligatorios, solo se podrá aspirar al título RHCT.
*** Instalación: Conseguir un 70% de la parte RHCT y un 70% de la parte RHCE en 3 horas. No compensa la nota, si se saca un 69% y un 100% respectivamente se tiene el examen completamente suspendido y no se consigue ningún título. Si en la sección de troubleshooting solo se han conseguido los 5 obligatorios, la parte RHCE de esta sección no cuenta para nada.
* Duración total del examen:
** ''RHCT'':
*** Empezar, repartir hojas, leerlas y resolver dudas: 20-30 minutos
*** Troubleshooting: 1 hora
*** Corrección, preparación siguiente parte: 10-20 minutos
*** Repatir hojas, leerlas y resolver dudas: 15-20 minutos
*** Instalación: 2 horas
*** ''Tiempo total'': 3:45h - 4:15h. Si se empieza a las 9:00h, a las 13:00h normalmente se ha acabado
** ''RHCE'':
*** Empezar, repartir hojas, leerlas y resolver dudas: 20-30 minutos
*** Troubleshooting: 2:30 horas
*** Corrección, preparación siguiente parte: 10-20 minutos
*** Repatir hojas, leerlas y resolver dudas: 30-40 minutos
*** Instalación: 3 horas
*** ''Tiempo total'': 6:30h - 7:00h. Si se empieza a las 9:00h, a las 16:00h normalmente se ha acabado, teniendo en cuenta que no hay pausa para comer. Recomiendo llevarse algo para picar, o incluso también, alguna bebida energética.
* Consejos generales acerca del examen:
** El examen no es dificil en sí, pero si que hay que hacer muchas cosas en relativamente poco tiempo. Es absolutamente vital tener soltura con el sistema, sobre todo con la [[Ayuda del sistema]]. Si se da un día para hacer el examen, prácticamente todo el mundo lo pasaría, pero si se pierde demasiado tiempo buscando las cosas no se aprobará.
** El examen RHCT es relativamente fácil, pero el RHCE es bastante difícil. Suelen aprobar un 95% y un 40% de la gente respectivamente, siempre que hayan asistido al curso asociado a cada examen. Si no se ha asistido a ningún curso, el porcentaje de gente que aprueba el RHCE a la primera es del 5%.
** Dominar las herramientas de [[Ayuda del sistema]] de Red Hat Enterprise Linux es vital.
Resumen de las expresiones regulares, conocidas como "regex":
{{{
^ principio de linea
$ final de linea
. un caracter cualquiera
? 0 o 1 veces el caracter anterior
* 0 o más veces el caracter anterior
+ 1 o más veces el caracter anterior
[ ] caracter contenido en los corchetes
[^ ] caracter no contenido en los corchetes
[x-y] caracter contenido en el rango x-y
\ escapar un caracter
\< principio de palabra
\> final de palabra (seguido por un signo de puntuación,
un espacio o un salto)
x|y el caracter x o el y
( ) agrupa caracteres
( ) \1 el contenido entre los paréntesis se
referenciará más tarde como \1 (así hasta 9)
ejemplos:
(espaci)o \1ado --> espacio espaciado
(bar)(ce)(lo)(na): al \1 a \2\4r y \2\1 -->
barcelona: al bar a cenar y cebar
x{m} m x's consecutivas
x{m,} m x's consecutivas o más
x{m,n} entre m y n x's
Nota: el espacio en blanco se puede poner tal cual, no hay que escaparlo
1,$s/perro/gato/g desde la línea 1 hasta el final ($) substituye (s) perro por
gato sin preguntar uno a uno (g - globalmente)
1,$s/\(Juan\) y \(Ana\)/\2 y \1/g substituye "Juan y Ana" por "Ana y Juan" en
todo el documento
/origen/,/destino/s/perro/gato/g substituye perro por gato desde la línea que
aparece por primera vez "origen" hasta la línea que aparece por primera vez
"destino" después de aparecido "origen".
Caracteres:
[[:alnum:]] alfanuméricos (depende del idioma configurado)
[[:alpha:]] alfabéticos (depende del idioma configurado)
[[:lower:]] minúsculas (depende del idioma configurado)
[[:upper:]] mayúsculas (depende del idioma configurado)
[[:digit:]] dígitos
[[:xdigit:]] dígitos hexadecimales
[[:blank:]] espacio o tabulador
[[:space:]] blancos (espacio, tabuladores, cambio de línea, retorno de carro...)
[[:graph:]] no blancos
[[:print:]] como graph, pero incluye el espacio en blanco
[[:punct:]] de puntuación
[[:cntrl:]] control
\w [a-zA-Z0-9_] (también incluye el _)
\W [^a-zA-Z0-9_] (también incluye el _)
\b solo la palabra entre \b's
}}}
This "empty" TiddlyWiki file contains the latest <<version>> version of TiddlyWiki as well as all [[Plugins]] and [[Styles]] that give http://TiddlyWikiTips.com its look and feel.
To get started with this blank TiddlyWiki, you'll want to modify the following tiddlers:
* SiteTitle & SiteSubtitle: This is the title and subtitle of the site, as shown above. (After saving, they will also appear in the browser title bar.)
* MainMenu: The menu at the top, below the Title.
* DefaultTiddlers: Contains the names of all tiddlers that you want to appear when the TiddlyWiki is opened.
* SideBarOptions: This contains the definitions for the sidebar buttons and sliders on the right.
Bienvenidos, este TiddlyWiki está completamente dedicado a Red Hat Enterprise Linux. En él encontrarás información práctica acerca del sistema, así como enlaces y trucos.
Este sitio está en permanente construcción.
/***
|''Name:''|LegacyStrikeThroughPlugin|
|''Description:''|Support for legacy (pre 2.1) strike through formatting|
|''Version:''|1.0.2|
|''Date:''|Jul 21, 2006|
|''Source:''|http://www.tiddlywiki.com/#LegacyStrikeThroughPlugin|
|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''License:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.0|
***/
//{{{
// Ensure that the LegacyStrikeThrough Plugin is only installed once.
if(!version.extensions.LegacyStrikeThroughPlugin) {
version.extensions.LegacyStrikeThroughPlugin = {installed:true};
config.formatters.push(
{
name: "legacyStrikeByChar",
match: "==",
termRegExp: /(==)/mg,
element: "strike",
handler: config.formatterHelpers.createElementAndWikify
});
} //# end of "install only once"
//}}}
<<defaultHome>>[[SiteMap]][[Tags]][[Enlaces]][[Ruiz-Tapiador]][[TiddlyWiki]]<<version>>
/***
''NestedSlidersPlugin for TiddlyWiki version 1.2.x and 2.0''
^^author: Eric Shulman
source: http://www.TiddlyTools.com/#NestedSlidersPlugin
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^
Quickly make any tiddler content into an expandable 'slider' panel, without needing to create a separate tiddler to contain the slider content. Optional syntax allows ''default to open'', ''custom button label/tooltip'' and ''automatic blockquote formatting.''
You can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created. This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.
For more details, please click on a section headline below:
++++!!!!![Configuration]>
Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
===
++++!!!!![Usage]>
When installed, this plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content. Use {{{+++}}} and {{{===}}} to delimit the slider content. Additional optional syntax elements let you specify
*default to open
*cookiename
*heading level
*floater
*rollover
*custom label/tooltip
*automatic blockquote
*deferred rendering
The complete syntax, using all options, is:
//{{{
++++(cookiename)!!!!!^*[label|tooltip]>...
content goes here
===
//}}}
where:
* {{{+++}}} (or {{{++++}}}) and {{{===}}}^^
marks the start and end of the slider definition, respectively. When the extra {{{+}}} is used, the slider will be open when initially displayed.^^
* {{{(cookiename)}}}^^
saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.^^
* {{{!}}} through {{{!!!!!}}}^^
displays the slider label using a formatted headline (Hn) style instead of a button/link style^^
* {{{"^"}}} //(without the quotes)//^^
makes the slider 'float' on top of other content rather than shifting that content downward^^
* {{{"*"}}} //(without the quotes)//^^
automatically opens/closes slider on "rollover" as well as when clicked^^
* {{{[label]}}} or {{{[label|tooltip]}}}^^
uses custom label/tooltip. (defaults are: ">" (more) and "<" (less)^^
* {{{">"}}} //(without the quotes)//^^
automatically adds blockquote formatting to slider content^^
* {{{"..."}}} //(without the quotes)//^^
defers rendering of closed sliders until the first time they are opened. //Note: deferred rendering may produce unexpected results in some cases. Use with care.//^^
//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
===
++++!!!!![Examples]>
simple in-line slider:
{{{
+++
content
===
}}}
+++
content
===
----
use a custom label and tooltip:
{{{
+++[label|tooltip]
content
===
}}}
+++[label|tooltip]
content
===
----
content automatically blockquoted:
{{{
+++>
content
===
}}}
+++>
content
===
----
all options combined //(default open, cookie, heading, floater, rollover, label/tooltip, blockquoted, deferred)//
{{{
++++(testcookie)!!!^*[label|tooltip]>...
content
===
}}}
++++(testcookie)!!!^*[label|tooltip]>...
content
===
----
complex nesting example:
{{{
+++^[get info...|click for information]
put some general information here, plus a floating slider with more specific info:
+++^[view details...|click for details]
put some detail here, which could include a rollover with a +++^*[glossary definition]explaining technical terms===
===
===
}}}
+++^[get info...|click for information]
put some general information here, plus a floating slider with more specific info:
+++^[view details...|click for details]
put some detail here, which could include a rollover with a +++^*[glossary definition]explaining technical terms===
===
===
----
nested floaters
>menu: <<tiddler SiteUrl>>
(see [[NestedSlidersExample]] for definition)
----
===
+++!!!!![Installation]>
import (or copy/paste) the following tiddlers into your document:
''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)
===
+++!!!!![Revision History]>
++++[2006.02.16 - 1.7.7]
corrected deferred rendering to account for use-case where show/hide state is tracked in a cookie
===
++++[2006.02.15 - 1.7.6]
in adjustSliderPos(), ensure that floating panel is positioned completely within the browser window (i.e., does not go beyond the right edge of the browser window)
===
++++[2006.02.04 - 1.7.5]
add 'var' to unintended global variable declarations to avoid FireFox 1.5.0.1 crash bug when assigning to globals
===
++++[2006.01.18 - 1.7.4]
only define adjustSliderPos() function if it has not already been provided by another plugin. This lets other plugins 'hijack' the function even when they are loaded first.
===
++++[2006.01.16 - 1.7.3]
added adjustSliderPos(place,btn,panel,panelClass) function to permit specialized logic for placement of floating panels. While it provides improved placement for many uses of floating panels, it exhibits a relative offset positioning error when used within *nested* floating panels. Short-term workaround is to only adjust the position for 'top-level' floaters.
===
++++[2006.01.16 - 1.7.2]
added button property to slider panel elements so that slider panel can tell which button it belongs to. Also, re-activated and corrected animation handling so that nested sliders aren't clipped by hijacking Slider.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
===
++++[2006.01.14 - 1.7.1]
added optional "^" syntax for floating panels. Defines new CSS class, ".floatingPanel", as an alternative for standard in-line ".sliderPanel" styles.
===
++++[2006.01.14 - 1.7.0]
added optional "*" syntax for rollover handling to show/hide slider without requiring a click (Based on a suggestion by tw4efl)
===
+++[2006.01.03 - 1.6.2]
When using optional "!" heading style, instead of creating a clickable "Hn" element, create an "A" element inside the "Hn" element. (allows click-through in SlideShowPlugin, which captures nearly all click events, except for hyperlinks)
===
+++[2005.12.15 - 1.6.1]
added optional "..." syntax to invoke deferred ('lazy') rendering for initially hidden sliders
removed checkbox option for 'global' application of lazy sliders
===
+++[2005.11.25 - 1.6.0]
added optional handling for 'lazy sliders' (deferred rendering for initially hidden sliders)
===
+++[2005.11.21 - 1.5.1]
revised regular expressions: if present, a single newline //preceding// and/or //following// a slider definition will be suppressed so start/end syntax can be place on separate lines in the tiddler 'source' for improved readability. Similarly, any whitespace (newlines, tabs, spaces, etc.) trailing the 'start slider' syntax or preceding the 'end slider' syntax is also suppressed.
===
+++[2005.11.20 - 1.5.0]
added (cookiename) syntax for optional tracking and restoring of slider open/close state
===
+++[2005.11.11 - 1.4.0]
added !!!!! syntax to render slider label as a header (Hn) style instead of a button/link style
===
+++[2005.11.07 - 1.3.0]
removed alternative syntax {{{(((}}} and {{{)))}}} (so they can be used by other
formatting extensions) and simplified/improved regular expressions to trim multiple excess newlines
===
+++[2005.11.05 - 1.2.1]
changed name to NestedSlidersPlugin
more documentation
===
+++[2005.11.04 - 1.2.0]
added alternative character-mode syntax {{{(((}}} and {{{)))}}}
tweaked "eat newlines" logic for line-mode {{{+++}}} and {{{===}}} syntax
===
+++[2005.11.03 - 1.1.1]
fixed toggling of default tooltips ("more..." and "less...") when a non-default button label is used
code cleanup, added documentation
===
+++[2005.11.03 - 1.1.0]
changed delimiter syntax from {{{(((}}} and {{{)))}}} to {{{+++}}} and {{{===}}}
changed name to EasySlidersPlugin
===
+++[2005.11.03 - 1.0.0]
initial public release
===
===
+++!!!!![Credits]>
This feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with research, programming and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson
===
***/
// //+++!!!!![Code]
//{{{
version.extensions.nestedSliders = {major: 1, minor: 7, revision: 7, date: new Date(2006,2,16)};
//}}}
//{{{
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;
if (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;
// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
//}}}
//{{{
config.formatters.push( {
name: "nestedSliders",
match: "\\n?\\+{3}",
terminator: "\\s*\\={3}\\n?",
lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^)?(\\*)?(\\[[^\\]]*\\])?(\\>)?(\\.\\.\\.)?\\s*",
handler: function(w)
{
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
// location for rendering button and panel
var place=w.output;
// default to closed, no cookie
var show="none"; var title=">"; var tooltip="show"; var cookie="";
// extra "+", default to open
if (lookaheadMatch[1])
{ show="block"; title="<"; tooltip="hide"; }
// cookie, use saved open/closed state
if (lookaheadMatch[2]) {
cookie=lookaheadMatch[2].trim().substr(1,lookaheadMatch[2].length-2);
cookie="chkSlider"+cookie;
if (config.options[cookie]==undefined)
{ config.options[cookie] = (show=="block") }
if (config.options[cookie])
{ show="block"; title="<"; tooltip="hide"; }
else
{ show="none"; title=">"; tooltip="show"; }
}
// custom label/tooltip
if (lookaheadMatch[6]) {
title = lookaheadMatch[6].trim().substr(1,lookaheadMatch[6].length-2);
var pos=title.indexOf("|");
if (pos!=-1)
{ tooltip = title.substr(pos+1,title.length); title = title.substr(0,pos); }
else
{ tooltip += " "+title; }
}
// create the button
if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link
var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;
var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,null,title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
}
else
var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider);
btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
// "non-click" MouseOver open/close slider
if (lookaheadMatch[5]) btn.onmouseover=onClickNestedSlider;
// create slider panel
var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";
var panel=createTiddlyElement(place,"div",null,panelClass,null);
panel.style.display = show;
panel.button = btn; // so the slider panel know which button it belongs to
btn.sliderPanel=panel;
// render slider (or defer until shown)
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if ((show=="block")||!lookaheadMatch[8]) {
// render now if panel is supposed to be shown or NOT deferred rendering
w.subWikify(lookaheadMatch[7]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
// align slider/floater position with button
adjustSliderPos(place,btn,panel,panelClass);
}
else {
var src = w.source.substr(w.nextMatch);
var endpos=findMatchingDelimiter(src,"+++","===");
panel.setAttribute("raw",src.substr(0,endpos));
panel.setAttribute("blockquote",lookaheadMatch[7]?"true":"false");
panel.setAttribute("rendered","false");
w.nextMatch += endpos+3;
if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\n\n"+panel.getAttribute("raw"));
}
}
}
}
)
// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)
function findMatchingDelimiter(src,starttext,endtext) {
var startpos = 0;
var endpos = src.indexOf(endtext);
// check for nested delimiters
while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
// count number of nested 'starts'
var startcount=0;
var temp = src.substring(startpos,endpos-1);
var pos=temp.indexOf(starttext);
while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
// set up to check for additional 'starts' after adjusting endpos
startpos=endpos+endtext.length;
// find endpos for corresponding number of matching 'ends'
while (startcount && endpos!=-1) {
endpos = src.indexOf(endtext,endpos+endtext.length);
startcount--;
}
}
return (endpos==-1)?src.length:endpos;
}
//}}}
//{{{
function onClickNestedSlider(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var theLabel = theTarget.firstChild.data;
var theSlider = theTarget.sliderPanel
var isOpen = theSlider.style.display!="none";
// if using default button labels, toggle labels
if (theLabel==">") theTarget.firstChild.data = "<";
else if (theLabel=="<") theTarget.firstChild.data = ">";
// if using default tooltips, toggle tooltips
if (theTarget.getAttribute("title")=="show")
theTarget.setAttribute("title","hide");
else if (theTarget.getAttribute("title")=="hide")
theTarget.setAttribute("title","show");
if (theTarget.getAttribute("title")=="show "+theLabel)
theTarget.setAttribute("title","hide "+theLabel);
else if (theTarget.getAttribute("title")=="hide "+theLabel)
theTarget.setAttribute("title","show "+theLabel);
// deferred rendering (if needed)
if (theSlider.getAttribute("rendered")=="false") {
if (config.options.chkDebugLazySliderRender)
alert("rendering '"+theLabel+"':\n\n"+theSlider.getAttribute("raw"));
var place=theSlider;
if (theSlider.getAttribute("blockquote")=="true")
place=createTiddlyElement(place,"blockquote");
wikify(theSlider.getAttribute("raw"),place);
theSlider.setAttribute("rendered","true");
}
// show/hide the slider
if(config.options.chkAnimate)
anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
else
theSlider.style.display = isOpen ? "none" : "block";
if (this.sliderCookie && this.sliderCookie.length)
{ config.options[this.sliderCookie]=!isOpen; saveOptionCookie(this.sliderCookie); }
// align slider/floater position with target button
adjustSliderPos(theSlider.parentNode,theTarget,theSlider,theSlider.className);
return false;
}
// hijack animation handler 'stop' handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function() { this.coreStop(); this.element.style.overflow = "visible"; }
// adjust panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel,panelClass) {
///////////////////////////////////////////////////////////////////////////////
/// EXPERIMENTAL HACK - WORKS IN SOME CASES, NOT IN OTHERS
///////////////////////////////////////////////////////////////////////////////
// "if this panel is floating and the parent is not also a floating panel"...
if (panelClass=="floatingPanel" && place.className!="floatingPanel") {
var left=0; var top=btn.offsetHeight;
if (place.style.position!="relative") { left+=findPosX(btn); top+=findPosY(btn); }
if (left+panel.offsetWidth > getWindowWidth()) left=getWindowWidth()-panel.offsetWidth-10;
panel.style.left=left+"px"; panel.style.top=top+"px";
}
}
function getWindowWidth() {
if(document.width!=undefined)
return document.width; // moz (FF)
if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
return document.documentElement.clientWidth; // IE6
if(document.body && ( document.body.clientWidth || document.body.clientHeight ) )
return document.body.clientWidth; // IE4
if(window.innerWidth!=undefined)
return window.innerWidth; // IE - general
return 0; // unknown
}
//}}}
// //===
These Interface Options for customising TiddlyWiki are saved in your browser
Your username for signing your edits. Write it as a ~WikiWord (eg [[Linus Torvalds]])
<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations
See AdvancedOptions
Para cambiar la línea del prompt, cambiar la variable PS1:
{{{
PS1="\e[0;31m\n-=[`id -u` \u@\h \D{%a%d%b} \t \w]=-\e[0;0m\n\\$ "
PS1="\e[0;0m\n \e[0;31m\u(`id -u`)\e[1;31m\h\e[0;31m \t-\D{%a/%d/%b} \w\e[0;0m\n· "
}}}
<div class='header' macro='gradient vert #000 #069'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
</div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
*iptables -I INPUT -p icmp {{{--}}}icmp-type echo-reply -j ACCEPT
*iptables -I OUTPUT -p icmp {{{--}}}icmp-type echo-request -j ACCEPT
function onClickDefaultHome(e) {
story.closeAllTiddlers();
config.options.txtDefaultTiddlers = "";
saveOptionCookie('txtDefaultTiddlers');
var start = store.getTiddlerText("DefaultTiddlers");
if(start)
story.displayTiddlers(null,start.readBracketedList());
}
config.macros["defaultHome"] = {label: "Home", prompt: "Show the default tiddlers", title: "Home"};
config.macros.defaultHome.handler = function(place) {
createTiddlyButton(place,this.label,this.prompt,onClickDefaultHome);
}
/***
''Import Tiddlers Plugin for TiddlyWiki version 1.2.x and 2.0''
^^author: Eric Shulman - ELS Design Studios
source: http://www.TiddlyTools.com/#ImportTiddlersPlugin
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^
When many people share and edit copies of the same TiddlyWiki document, the ability to quickly collect all these changes back into a single, updated document that can then be redistributed to the entire group is very important. This plugin lets you selectively combine tiddlers from any two TiddlyWiki documents. It can also be very useful when moving your own tiddlers from document to document (e.g., when upgrading to the latest version of TiddlyWiki, or 'pre-loading' your favorite stylesheets into a new 'empty' TiddlyWiki document.)
!!!!!Inline interface (live)
<<<
<<importTiddlers inline>>
<<<
!!!!!Macro Syntax
<<<
{{{<<importTiddlers>>}}}
creates "import tiddlers" link. click to show/hide import control panel
{{{<<importTiddlers inline>>}}}
creates import control panel directly in tiddler content
{{{<<importTiddlers filter source quiet ask>>}}}
non-interactive 'automatic' import.
''filter'' determines which tiddlers will be automatically selected for importing. Use one of the following keywords:
>''"new"'' retrieves only tiddlers that are found in the import source document, but do not yet exist in the destination document
>''"changes"'' retrieves only tiddlers that exist in both documents for which the import source tiddler is newer than the existing tiddler
>''"updates"'' retrieves both ''new'' and ''changed'' tiddlers (this is the default action when none is specified)
>''"all"'' retrieves ALL tiddlers from the import source document, even if they have not been changed.
''source'' is the location of the imported document. It can be either a local document or an URL:
>filename is any local path/file, in whatever format your system requires
>URL is any remote web location that starts with "http://" or "https://"
''"quiet"'' (optional)
>supresses all status message during the import processing (e.g., "opening local file...", "found NN tiddlers..." etc). Note that if ANY tiddlers are actualy imported, a final information message will still be displayed (along with the ImportedTiddlers report), even when 'quiet' is specified. This ensures that changes to your document cannot occur without any visible indication at all.
''"ask"'' (optional)
>adds interactive confirmation. A browser message box (OK/Cancel) is displayed for each tiddler that will be imported, so that you can manually bypass any tiddlers that you do not want to import.
''Special tag values: importReplace and importPublic''
By adding these special tags to an existing tiddler, you can precisely control whether or not to allow updates to that tiddler as well as decide which tiddlers in your document can be automatically imported by others.
*''For maximum safety, the default action is to prevent existing tiddlers from being unintentionally overwritten by incoming tiddlers.'' To allow an existing tiddler to be overwritten by an imported tiddler, you must tag the existing tiddler with ''<<tag importReplace>>''
*''For maximum privacy, the default action for //outgoing// tiddlers is to NOT automatically share your tiddlers with others.'' To allow a tiddler in your document to be shared via auto-import actions by others, you must tag it with ''<<tag importPublic>>''
//Note: these tags are only applied when using the auto-import processing. When using the interactive control panel, all tiddlers in the imported document are available in the listbox, regardless of their tag values.//
<<<
!!!!!Interactive Usage
<<<
When used interactively, a control panel is displayed consisting of an "import source document" filename input (text field plus a ''[Browse...]'' button), a listbox of available tiddlers, a "differences only" checkbox, an "add tags" input field and four push buttons: ''[open]'', ''[select all]'', ''[import]'' and ''[close]''.
Press ''[browse]'' to select a TiddlyWiki document file to import. You can also type in the path/filename or a remote document URL (starting with http://)and press ''[open]''. //Note: There may be some delay to permit the browser time to access and load the document before updating the listbox with the titles of all tiddlers that are available to be imported.//
Select one or more titles from the listbox (hold CTRL or SHIFT while clicking to add/remove the highlight from individual list items). You can press ''[select all]'' to quickly highlight all tiddler titles in the list. Use the ''[-]'', ''[+]'', or ''[=]'' links to adjust the listbox size so you can view more (or less) tiddler titles at one time. When you have chosen the tiddlers you want to import and entered any extra tags, press ''[import]'' to begin copying them to the current TiddlyWiki document.
''select: all, new, changes, or differences''
You can click on ''all'', ''new'', ''changes'', or ''differences'' to automatically select a subset of tiddlers from the list. This makes it very quick and easy to find and import just the updated tiddlers you are interested in:
>''"all"'' selects ALL tiddlers from the import source document, even if they have not been changed.
>''"new"'' selects only tiddlers that are found in the import source document, but do not yet exist in the destination document
>''"changes"'' selects only tiddlers that exist in both documents but that are newer in the source document
>''"differences"'' selects all new and existing tiddlers that are different from the destination document (even if destination tiddler is newer)
''Import Tagging:''
Tiddlers that have been imported can be automatically tagged, so they will be easier to find later on, after they have been added to your document. New tags are entered into the "add tags" input field, and then //added// to the existing tags for each tiddler as it is imported.
''Skip, Rename, Merge, or Replace:''
When importing a tiddler whose title is identical to one that already exists, the import process pauses and the tiddler title is displayed in an input field, along with four push buttons: ''[skip]'', ''[rename]'', ''[merge]'' and ''[replace]''.
To bypass importing this tiddler, press ''[skip]''. To import the tiddler with a different name (so that both the tiddlers will exist when the import is done), enter a new title in the input field and then press ''[rename]''. Press ''[merge]'' to combine the content from both tiddlers into a single tiddler. Press ''[replace]'' to overwrite the existing tiddler with the imported one, discarding the previous tiddler content.
//Note: if both the title ''and'' modification date/////time match, the imported tiddler is assumed to be identical to the existing one, and will be automatically skipped (i.e., not imported) without asking.//
''Import Report History''
When tiddlers are imported, a report is generated into ImportedTiddlers, indicating when the latest import was performed, the number of tiddlers successfully imported, from what location, and by whom. It also includes a list with the title, date and author of each tiddler that was imported.
When the import process is completed, the ImportedTiddlers report is automatically displayed for your review. If more tiddlers are subsequently imported, a new report is //added// to ImportedTiddlers, above the previous report (i.e., at the top of the tiddler), so that a reverse-chronological history of imports is maintained.
If a cumulative record is not desired, the ImportedTiddlers report may be deleted at any time. A new ImportedTiddlers report will be created the next time tiddlers are imported.
Note: You can prevent the ImportedTiddlers report from being generated for any given import activity by clearing the "create a report" checkbox before beginning the import processing.
<<<
!!!!!Installation
<<<
copy/paste the following tiddlers into your document:
''ImportTiddlersPlugin'' (tagged with <<tag systemConfig>>)
create/edit ''SideBarOptions'': (sidebar menu items)
^^Add "< < ImportTiddlers > >" macro^^
''Quick Installation Tip #1:''
If you are using an unmodified version of TiddlyWiki (core release version <<version>>), you can get a new, empty TiddlyWiki with the Import Tiddlers plugin pre-installed (''[[download from here|TW+ImportExport.html]]''), and then simply import all your content from your old document into this new, empty document.
<<<
!!!!!Revision History
<<<
''2006.02.17 [2.6.0]''
Removed "differences only" listbox display mode, replaced with selection filter 'presets': all/new/changes/differences. Also fixed initialization handling for "add new tags" so that checkbox state is correctly tracked when panel is first displayed.
''2006.02.16 [2.5.4]''
added checkbox options to control "import remote tags" and "keep existing tags" behavior, in addition to existing "add new tags" functionality.
''2006.02.14 [2.5.3]''
FF1501 corrected unintended global 't' (loop index) in importReport() and autoImportTiddlers()
''2006.02.10 [2.5.2]''
corrected unintended global variable in importReport().
''2006.02.05 [2.5.1]''
moved globals from window.* to config.macros.importTiddlers.* to avoid FireFox 1.5.0.1 crash bug when referencing globals
''2006.01.18 [2.5.0]''
added checkbox for "create a report". Default is to create/update the ImportedTiddlers report. Clear the checkbox to skip this step.
''2006.01.15 [2.4.1]''
added "importPublic" tag and inverted default so that auto sharing is NOT done unless tagged with importPublic
''2006.01.15 [2.4.0]''
Added support for tagging individual tiddlers with importSkip, importReplace, and/or importPrivate to control which tiddlers can be overwritten or shared with others when using auto-import macro syntax. Defaults are to SKIP overwriting existing tiddlers with imported tiddlers, and ALLOW your tiddlers to be auto-imported by others.
''2006.01.15 [2.3.2]''
Added "ask" parameter to confirm each tiddler before importing (for use with auto-importing)
''2006.01.15 [2.3.1]''
Strip TW core scripts from import source content and load just the storeArea into the hidden IFRAME. Makes loading more efficient by reducing the document size and by preventing the import document from executing its TW initialization (including plugins). Seems to resolve the "Found 0 tiddlers" problem. Also, when importing local documents, use convertUTF8ToUnicode() to convert the file contents so support international characters sets.
''2006.01.12 [2.3.0]''
Reorganized code to use callback function for loading import files to support event-driven I/O via an ASYNCHRONOUS XMLHttpRequest. Let's processing continue while waiting for remote hosts to respond to URL requests. Added non-interactive 'batch' macro mode, using parameters to specify which tiddlers to import, and from what document source. Improved error messages and diagnostics, plus an optional 'quiet' switch for batch mode to eliminate //most// feedback.
''2006.01.11 [2.2.0]''
Added "[by tags]" to list of tiddlers, based on code submitted by BradleyMeck
''2006.01.09 [2.1.1]''
When a URL is typed in, and then the "open" button is pressed, it generates both an onChange event for the file input and a click event for open button. This results in multiple XMLHttpRequest()'s which seem to jam things up quite a bit. I removed the onChange handling for file input field. To open a file (local or URL), you must now explicitly press the "open" button in the control panel.
''2006.01.08 [2.1.0]''
IMPORT FROM ANYWHERE!!! re-write getImportedTiddlers() logic to either read a local file (using local I/O), OR... read a remote file, using a combination of XML and an iframe to permit cross-domain reading of DOM elements. Adapted from example code and techniques courtesy of Jonny LeRoy.
''2006.01.06 [2.0.2]''
When refreshing list contents, fixed check for tiddlerExists() when "show differences only" is selected, so that imported tiddlers that don't exist in the current file will be recognized as differences and included in the list.
''2006.01.04 [2.0.1]''
When "show differences only" is NOT checked, import all tiddlers that have been selected even when they have a matching title and date.
''2005.12.27 [2.0.0]''
Update for TW2.0
Defer initial panel creation and only register a notification function when panel first is created
''2005.12.22 [1.3.1]''
tweak formatting in importReport() and add 'discard report' link to output
''2005.12.03 [1.3.0]''
Dynamically create/remove importPanel as needed to ensure only one instance of interface elements exists, even if there are multiple instances of macro embedding. Also, dynamically create/recreate importFrame each time an external TW document is loaded for importation (reduces DOM overhead and ensures a 'fresh' frame for each document)
''2005.11.29 [1.2.1]''
fixed formatting of 'detail info' in importReport()
''2005.11.11 [1.2.0]''
added 'inline' param to embed controls in a tiddler
''2005.11.09 [1.1.0]''
only load HTML and CSS the first time the macro handler is called. Allows for redundant placement of the macro without creating multiple instances of controls with the same ID's.
''2005.10.25 [1.0.5]''
fixed typo in importReport() that prevented reports from being generated
''2005.10.09 [1.0.4]''
combined documentation with plugin code instead of using separate tiddlers
''2005.08.05 [1.0.3]''
moved CSS and HTML definitions into plugin code instead of using separate tiddlers
''2005.07.27 [1.0.2]''
core update 1.2.29: custom overlayStyleSheet() replaced with new core setStylesheet()
''2005.07.23 [1.0.1]''
added parameter checks and corrected addNotification() usage
''2005.07.20 [1.0.0]''
Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
// // Version
//{{{
version.extensions.importTiddlers = {major: 2, minor: 6, revision: 0, date: new Date(2006,2,17)};
//}}}
// // 1.2.x compatibility
//{{{
if (!window.story) window.story=window;
if (!store.getTiddler) store.getTiddler=function(title){return store.tiddlers[title]}
if (!store.addTiddler) store.addTiddler=function(tiddler){store.tiddlers[tiddler.title]=tiddler}
if (!store.deleteTiddler) store.deleteTiddler=function(title){delete store.tiddlers[title]}
//}}}
// // IE needs explicit global scoping for functions/vars called from browser events
//{{{
window.onClickImportButton=onClickImportButton;
window.loadImportFile=loadImportFile;
window.refreshImportList=refreshImportList;
//}}}
// // default cookie/option values
//{{{
if (!config.options.chkImportReport) config.options.chkImportReport=true;
//}}}
// // ''MACRO DEFINITION''
//{{{
config.macros.importTiddlers = { };
config.macros.importTiddlers = {
label: "import tiddlers",
prompt: "Copy tiddlers from another document",
countMsg: "%0 tiddlers selected for import",
src: "", // path/filename or URL of document to import
inbound: null, // hash-indexed array of tiddlers from other document
newTags: "", // text of tags added to imported tiddlers
addTags: true, // add new tags to imported tiddlers
listsize: 8, // # of lines to show in imported tiddler list
importTags: true, // include tags from remote source document when importing a tiddler
keepTags: true, // retain existing tags when replacing a tiddler
index: 0, // current processing index in import list
sort: "" // sort order for imported tiddler listbox
};
config.macros.importTiddlers.handler = function(place,macroName,params) {
// LINK WITH FLOATING PANEL
if (!params[0]) {
createTiddlyButton(place,this.label,this.prompt,onClickImportMenu);
return;
}
// INLINE TIDDLER CONTENT
if (params[0]=="inline") {
createImportPanel(place);
document.getElementById("importPanel").style.position="static";
document.getElementById("importPanel").style.display="block";
return;
}
// NON-INTERACTIVE BATCH MODE
switch (params[0]) {
case 'all':
case 'new':
case 'changes':
case 'updates':
var filter=params.shift();
break;
default:
var filter="updates";
break;
}
if (!params[0]||!params[0].length) return; // filename is required
config.macros.importTiddlers.src=params.shift();
var quiet=(params[0]=="quiet"); if (quiet) params.shift();
var ask=(params[0]=="ask"); if (ask) params.shift();
config.macros.importTiddlers.inbound=null; // clear the imported tiddler buffer
// load storeArea from a hidden IFRAME, then apply import rules and add/replace tiddlers
loadImportFile(config.macros.importTiddlers.src,filter,quiet,ask,autoImportTiddlers);
}
//}}}
// // ''READ TIDDLERS FROM ANOTHER DOCUMENT''
//{{{
function loadImportFile(src,filter,quiet,ask,callback) {
if (!quiet) clearMessage();
// LOCAL FILE
if ((src.substr(0,7)!="http://")&&(src.substr(0,8)!="https://")) {
if (!quiet) displayMessage("Opening local document: "+ src);
var txt=loadFile(src);
if(!txt) { if (!quiet) displayMessage("Could not open local document: "+src); }
else {
var s="<html><body>"+txt.substr(txt.indexOf('<div id="storeArea">'));
if (!quiet) displayMessage(txt.length+" bytes in document. ("+s.length+" bytes used for tiddler storage)");
config.macros.importTiddlers.inbound = readImportedTiddlers(convertUTF8ToUnicode(s));
var count=config.macros.importTiddlers.inbound?config.macros.importTiddlers.inbound.length:0;
if (!quiet) displayMessage("Found "+count+" tiddlers in "+src);
if (callback) callback(src,filter,quiet,ask);
}
return;
}
// REMOTE FILE
var x; // XML object
try {x = new XMLHttpRequest()}
catch(e) {
try {x = new ActiveXObject("Msxml2.XMLHTTP")}
catch (e) {
try {x = new ActiveXObject("Microsoft.XMLHTTP")}
catch (e) { return }
}
}
x.onreadystatechange = function() {
if (x.readyState == 4) {
if (x.status == 200) {
var sa="<html><body>"+x.responseText.substr(x.responseText.indexOf('<div id="storeArea">'));
if (!quiet) displayMessage(x.responseText.length+" bytes in document. ("+sa.length+" bytes used for tiddler storage)");
config.macros.importTiddlers.inbound = readImportedTiddlers(sa);
var count=config.macros.importTiddlers.inbound?config.macros.importTiddlers.inbound.length:0;
if (!quiet) displayMessage("Found "+count+" tiddlers in "+src);
if (callback) callback(src,filter,quiet,ask);
}
else
if (!quiet) displayMessage("Could not open remote document:"+ src+" (error="+x.status+")");
}
}
if (document.location.protocol=="file:") { // UniversalBrowserRead only works from a local file context
try {netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead')}
catch (e) { if (!quiet) displayMessage(e.description?e.description:e.toString()); }
}
if (!quiet) displayMessage("Opening remote document: "+ src);
try {
var url=src+(src.indexOf('?')<0?'?':'&')+'nocache='+Math.random();
x.open("GET",url,true);
x.overrideMimeType('text/html');
x.send(null);
}
catch (e) {
if (!quiet) {
displayMessage("Could not open remote document: "+src);
displayMessage(e.description?e.description:e.toString());
}
}
}
function readImportedTiddlers(txt)
{
var importedTiddlers = [];
// create frame
var f=document.getElementById("importFrame");
if (f) document.body.removeChild(f);
f=document.createElement("iframe");
f.id="importFrame";
f.style.width="0px"; f.style.height="0px"; f.style.border="0px";
document.body.appendChild(f);
// get document
var d=f.document;
if (f.contentDocument) d=f.contentDocument; // For NS6
else if (f.contentWindow) d=f.contentWindow.document; // For IE5.5 and IE6
// load source into document
d.open(); d.writeln(txt); d.close();
// read tiddler DIVs from storeArea DOM element
var importStore = [];
var importStoreArea = d.getElementById("storeArea");
if (!importStoreArea || !(importStore=importStoreArea.childNodes) || (importStore.length==0)) { return null; }
importStoreArea.normalize();
for(var t = 0; t < importStore.length; t++) {
var e = importStore[t];
var title = null;
if(e.getAttribute)
title = e.getAttribute("tiddler");
if(!title && e.id && (e.id.substr(0,5) == "store"))
title = e.id.substr(5);
if(title && title != "") {
var theImported = new Tiddler();
theImported.loadFromDiv(e,title);
importedTiddlers.push(theImported);
}
}
return importedTiddlers;
}
//}}}
// // ''NON-INTERACTIVE IMPORT''
// // import all/new/changed tiddlers into store, replacing or adding tiddlers as needed
//{{{
function autoImportTiddlers(src,filter,quiet,ask)
{
var count=0;
if (config.macros.importTiddlers.inbound) for (var t=0;t<config.macros.importTiddlers.inbound.length;t++) {
var theImported = config.macros.importTiddlers.inbound[t];
var theExisting = store.getTiddler(theImported.title);
// only import tiddlers if tagged with "importPublic"
if (theImported.tags && theImported.tags.find("importPublic")==null)
{ config.macros.importTiddlers.inbound[t].status=""; continue; } // status=="" means don't show in report
// never import the "ImportedTiddlers" history from the other document...
if (theImported.title=='ImportedTiddlers')
{ config.macros.importTiddlers.inbound[t].status=""; continue; } // status=="" means don't show in report
// check existing tiddler for importReplace, or systemConfig tags
config.macros.importTiddlers.inbound[t].status="added"; // default - add any tiddlers not filtered out
if (store.tiddlerExists(theImported.title)) {
config.macros.importTiddlers.inbound[t].status="replaced";
if (!theExisting.tags||(theExisting.tags.find("importReplace")==null))
{ config.macros.importTiddlers.inbound[t].status="not imported - tiddler already exists (use importReplace to allow changes)"; continue; }
if ((theExisting.tags.find("systemConfig")!=null)||(theImported.tags.find("systemConfig")!=null))
config.macros.importTiddlers.inbound[t].status+=" - WARNING: an active systemConfig plugin has been added or updated";
}
// apply the all/new/changes/updates filter
if (filter!="all") {
if ((filter=="new") && store.tiddlerExists(theImported.title))
{ config.macros.importTiddlers.inbound[t].status="not imported - tiddler already exists"; continue; }
if ((filter=="changes") && !store.tiddlerExists(theImported.title))
{ config.macros.importTiddlers.inbound[t].status="not imported - new tiddler"; continue; }
if (store.tiddlerExists(theImported.title) && ((theExisting.modified.getTime()-theImported.modified.getTime())>=0))
{ config.macros.importTiddlers.inbound[t].status="not imported - tiddler is unchanged"; continue; }
}
// get confirmation if required
if (ask && !confirm("Import "+(theExisting?"updated":"new")+" tiddler '"+theImported.title+"'\nfrom "+src))
{ config.macros.importTiddlers.inbound[t].status="skipped - cancelled by user"; continue; }
// DO THE IMPORT!!
store.addTiddler(theImported); count++;
}
importReport(quiet); // generate a report (as needed) and display it if not 'quiet'
if (count) store.setDirty(true);
// always show final message when tiddlers were actually imported
if (!quiet||count) displayMessage("Imported "+count+" tiddler"+(count!=1?"s":"")+" from "+src);
}
//}}}
// // ''REPORT GENERATOR''
//{{{
function importReport(quiet)
{
if (!config.macros.importTiddlers.inbound) return;
// DEBUG alert('importReport: start');
// if import was not completed, the Ask panel will still be open... close it now.
var askpanel=document.getElementById('importAskPanel'); if (askpanel) askpanel.style.display='none';
// get the alphasorted list of tiddlers
var tiddlers = config.macros.importTiddlers.inbound;
tiddlers.sort(function (a,b) {if(a['title'] == b['title']) return(0); else return (a['title'] < b['title']) ? -1 : +1; });
// gather the statistics
var count=tiddlers.length;
var added=0; var replaced=0; var renamed=0; var skipped=0; var merged=0;
for (var t=0; t<count; t++)
if (tiddlers[t].status)
{
if (tiddlers[t].status=='added') added++;
if (tiddlers[t].status.substr(0,7)=='skipped') skipped++;
if (tiddlers[t].status.substr(0,6)=='rename') renamed++;
if (tiddlers[t].status.substr(0,7)=='replace') replaced++;
if (tiddlers[t].status.substr(0,6)=='merged') merged++;
}
var omitted=count-(added+replaced+renamed+skipped+merged);
// DEBUG alert('stats done: '+count+' total, '+added+' added, '+skipped+' skipped, '+renamed+' renamed, '+replaced+' replaced, '+merged+' merged');
// skip the report if nothing was imported
if (added+replaced+renamed+merged==0) return;
// skip the report if not desired by user
if (!config.options.chkImportReport) {
// reset status flags
for (var t=0; t<count; t++) config.macros.importTiddlers.inbound[t].status="";
// refresh display since tiddlers have been imported
store.notifyAll();
// quick message area summary report
var msg=(added+replaced+renamed+merged)+' of '+count+' tiddler'+((count!=1)?'s':"");
msg+=' imported from '+config.macros.importTiddlers.src.replace(/\\/g,'/')
displayMessage(msg);
return;
}
// create the report tiddler (if not already present)
var tiddler = store.getTiddler('ImportedTiddlers');
if (!tiddler) // create new report tiddler if it doesn't exist
{
tiddler = new Tiddler();
tiddler.title = 'ImportedTiddlers';
tiddler.text = "";
}
// format the report header
var now = new Date();
var newText = "";
newText += "On "+now.toLocaleString()+", "+config.options.txtUserName+" imported tiddlers from\n";
newText += "[["+config.macros.importTiddlers.src+"|"+config.macros.importTiddlers.src+"]]:\n";
newText += "<"+"<"+"<\n";
newText += "Out of "+count+" tiddler"+((count!=1)?"s ":" ")+" in {{{"+config.macros.importTiddlers.src.replace(/\\/g,'/')+"}}}:\n";
if (added+renamed>0)
newText += (added+renamed)+" new tiddler"+(((added+renamed)!=1)?"s were":" was")+" added to your document.\n";
if (merged>0)
newText += merged+" tiddler"+((merged!=1)?"s were":" was")+" merged with "+((merged!=1)?"":"an ")+"existing tiddler"+((merged!=1)?"s":"")+".\n";
if (replaced>0)
newText += replaced+" existing tiddler"+((replaced!=1)?"s were":" was")+" replaced.\n";
if (skipped>0)
newText += skipped+" tiddler"+((skipped!=1)?"s were":" was")+" skipped after asking.\n";
if (omitted>0)
newText += omitted+" tiddler"+((omitted!=1)?"s":"")+((omitted!=1)?" were":" was")+" not imported.\n";
if (config.macros.importTiddlers.addTags && config.macros.importTiddlers.newTags.trim().length)
newText += "imported tiddlers were tagged with: \""+config.macros.importTiddlers.newTags+"\"\n";
// output the tiddler detail and reset status flags
for (var t=0; t<count; t++)
if (tiddlers[t].status!="")
{
newText += "#["+"["+tiddlers[t].title+"]"+"]";
newText += ((tiddlers[t].status!="added")?("^^\n"+tiddlers[t].status+"^^"):"")+"\n";
config.macros.importTiddlers.inbound[t].status="";
}
newText += "<"+"<"+"<\n";
// output 'discard report' link
newText += "<html><input type=\"button\" href=\"javascript:;\" ";
newText += "onclick=\"story.closeTiddler('"+tiddler.title+"'); store.deleteTiddler('"+tiddler.title+"');\" ";
newText += "value=\"discard report\"></html>";
// update the ImportedTiddlers content and show the tiddler
tiddler.text = newText+((tiddler.text!="")?'\n----\n':"")+tiddler.text;
tiddler.modifier = config.options.txtUserName;
tiddler.modified = new Date();
store.addTiddler(tiddler);
if (!quiet) story.displayTiddler(null,"ImportedTiddlers",1,null,null,false);
story.refreshTiddler("ImportedTiddlers",1,true);
// refresh the display
store.notifyAll();
}
//}}}
// // ''INTERFACE DEFINITION''
// // Handle link click to create/show/hide control panel
//{{{
function onClickImportMenu(e)
{
if (!e) var e = window.event;
var parent=resolveTarget(e).parentNode;
var panel = document.getElementById("importPanel");
if (panel==undefined || panel.parentNode!=parent)
panel=createImportPanel(parent);
var isOpen = panel.style.display=="block";
if(config.options.chkAnimate)
anim.startAnimating(new Slider(panel,!isOpen,e.shiftKey || e.altKey,"none"));
else
panel.style.display = isOpen ? "none" : "block" ;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
}
//}}}
// // Create control panel: HTML, CSS, register for notification
//{{{
function createImportPanel(place) {
var panel=document.getElementById("importPanel");
if (panel) { panel.parentNode.removeChild(panel); }
setStylesheet(config.macros.importTiddlers.css,"importTiddlers");
panel=createTiddlyElement(place,"span","importPanel",null,null)
panel.innerHTML=config.macros.importTiddlers.html;
store.addNotification(null,refreshImportList); // refresh listbox after every tiddler change
refreshImportList();
return panel;
}
//}}}
// // CSS
//{{{
config.macros.importTiddlers.css = '\
#importPanel {\
display: none; position:absolute; z-index:11; width:35em; right:105%; top:3em;\
padding: 0.5em; margin:0em; text-align:left; font-size: 8pt;\
background-color: #eee; color:#000000; \
border:1px solid black; border-bottom-width: 3px; border-right-width: 3px; -moz-border-radius:1em;\
}\
#importPanel a { color:#009; }\
#importPanel input { width: 98%; margin: 1px; font-size:8pt; }\
#importPanel select { width: 98%; margin: 1px; font-size:8pt; }\
#importPanel .importButton { padding: 0em; margin: 0px; font-size:8pt; }\
#importPanel .importListButton { padding:0em 0.25em 0em 0.25em; color: #000000; display:inline }\
#importAskPanel { display:none; margin:0.5em 0em 0em 0em; }\
';
//}}}
// // HTML
//{{{
config.macros.importTiddlers.html = '\
<span style="float:left; padding:1px; white-space:nowrap">\
import from source document\
</span>\
<span style="float:right; padding:1px; white-space:nowrap">\
<input type=checkbox id="chkImportReport" checked style="height:1em; width:auto"\
onClick="config.options[\'chkImportReport\']=this.checked;">create a report\
</span>\
<input type="file" id="fileImportSource" size=56\
onKeyUp="config.macros.importTiddlers.src=this.value"\
onChange="config.macros.importTiddlers.src=this.value;">\
<span style="float:left; padding:1px; white-space:nowrap">\
select:\
<a href="JavaScript:;" id="importSelectAll"\
onclick="onClickImportButton(this)" title="select all tiddlers">\
all </a>\
<a href="JavaScript:;" id="importSelectNew"\
onclick="onClickImportButton(this)" title="select tiddlers not already in destination document">\
added </a> \
<a href="JavaScript:;" id="importSelectChanges"\
onclick="onClickImportButton(this)" title="select tiddlers that have been updated in source document">\
changes </a> \
<a href="JavaScript:;" id="importSelectDifferences"\
onclick="onClickImportButton(this)" title="select tiddlers that have been added or are different from existing tiddlers">\
differences </a> \
<a href="JavaScript:;" id="importToggleFilter"\
onclick="onClickImportButton(this)" title="show/hide selection filter">\
filter </a> \
</span>\
<span style="float:right; padding:1px; white-space:nowrap">\
<a href="JavaScript:;" id="importListSmaller"\
onclick="onClickImportButton(this)" title="reduce list size">\
– </a>\
<a href="JavaScript:;" id="importListLarger"\
onclick="onClickImportButton(this)" title="increase list size">\
+ </a>\
<a href="JavaScript:;" id="importListMaximize"\
onclick="onClickImportButton(this)" title="maximize/restore list size">\
= </a>\
</span>\
<select id="importList" size=8 multiple\
onchange="setTimeout(\'refreshImportList(\'+this.selectedIndex+\')\',1)">\
<!-- NOTE: delay refresh so list is updated AFTER onchange event is handled -->\
</select>\
<input type=checkbox id="chkAddTags" checked style="height:1em; width:auto"\
onClick="config.macros.importTiddlers.addTags=this.checked;">add new tags \
<input type=checkbox id="chkImportTags" checked style="height:1em; width:auto"\
onClick="config.macros.importTiddlers.importTags=this.checked;">import source tags \
<input type=checkbox id="chkKeepTags" checked style="height:1em; width:auto"\
onClick="config.macros.importTiddlers.keepTags=this.checked;">keep existing tags\
<input type=text id="txtNewTags" size=15 onKeyUp="config.macros.importTiddlers.newTags=this.value" autocomplete=off>\
<div align=center>\
<input type=button id="importOpen" class="importButton" style="width:32%" value="open"\
onclick="onClickImportButton(this)">\
<input type=button id="importStart" class="importButton" style="width:32%" value="import"\
onclick="onClickImportButton(this)">\
<input type=button id="importClose" class="importButton" style="width:32%" value="close"\
onclick="onClickImportButton(this)">\
</div>\
<div id="importAskPanel">\
tiddler already exists:\
<input type=text id="importNewTitle" size=15 autocomplete=off">\
<div align=center>\
<input type=button id="importSkip" class="importButton" style="width:23%" value="skip"\
onclick="onClickImportButton(this)">\
<input type=button id="importRename" class="importButton" style="width:23%" value="rename"\
onclick="onClickImportButton(this)">\
<input type=button id="importMerge" class="importButton" style="width:23%" value="merge"\
onclick="onClickImportButton(this)">\
<input type=button id="importReplace" class="importButton" style="width:23%" value="replace"\
onclick="onClickImportButton(this)">\
</div>\
</div>\
';
//}}}
// // refresh listbox
//{{{
function refreshImportList(selectedIndex)