Buscar contenidos

martes, 26 de enero de 2021

FTP Server in Azure

 

How to deploy FTP Server in Azure in under 3 minutes! Store Data in Azure Files

https://www.youtube.com/watch?v=EMzBiIog-Lo

This video will cover. 1. Deploy SFTP Template to Azure 2. Connect to SFTP Server using WinSCP 3. Upload Files to SFTP 4. View Data in Azure Files 5. Firewall IP ranges


SFTP on Azure

https://docs.microsoft.com/en-us/samples/azure-samples/sftp-creation-template/sftp-on-azure/


...


SFTP on Azure

SFTP is a very widely used protocol which many organizations use today for transferring files within their organization or across organizations. Creating a VM based SFTP is costly and high-maintenance. In absence of a fully managed service, this template will be a good workaround for a cost-effective SFTP solution in Azure which is backed by durable persistent storage. ACI service is very inexpensive and requires very little maintenance, while data is stored in Azure Files which is a fully managed SMB service in cloud.

Key Value Prop

  • Simple SFTP Creation
  • Persistent and Durable Storage
  • Cost efficient solution
  • No VM maintenance overhead
  • Fast to deploy

How-To create an on-demand SFTP Server with a new Azure Files persistent storage

 

How-To create an on-demand SFTP Server with an existing Azure Files persistent storage

 

Overview

This template demonstrates an on-demand SFTP server using Azure Container Instances (ACI). The template will generate two container groups:

  1. create-share-group is a container group that acts as an init container by generating the second container group and an Azure Storage account (based on the 101-aci-storage-file-share template)
  2. sftp-group is a container group with a mounted Azure File Share. The Azure File Share will provide persistent storage after the container is terminated.

Tags: Azure Container Instance, az-cli, sftp

Deployment steps

Click the "Deploy to Azure" button at the beginning of this document or follow the instructions for command line deployment using the scripts in the root of this repository.

Fill in the information

  1. Choose the subscription you want to create the sftp service in

  2. Create a new Resource Group

  3. It will automatically create a storage account of specified Redundancy

  4. Give a File Share Name

  5. Provide a SFTP user name

  6. Provide a SFTP password

  7. Click on I agree to terms and conditions above

  8. Click Purchase

cid:image011.png@01D4AC19.C75D08F0

Pin to the dashboard

cid:image012.png@01D4AC19.C75D08F0

Usage

Once deployed, connect Azure to the Filezilla client via the fully qualified domain name (FQDN) of the ACI container group named sftp-group and upload files.

‼️ ACI does not support static IPs for their container groups. Use the container group's FQDN for consistent network connectivity ‼️

After connecting to sftp-group's FQDN, these files should be placed into the Azure File Share. Once transfers are complete, manually stop the sftp-group to pause ACI's billing. The files will remain accessible. You can manually start sftp-group and to copy more files at anytime. If you choose to delete and redeploy sftp-group make sure to update the FQDN connection on Filezilla since this template randomly generates the FQDN during deployment time.

  1. Click on the container sftp-group

cid:image013.png@01D4AC19.C75D08F0

  1. Copy the FQDN from the container group

cid:image014.png@01D4AC19.C75D08F0

  1. Open Filezilla and open File Site Manager and enter the FQDN, username and password that was originally added during creation

cid:image015.png@01D4AC19.C75D08F0

  1. Upload a file

cid:image016.png@01D4AC19.C75D08F0

  1. The file appears in your file share

    cid:image017.jpg@01D4AC19.C75D08F0

Troubleshoot - Lost Password

Steps to Update Password

Selected the resource group and go to the SFTP server.

 

Click on the “ Export Template” icon.

 

 

 

 

 

 

 

Under “ EnvironmentVariables” changes could be made to the username and password.

 

 

Once changes are done redeploy it again. 

Notes

Azure Container Instances is available in selected locations. Please use one of the available location for Azure Container Instances resource. The container image used by this template is hosted on Docker Hub. It is not affiliated with Microsoft in any way, and usage is at your own risk.

miércoles, 20 de enero de 2021

How do you find your most accessed tables? When is the last time each table was accesseed?

 

http://www.sqlfingers.com/2014/01/how-do-you-find-your-most-accessed.html



How do you find your most accessed tables? When is the last time each table was accesseed?

