1416 links
  • Animal
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
4 results tagged stackoverflow.com x
  • dns - WHOIS command not returning useful information? - Stack Overflow

    La commande whois sous Linux ne retourne pas toutes les informations attendues (par exemple le Registrant Name). On voit en effet des différences entre un Whois réalisé sur un site internet, et un Whois réalisé dans un terminal. Pour palier à ça, il faut procéder en deux temps :
    1) d'abord lancer la commande classique :

    whois google.com

    2) Ensuite, il faut refaire une demande en spécifiant le whois du registrar. Il est disponible à la ligne Registrar WHOIS Server :

    whois google.com -h whois.markmonitor.com

    On obtient alors les infos souhaitées.

    Pour éviter de faire cette double manipulation à chaque fois, on peut faire un petit script et le mettre dans le PATH :

    #!/usr/bin/env bash
    
    domain_search="$1"
    
    # Isole le domaine whois du registrar
    regws=`whois "$domain_search" | grep "Registrar WHOIS Server" | sed "s/^.*:[ ]*\(.*\)$/\1/"`
    
    # Affiche le whois complet dans le terminal
    whois "$domain_search" -h "$regws"
    Tue May 8 16:27:52 2018 * - permalink -
    QRCode
    - https://stackoverflow.com/questions/5481108/whois-command-not-returning-useful-information
    Bash Linux stackoverflow.com Whois
  • git - How do I set GIT_SSL_NO_VERIFY for specific repos only? - Stack Overflow

    Quand le mec qui gère un repo distant ne crée pas de certificat SSL, ça donne ça:

    git push origin master
    fatal: unable to access 'https://truc.machin.fr/mon/repo/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

    Pour contourner ce grave problème de sécurité, il faut lancer la commande suivante dans le repo local:

    git config http.sslVerify "false"

    Il ne reste plus qu'à remettre la tête dans le sable...

    Edit : S'il s'agit d'un répo devant être cloné :

    GIT_SSL_NO_VERIFY=true git clone https://url
    cd directory/
    git config http.sslVerify "false"
    Mon Mar 5 18:20:14 2018 * - permalink -
    QRCode
    - https://stackoverflow.com/questions/9008309/how-do-i-set-git-ssl-no-verify-for-specific-repos-only
    Certificat Git SSL stackoverflow.com
  • How to get the nth positional argument in bash? - Stack Overflow

    Pour récupérer le n-ème argument en bash:

    #!/bin/bash
    n=3
    echo "${!n}"

    Résultat:

    bash script.sh voiture camion "tati danielle" raclette "pommes de terre" exponentielle logarithme
    tati danielle

    Et pour récupérer les m premiers arguments à partir du n-ème (compris):

    #!/bin/bash
    n=4
    m=2
    echo "${@:$n:$m}

    Résultat:

    bash script.sh voiture camion "tati danielle" raclette "pommes de terre" exponentielle logarithme
    raclette pommes de terre
    Wed May 31 18:27:46 2017 * - permalink -
    QRCode
    - https://stackoverflow.com/questions/1497811/how-to-get-the-nth-positional-argument-in-bash
    Argument Astuce Bash Linux Script stackoverflow.com
  • shell - What is the purpose of the : (colon) GNU Bash builtin? - Stack Overflow

    Une petite particularité des shell dérivés du shell sh.
    Il existe la commande : (deux-points). Et elle ... ne fait rien! Ou plus exactement, elle agit comme un non-opérande.
    Quand on la "lance", elle retourne un code d'erreur 0:

    $ :
    $ $?
    $ 0

    Alors à quoi ça sert?

    Dans les vieilles version des shell, cette commande est utilisée en remplacement de la commande "true" (qui n'existait pas).
    Alors on peut voir des choses comme:

    if commande; then
          :
    else
          autre-commande
    fi

    Ou avec un double pipe en fin de commande, pour envoyer un code d'erreur 0:

    commande || :

    Sympa à savoir si on travail à décortiquer de vieux scripts.

    Edit: sur le même sujet https://superuser.com/questions/423980/colon-command-for-bash

    Mon May 22 21:40:11 2017 * - permalink -
    QRCode
    - https://stackoverflow.com/questions/3224878/what-is-the-purpose-of-the-colon-gnu-bash-builtin
    Bash Colon DeuxPoints Linux Sh Shell stackoverflow.com
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation