Tuesday, May 31, 2022

memoria disponible en servidor SQL

 SELECT

(total_physical_memory_kb/1024) AS Total_OS_Memory_MB,

(available_physical_memory_kb/1024)  AS Available_OS_Memory_MB

FROM sys.dm_os_sys_memory;


SELECT  

(physical_memory_in_use_kb/1024) AS Memory_used_by_Sqlserver_MB,  

(locked_page_allocations_kb/1024) AS Locked_pages_used_by_Sqlserver_MB,  

(total_virtual_address_space_kb/1024) AS Total_VAS_in_MB,

process_physical_memory_low,  

process_virtual_memory_low  

FROM sys.dm_os_process_memory; 


select getdate() as fecha_y_Hora_Actual


salida.







System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send

Solucion - forzar TLS 1.2

 var securityProtocol = (int)System.Net.ServicePointManager.SecurityProtocol;

                // 0 = SystemDefault in .NET 4.7+

                if (securityProtocol != 0)

                {

                    Log.Info(securityProtocol);

                    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

                    Log.Info("allocated Security Protocal: " + ServicePointManager.SecurityProtocol);

                }


System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)

   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)

   --- End of inner exception stack trace ---

   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---

   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---

   --- End of inner exception stack trace ---

   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)

   at System.Threading.Tasks.Task`1.get_Result()



System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)

   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)

   --- End of inner exception stack trace ---

   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---

   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

   --- End of inner exception stack trace ---<---

Sunday, May 8, 2022

RAM zram-tools

 

#basado en https://www.muylinux.com/2021/01/29/swap-zram-debian-ubuntu/

sudo apt install zram-tools

sudo nano /etc/default/zramswap

PERCENTAGE=50


#borrar la particion de swap

sudo nano /etc/fstab 

#para desactivar la particion de swap

sudo dphys-swapfile swapoff


The following packages have unmet dependencies

 The following packages have unmet dependencies:

 vlc-bin : Depends: libvlc-bin (= 3.0.12-0+deb10u1+rpt1+arm64) but 3.0.12-0+deb10u1+rpt3 is to be installed

 vlc-plugin-skins2 : Depends: vlc-plugin-qt (= 3.0.12-0+deb10u1+rpt3) but 3.0.12-0+deb10u1+rpt1+arm64 is to be installed

E: Broken packages


#se resuelve con 

#sudo apt update && sudo apt full-upgrade -y 

sudo apt update

sudo apt full-upgrade



Thursday, May 5, 2022

Count IP address in Nginx access logs

basado en  https://mkyong.com/nginx/count-ip-address-in-nginx-access-logs/

 sudo awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr


map IP 

https://ipinfo.io/tools/map


https://ipinfo.io/tools/map/f7bafa18-f694-46f6-8240-f94b90c70332

Sunday, May 1, 2022

reducir consumo ram en google chrome

 

https://www.adslzone.net/como-se-hace/chrome/reducir-consumo-ram/

chrome://settings/cleanup

desactivar chrome en segundo plano

Desactivar Chrome en segundo plano

En el momento que cerramos el navegador se cierran todas las pestañas abiertas en esa ventana, sin embargo, hay ciertos procesos que se pueden quedar ejecutándose en segundo plano y que se corresponden con determinadas aplicaciones que pueden depender del propio navegador y que por lo tanto, seguirán consumiendo ciertos recursos del equipo.

Para evitar esto, abrimos una ventana del navegador, hacemos clic en el botón de menú (tres puntos en vertical), entramos en la Configuración. Una vez ahí, nos desplazamos hacia abajo por los diferentes ajustes, desplegamos la configuración avanzada y buscamos la sección Sistema.


Desactivar el envío de errores

Aunque lo cierto es una característica que no llega a consumir gran cantidad de memoria, un poco de allí y un poco de allá siempre ayudará a conseguir una mejor experiencia y rendimiento. En esta ocasión nos referimos a la opción de desactivar el envío de informes de errores en el navegador.

Cuando instalamos Chrome en nuestro equipo se nos avisa de que se van realizarán ciertos envíos de informes anónimos de cualquier error que se pueda producir. La verdad es que es algo que la mayoría de usuarios no suele fijarse, pero por suerte podemos desactivarlo en cualquier momento. Para ello, debemos abrir una ventana del navegador, pulsar sobre el botón de menú para entrar en la configuración y una vez ahí, dentro de la primera sección Google y tú hacemos clic sobre la opción Sincronización y servicios de Google.