How do you determine which tables are being used the most?  Or, which tables may not even be used at all?  In this tip I will show you how to use sys.dm_db_index_usage_stats to gather this information.  First we will return the number of times each table (and index) has been accessed since the last service restart.  Then I will show you how to return the last time each table has been accessed.  It takes time to administer all of your database objects.  If you're not using it -- why is it there?  In my book, knowing the data is very key.  The better I know it, the better I can manage it.  I hope that this will help you learn your data a little better, too.

    /* Most accessed tables. */
    SELECT
       db_name(ius.database_id) [Database],
       t.NAME [Table],
      SUM(ius.user_seeks + ius.user_scans + ius.user_lookups) [#TimesAccessed]
    FROM
       sys.dm_db_index_usage_stats ius INNER JOIN sys.tables t
         ON ius.OBJECT_ID = t.object_id
    WHERE
       database_id = DB_ID('YourDatabaseName'
    GROUP BY
       database_id,
       t.name
    ORDER BY
       SUM(ius.user_seeks + ius.user_scans + ius.user_lookups) DESC
  
    /* Most accessed indexes. */

    SELECT
       db_name(ius.database_id) [Database],
       t.NAME [Table],
       i.NAME [Index],
       i.type_desc [IndexType],
       ius.user_seeks + ius.user_scans + ius.user_lookups [#TimesAccessed]
    FROM
       sys.dm_db_index_usage_stats ius INNER JOIN sys.indexes i
         ON ius.OBJECT_ID = i.OBJECT_ID
         AND ius.index_id = i.index_id INNER JOIN sys.tables t
           ON i.OBJECT_ID = t.object_id
   WHERE
       database_id = DB_ID('YourDatabaseName')
   ORDER BY
       ius.user_seeks + ius.user_scans + ius.user_lookups DESC
 

 
   /* Last time the table was accessed. */
   USE YourDatabaseName;

   WITH latest AS

   (
   SELECT SCHEMA_NAME(B.schema_id) +'.'+object_name(b.object_id) [Table],
   (   SELECT MAX(last_user_dt)
   FROM (VALUES (last_user_seek),(last_user_scan),(last_user_lookup)) AS all_val(last_user_dt)) [Accessed]
   FROM sys.dm_db_index_usage_stats a RIGHT OUTER JOIN sys.tables b
     ON a.object_id = b.object_id
   )
   SELECT
      [Table],
      MAX([Accessed]) [LastAccessed]

   FROM

      latest
   GROUP BY
      [Table]
   ORDER BY
      [LastAccessed] DESC

 

Quick update.  The logic I've posted above for the last time your table was accessed, does not work with SQL Server v2005.  You can use this to collect the last read and write times for your tables, in v2005:
 
   USE YourDatabaseName;  
   WITH latest AS
   (
   SELECT
      [object_id],
      last_user_seek,
      last_user_scan,
      last_user_lookup,
      last_user_update
   FROM
      sys.dm_db_index_usage_stats
   WHERE
      database_id = DB_ID()
   )
  
  SELECT
      [Schema] = OBJECT_SCHEMA_NAME([object_id]),
      [TableOrView] = OBJECT_NAME([object_id]),
      LastReadTime = MAX(last_read),
      LastWriteTime = MAX(last_write)
  FROM
    (
     SELECT [object_id], last_user_seek, NULL FROM latest
       UNION ALL
     SELECT [object_id], last_user_scan, NULL FROM latest
       UNION ALL
     SELECT [object_id], last_user_lookup, NULL FROM latest
       UNION ALL
     SELECT [object_id], NULL, last_user_update FROM latest
    ) AS x ([object_id], last_read, last_write)
   GROUP BY
      OBJECT_SCHEMA_NAME([object_id]),
      OBJECT_NAME([object_id])
   ORDER BY
      [Schema],
      [TableOrView];

viernes, 15 de enero de 2021

Python primeros pasos

 


[Tutorial] Cómo instalar Python en Windows 10

https://www.youtube.com/watch?v=9fNKy9zOPkg


INSTALAR JUPYTER NOTEBOOK EN WINDOWS 10 ✅ | 2021 | ESPAÑOL

https://www.youtube.com/watch?v=5XuCaHpyRes

pip install jupyter

jupyter notebook (abrir)


Curso Python. Generar ejecutables. Fin de curso. Vídeo 78

https://www.youtube.com/watch?v=Vr9vl0qlggE

pip install pyinstaller

c<ruta/> pyinstaller nombreArchivo.py (con consola)

c<ruta/> pyinstaller --windowed nombreArchivo.py (sin consola) 

c<ruta/> pyinstaller --windowed --onefile nombreArchivo.py (sin consola) (unico archivo .Exe)

c<ruta/> pyinstaller --windowed --onefile --icon=./logo.icon  nombreArchivo.py (sin consola) (unico archivo .Exe)


Face Comparison in Python | Face Comparison in 5 lines | Data Magic

https://www.youtube.com/watch?v=f9aV2Jfd5fc


How to install deepface library | Fix deepface library installation issues | Data Magic

https://www.youtube.com/watch?v=IlhQFCSrNdE