Snippets Collections
 sudo du -ah / --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/home/virtfs | sort -rh | head -n 20
import axios, { AxiosError } from 'axios';

// Crea una instancia de Axios
const instance = axios.create({
  baseURL: 'https://tu-dominio.com',
  // Aquí puedes añadir más configuraciones si es necesario
});

// Simula un error 503 en todas las respuestas utilizando un interceptor
instance.interceptors.response.use(
  response => {
    // Crea un error de Axios simulado
    const axiosError = new AxiosError(
      "Service Unavailable", // mensaje de error
      "ECONNABORTED", // código de error, este es un ejemplo, puede ajustarlo según sea necesario
      undefined, // config, puedes añadir la configuración de la solicitud aquí si es necesario
      undefined, // request, puedes añadir la solicitud aquí si es necesario
      { // response, aquí construyes la respuesta simulada
        status: 503,
        statusText: 'Service Unavailable',
        headers: response.headers,
        config: response.config,
        data: 'Service Unavailable'
      }
    );

    // Rechaza la promesa con el error de Axios simulado
    return Promise.reject(axiosError);
  },
  error => {
    // Este bloque maneja errores reales de las peticiones
    return Promise.reject(error);
  }
);

export const extractName = async (
  text: TExtractNamePayload
): Promise<{ data: TExtractNameResponse; status: number }> => {
  instance.defaults.headers['Authorization'] = `Bearer ${process.env.EXPO_PUBLIC_SERVER_SECRET_KEY}`;
  try {
    const response = await instance.post<TExtractNameResponse>('/api/v1/conversation/entity-extraction/names', text);
    return { data: response.data, status: response.status };
  } catch (error) {
    if (axios.isAxiosError(error)) {
      // Aquí capturas el error simulado o real y lo devuelves
      return { data: error.response?.data, status: error.response?.status };
    }
    // Manejo de otros tipos de errores
    throw error;
  }
};
> eval `ssh-agent`
> ssh-add /c/Users/roberto/.ssh/gitlab
#create an identity fil name {mycert} as per your need
ssh-keygen -f ~/.ssh/mycert -t ed25519

#/.ssh/config
Host myserver
Hostname {hostname}
IdentityFile ~/.ssh/{identityFile}
User {username}

#from the console
ssh myserver
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh {IP-ADDRESS-OR-FQDN} "cat >> .ssh/authorized_keys"
Host My-Application-Name-or-project-name
    HostName XX.XXX.XXX.XX
    User ubuntu   # user name of machine to login/ssh
    IdentityFile C:\Users\JOHN\.ssh\mykeypair.pem
ssh -i mykeypair_openssh.ppk <user>@<host ip>
  
# with port
ssh -i mykeypair_openssh.ppk <user>@<host ip> -P 50055
puttygen ~/.ssh/my.ppk -O private-openssh -o ~/.ssh/my_openssh.ppk
#Send/Copy local file to Remote Machine
usage: scp -i <pemfile>  <filename> user-name@domain-or-ip:<path-to-copy>
scp -i .\keys.pem .\<filename> ubuntu@xx.xx.xx.xx:~/  


# copy file from remote machine to local machine (using GIT Bash)
#$scp -i <"pemfile"> user@xx.xx.xx.xx:/<path-of-file-to-copy> <directory-to-paste-file>
#ex:
$ scp -i  "Light.pem"  bitnami@XX.XX.XX.XX:/home/bitnami/AOC_PROJ_UPDATED_08_06_2022/AOC_PROJ_UPD_08_06_22.tar.gz  . 
#ssh to remote machine.
ssh -i keys.pem ubuntu@xx.xx.xx.xx
# ssh-copy-id takes care of adding your key in the right place

ssh-copy-id -i "user@hostname.example.com -p2222"

# If you don't use -i all of your public keys will be copied over.
# Also a alias for the host can be used if configured in your ssh config.

# You will be asked for the password and after that all should be taken care of.
# Test key if neccessary
ssh -i ~/.ssh/id_rsa.pub user@hostname

# Copy key over to server
ssh-copy-id [user@]hostname

# You can also just print out the key as dry run
ssh-copy-id -n [user@]hostname
ssh -i /Users/iliasdh/.ssh/nesk_vision iliasdh@34.125.137.168
star

Wed Sep 25 2024 08:49:19 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs

#win10 #win11 #powershell #openssh #ssh
star

Wed Jul 31 2024 07:51:17 GMT+0000 (Coordinated Universal Time) https://qiita.com/shizuma/items/2b2f873a0034839e47ce

#ssh #git
star

Mon Mar 25 2024 23:11:11 GMT+0000 (Coordinated Universal Time)

#ssh #git #github #gitlab
star

Tue Mar 19 2024 22:15:26 GMT+0000 (Coordinated Universal Time)

#ssh #git #github #gitlab
star

Thu Jan 25 2024 18:19:15 GMT+0000 (Coordinated Universal Time)

#ssh #git #github #gitlab
star

Fri Mar 03 2023 08:13:54 GMT+0000 (Coordinated Universal Time)

#ssh #linux #identity
star

Sun Feb 05 2023 10:29:19 GMT+0000 (Coordinated Universal Time)

#powershell #ssh
star

Thu Sep 22 2022 02:03:37 GMT+0000 (Coordinated Universal Time) undefined

#ssh #vm #security #server
star

Mon Aug 22 2022 14:31:01 GMT+0000 (Coordinated Universal Time)

#apache-spark #vs-code #ssh #ssh-from-vs-code
star

Tue Mar 15 2022 04:10:40 GMT+0000 (Coordinated Universal Time)

#ubuntu #bash #ssh
star

Tue Mar 15 2022 03:32:29 GMT+0000 (Coordinated Universal Time) https://serverfault.com/questions/854208/ssh-suddenly-returning-invalid-format

#ubuntu #bash #ssh
star

Wed Feb 09 2022 13:38:38 GMT+0000 (Coordinated Universal Time)

#linux #ssh
star

Wed Feb 09 2022 13:32:52 GMT+0000 (Coordinated Universal Time)

#linux #ssh
star

Wed Feb 02 2022 21:24:13 GMT+0000 (Coordinated Universal Time)

#docker #ssh
star

Mon Jun 21 2021 10:21:52 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/a/265646

#ssh #server #authentification #network
star

Wed Jun 09 2021 12:30:24 GMT+0000 (Coordinated Universal Time) https://www.ssh.com/academy/ssh/copy-id

#ssh
star

Wed Jun 09 2021 12:24:26 GMT+0000 (Coordinated Universal Time)

#ssh
star

Tue Jan 19 2021 14:08:10 GMT+0000 (Coordinated Universal Time)

#cloud #ssh

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension