domingo, 24 de marzo de 2013

crear disco de arranque usb windows 7

entrar como administrador a símbolo de sistema o tecla de windows + r y escribir cmd
  • Diskpart
  • Select Disk # (revisar el numero de disco con List Disk)
  • Clean 
  • Create partition primary 
  • Active
  • Format fs=fat32 quick 
  • Assign
  • Exit
Si se necesita instalar desde la usb se deben copiar los archivos de instalacion en la usb

martes, 19 de marzo de 2013

removiendo searchiu.com

Me encontré hace poco con un desagradable bug al abrir pestañas nuevas en los exploradores web de mi máquina.  Seguía apareciendo un buscador searchiu.com con unos dibujos infantiles (como para que no me diera miedo). Inicialmente no me habia fijado y habia pensado que era el doodle del dia, pero despues de fijarme mejor, me di cuenta que estaba invadiendo mi configuracion por defecto.  Al buscar en internet y encontrar respuestas no efectivas encontre que entre mis motores de busqueda aparecia un u-search. Pues a buscarlo en el regedit y aparecia casi 10 veces.  Al eliminar las llaves y entradas relacionadas, quedo todo como antes. Mi antivirus actualizado symantec ni se dio cuenta.

viernes, 15 de marzo de 2013

problemas con jquery y dropdown


si hay problemas con el id de un elemento (no solamente dropdown) porque el id aparece con el nombre larguísimo ct**$$$_mycontrol entonces hay que agregarle al control:  ClientIDMode="Static"
con esto al generarse el Html de la pagina el control aparece con el Id como lo dejamos en el aspx original.
Ej: <is:SimpleListBox ID="ddlmycontrol" runat="server" DataSourceID="odsMotivosRetencion"
          DataTextField="Name" DataValueField="IdType" SelectedValue='<%# Bind("fktablecolumn") %>'
          AppendDataBoundItems="True" ClientIDMode="Static">

En el html aparece asi:
<select name="ctl00$placeHolderContenido$frmmyform$ddlmycontrol" id="ddlmycontrol" disabled="disabled" class="aspNetDisabled">
De esta forma ya se puede referenciar fácilmente desde jquery:
var ddlmycontrol= $('#ddlmycontrol');

lunes, 4 de marzo de 2013

Eventos en la pagina (asp.net)


AbortTransaction: Occurs when a user ends a transaction. (Inherited from TemplateControl.)
CommitTransaction: Occurs when a transaction completes. (Inherited from TemplateControl.)
DataBinding: Occurs when the server control binds to a data source. (Inherited from Control.)
Disposed: Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested. (Inherited from Control.)
Error: Occurs when an unhandled exception is thrown. (Inherited from TemplateControl.)
Init: Occurs when the server control is initialized, which is the first step in its lifecycle. (Inherited from Control.)
InitComplete: Occurs when page initialization is complete.
Load: Occurs when the server control is loaded into the Page object. (Inherited from Control.)
LoadComplete: Occurs at the end of the load stage of the page's life cycle.
PreInit: Occurs at the beginning of page initialization.
PreLoad: Occurs before the page Load event.
PreRender: Occurs after the Control object is loaded but prior to rendering. (Inherited from Control.)
PreRenderComplete: Occurs before the page content is rendered.
SaveStateComplete: Occurs after the page has completed saving all view state and control state information for the page and controls on the page.
Unload: Occurs when the server control is unloaded from memory. (Inherited from Control.)

referencia MSDN Microsoft

Buscar texto en todos los procedimientos Almacenados


 SELECT DISTINCT so.name
FROM syscomments sc
INNER JOIN sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%DEBE SER MENOR O IGUAL A LA MEDIDA%'

adaptado de Pinal Dave's blog.sqlauthority.com

jueves, 19 de enero de 2012

Obtener fecha de creacion y modificacion de una tabla, procedimiento almacenado u objeto del servidor



SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'U'
ORDER BY create_date desc
GO


el tipo puede ser uno de los siguientes:
type
 char(2)
 Object type:
AF = Aggregate function (CLR)
C = CHECK constraint
D = DEFAULT (constraint or stand-alone)
F = FOREIGN KEY constraint
FN = SQL scalar function
FS = Assembly (CLR) scalar-function
FT = Assembly (CLR) table-valued function
IF = SQL inline table-valued function
IT = Internal table
P = SQL Stored Procedure
PC = Assembly (CLR) stored-procedure
PG = Plan guide
PK = PRIMARY KEY constraint
R = Rule (old-style, stand-alone)
RF = Replication-filter-procedure
S = System base table
SN = Synonym
SQ = Service queue
TA = Assembly (CLR) DML trigger
TF = SQL table-valued-function
TR = SQL DML trigger 
TT = Table type
U = Table (user-defined)
UQ = UNIQUE constraint
V = View
X = Extended stored procedure
  by create_date desc name, create_date, modify_dateFROM sys.objectsWHERE type = 'U'

miércoles, 18 de enero de 2012

Tipos nullables

Los tipos nullables pueden representar todos los valores de un tipo determinado ademas de un tipo adicional null. Se pueden declarar de dos formas:
System.Nullable<T> variable
-or-
T? variable
T es el tipo de dato del tipo nullable. T puede ser cualquier tipo de variable incluyendo un struct; sin embarbo no puede ser un tipo referencia.

ejemplo:

int? i = 10;
double? d1 = 3.14;
bool? flag = null;
char? letter = 'a';
int?[] arr = new int?[10];





fuente: http://msdn.microsoft.com/en-us/library/2cf62fcy(v=vs.80).aspx

miércoles, 11 de enero de 2012

agregar funcion de javascript por codebehind

Escenario:  se necesita que dos checkboxes sean iguales al cambiar el primero.


protected void mygridview_ItemCreated(object sender, EventArgs e) {


if(this.mygridview.CurrentMode == FormViewMode.Insert){
  TextBox txt1 = (TextBox)mygridview.FindControl("txt1");
  TextBox txttxt2 = (TextBox)mygridview.FindControl("txt2");
  String csName = "TextChangeScript";
  Type csType = this.GetType();
  ClientScriptManager cs = Page.ClientScript;
if (!cs.IsClientScriptBlockRegistered(csType, csName)) {
  StringBuilder csText = new StringBuilder();
  csText.Append("<script type=\"text/javascript\"> function cambiarTexto() {");
  csText.Append("document.getElementById('ctl00_placeHolderContenido_mygridview_txt2').value = document.getElementById('ctl00_placeHolderContenido_mygridview_txt1').value }<");
  csText.Append("/script>");
  cs.RegisterClientScriptBlock(csType, csName, csText.ToString());
}
  txt1.Attributes.Add("onblur", "return cambiarTexto();");
}

}

miércoles, 30 de noviembre de 2011

Colocar condiciones en un xsl

<xsl:choose>
         <xsl:when  test="expresion">
               ...output
         </xsl:when>
         <xsl:otherwise>
               ... output
          </xsl:otherwise>
 </xsl:choose>
   

miércoles, 2 de noviembre de 2011

Limpiar las reglas de iptables

Hacer un script que contenga lo siguiente: 

echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
 
salvar y ejecutar (con sudo).
Verificar con iptables -L
tomado de https://help.ubuntu.com/community/IptablesHowTo 

viernes, 14 de octubre de 2011

establecer contraseña de root en ubuntu

Generalmente despues de hacer la instalacion de ubuntu, root se queda sin contraseña (RUTH para los amigos), entonces hay tareas que necesitan el usuario.  Hay que entrar por terminal:

sudo -s
 
sudo passwd 
 
fuente http://www.guia-ubuntu.org/index.php?title=Creaci%C3%B3n_del_Password_de_Usuario_root 

domingo, 9 de octubre de 2011

Como establecer la red inalámbrica por defecto

netsh wlan add filter permission=denyall networktype=infrastructure
netsh wlan set blockednetworks display=hide
netsh wlan add filter permission=allow ssid=Your_SSID networktype=infrastructure


Con esto puedo establecer mi red cuando uso por ejemplo telmex y tengo que conectarme manualmente a la red cuando enciendo mi portatil o pc.

tomado de http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/changing-default-wireless-connection-in-windows-7/adf94bc6-dc0c-420e-8c67-9dd019c22641

Este truco funciona en Windows 7 

martes, 4 de octubre de 2011

xcopy magico

xcopy ruta_origen ruta_destino  /y/r/c/i/h/k/s/e

Copia todo.... especialmente util en windows cuando se detiene la copia por cualquier cosa en modo grafico

miércoles, 28 de septiembre de 2011

añadir excepcion a firewall en pc para sqlserver

netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT

http://msdn.microsoft.com/es-es/library/cc646023.aspx

Es muy importante tener en cuenta que si esto no funciona se debe añadir una excepcion al sqlbrowser quien es el que finalmente escucha las peticiones

jueves, 22 de septiembre de 2011

Puertos TCP mas conocidos

Port Number
Description
1 TCP Port Service Multiplexer (TCPMUX)
5 Remote Job Entry (RJE)
7 ECHO
18 Message Send Protocol (MSP)
20 FTP -- Data
21 FTP -- Control
22 SSH Remote Login Protocol
23 Telnet
25 Simple Mail Transfer Protocol (SMTP)
29 MSG ICP
37 Time
42 Host Name Server (Nameserv)
43 WhoIs
49 Login Host Protocol (Login)
53 Domain Name System (DNS)
69 Trivial File Transfer Protocol (TFTP)
70 Gopher Services
79 Finger
80 HTTP
103 X.400 Standard
108 SNA Gateway Access Server
109 POP2
110 POP3
115 Simple File Transfer Protocol (SFTP)
118 SQL Services
119 Newsgroup (NNTP)
137 NetBIOS Name Service
139 NetBIOS Datagram Service
143 Interim Mail Access Protocol (IMAP)
150 NetBIOS Session Service
156 SQL Server
161 SNMP
179 Border Gateway Protocol (BGP)
190 Gateway Access Control Protocol (GACP)
194 Internet Relay Chat (IRC)
197 Directory Location Service (DLS)
389 Lightweight Directory Access Protocol (LDAP)
396 Novell Netware over IP
443 HTTPS
444 Simple Network Paging Protocol (SNPP)
445 Microsoft-DS
458 Apple QuickTime
546 DHCP Client
547 DHCP Server
563 SNEWS
569 MSN
1080 Socks

 Fuente:  huevo pedia :  http://www.webopedia.com/quick_ref/portnumbers.asp

miércoles, 21 de septiembre de 2011

como corregir el error de No CVSROOT specified!

hay que setear la variable CVSROOT.  Sin esto no se pueden ejecutar comandos de CVS.
La forma rapida es desde comandos:
CVSROOT=mi_ruta





Para hacer que esta opcion sea persistente, se puede colocar de forma predeterminada en el bash.
VI ~/.bashrc
agregar ...
export CVSROOT=mi_ruta  y reiniciar

cambiar a root desde cualquier sesion

su  (enter)
digitar contraseña.
Es util en sistemas graficos para ejecutar acciones como su

Agregar Fondos personalizados a llamadas de teams

1. Abrir una ventana de explorador 2. En la barra de direccion digitar     %appdata% y pulsar enter 3. Abrir la carpeta microsoft...