4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
◄Older
page 1 / 2
62 results tagged bash x
  • Note: bash date

    date +%Y-%m-%d_%H-%M-%S

    June 5, 2020 at 1:38:41 PM GMT+2 - permalink - archive.org - https://links.infomee.fr/?jh3dRw
    bash date
  • thumbnail
    [Feature] Auto Fix · Issue #1220 · koalaman/shellcheck · GitHub

    shellcheck a maintenant une option pour auto fix

    shellcheck restore.sh -f diff | git apply

    September 11, 2019 at 2:59:53 PM GMT+2 - permalink - archive.org - https://github.com/koalaman/shellcheck/issues/1220
    bash shellcheck
  • Using Temporary Security Credentials to Request Access to AWS Resources - AWS Identity and Access Management

    Use role in script

    November 21, 2017 at 5:03:26 PM GMT+1 - permalink - archive.org - http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html?shortFooter=true#using-temp-creds-sdk-cli
    aws bash cli role
  • Note: bash get random element from string "elem1;elem2;elem3"
    #!/bin/bash
    
    servers="server1;server2;server3"
    
    IFS=';' read -r -a array <<< "$servers"
    
    rand=$[ $RANDOM % ${#array[@]} ]
    
    echo ${array[$rand]}
    October 5, 2017 at 4:32:08 PM GMT+2 * - permalink - archive.org - https://links.infomee.fr/?wfMNvw
    bash random
  • thumbnail
    GitHub - hbekel/magic: define bash functions on a per-directory basis

    C'est magique

    May 28, 2017 at 8:48:07 AM GMT+2 - permalink - archive.org - https://github.com/hbekel/magic
    bash
  • Bash scripting quirks & safety tips - Julia Evans

    set -eux
    Shellcheck
    reptyr

    April 2, 2017 at 10:06:06 AM GMT+2 - permalink - archive.org - http://jvns.ca/blog/2017/03/26/bash-quirks/
    bash
  • Note: How to know which policy contains a specific action?
    Warning : this loop does a lot of call to aws api, use it with caution

    To know that I needed to list all policies and associated statements (for the default policy version)

    ```
    #!/bin/bash
    IFS=$'\n'
    for line in $(aws iam list-policies|jq '.Policies|.[]|[ .PolicyName, .Arn, .DefaultVersionId ]| @csv' -r|sed 's/","/ /g'|sed 's/"//g'); do
        name=$(echo $line|cut -d' ' -f1);
        arn=$(echo $line|cut -d' ' -f2);
        version=$(echo $line|cut -d' ' -f3);
        echo "$name"
        aws iam get-policy-version --policy-arn $arn --version-id $version
    done
    ```

    Put this in a script, redirect output to a file and go get grep!
    February 22, 2017 at 4:16:06 PM GMT+1 * - permalink - archive.org - https://links.infomee.fr/?bERNcg
    aws bash for foreach iam policy separator
  • Note: function pour log en bash

    Je me mets ça de côté pour gagner du temps la prochaine fois

    !/bin/bash

    logfile=/tmp/logfile.log
    errorfile=/tmp/error.log

    function log() {
    echo -e "\e[34m\e[1m[$(date +%Y-%m-%d) $(date +%H:%M:%S)] $1\e[0m" | tee -a /tmp/logfile.log
    }

    function logerror() {
    echo -e "\e[91m\e[1m[$(date +%Y-%m-%d) $(date +%H:%M:%S)] $1\e[0m" | tee -a /tmp/logfile.log
    }

    log "prout"
    logerror "pwet"

    February 10, 2017 at 10:29:21 AM GMT+1 - permalink - archive.org - https://links.infomee.fr/?tQ0ssA
    bash function log
  • How to install bash shell in Alpine Linux
    February 7, 2017 at 8:15:13 PM GMT+1 - permalink - archive.org - https://www.cyberciti.biz/faq/alpine-linux-install-bash-using-apk-command/
    alpine ash bash
  • The Bash Hackers Wiki [Bash Hackers Wiki]
    June 8, 2016 at 3:04:54 PM GMT+2 - permalink - archive.org - http://wiki.bash-hackers.org/
    bash
  • Detecting the use of "curl | bash" server side | Application Security

    :o

    April 22, 2016 at 2:18:49 PM GMT+2 - permalink - archive.org - https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/
    bash curl security
  • thumbnail
    jimeh/git-aware-prompt: Display current Git branch name in your terminal prompt when in a Git working directory.

    Ptetre qu'un jour je passerai à zsh (ohmyzsh)

    En attendant je bricole

    February 4, 2016 at 11:24:41 AM GMT+1 - permalink - archive.org - https://github.com/jimeh/git-aware-prompt
    bash git prompt
  • Check incoming update from puppet forge

    Un petit script pour check si les modules ont de nouvelles version dispo (il faut jq)

    #!/bin/bash
    
    modules=$(puppet module list|grep '\(v[0-9]\.[0-9]\.[0-9]\)')
    
    IFS=$'\n'
    for line in $modules; do
        name=$(echo $line|cut -d' ' -f2)
        version=$(echo $line|grep -o '\(v[0-9]\.[0-9]\.[0-9]\)'|sed 's/v//')
        current_version=$(curl -s https://forgeapi.puppetlabs.com/v3/modules/${name}|jq '.current_release.version'|sed 's/"//g')
        if [[ $version == $current_version ]]; then
            echo "OK $name $version $current_version"
        else
            echo "OUTDATED $name $version $current_version"
        fi  
    done
    November 30, 2015 at 4:37:25 PM GMT+1 * - permalink - archive.org - https://links.infomee.fr/?6tdMVA
    bash for forge IFS loop module puppet
  • jneen/balls

    :D
    via nico

    August 24, 2015 at 3:56:49 PM GMT+2 - permalink - archive.org - https://github.com/jneen/balls
    bash
  • bash value toi great for base

    $((10#$number))

    July 9, 2015 at 6:54:01 PM GMT+2 - permalink - archive.org - http://ubuntuforums.org/showthread.php?t=677751
    base bash
  • Marks

    Je ne sais plus ou j'ai vu ça, je ne retrouve plus le lien donc je me le remets ici au cas où

    #Marks
    export MARKPATH=$HOME/.marks
    function jump {
    cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
    }
    function mark {
    mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
    }
    function unmark {
    rm -i "$MARKPATH/$1"
    }
    function marks {
    ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
    }

    June 12, 2015 at 11:29:15 AM GMT+2 - permalink - archive.org - https://links.infomee.fr/?XYagKw
    bash bashrc mark
  • Use the Unofficial Bash Strict Mode (Unless You Looove Debugging)
    January 1, 2015 at 3:04:57 PM GMT+1 - permalink - archive.org - http://redsymbol.net/articles/unofficial-bash-strict-mode/
    bash
  • Explain: {,} in cp or mv Bash Shell Commands
    January 1, 2015 at 2:54:59 PM GMT+1 - permalink - archive.org - http://www.cyberciti.biz/faq/explain-brace-expansion-in-cp-mv-bash-shell-commands/
    bash
  • Être à l'aise avec bash #5 (bash, debian, linux, shell, ssh, truc, ubuntu) - Damien Pobel / blog
    January 1, 2015 at 2:42:17 PM GMT+1 - permalink - archive.org - http://damien.pobel.fr/post/etre-a-l-aise-avec-bash-5
    bash
  • Bash Initialisation Files

    via skunnyk

    November 19, 2014 at 2:03:54 PM GMT+1 - permalink - archive.org - http://www.solipsys.co.uk/new/BashInitialisationFiles.html
    bash intialisation
  • Afficher l'original d'un fichier qui provient d'un package sous debian en une commande

    à mettre dans son bashrc

    showOriginal() {

    argument = complete path to a file

    output original file content

    packageName=$(dpkg -S $1|cut -d':' -f1)
    tmpdir="/tmp/showOriginal-$packageName-$(date +%s)"
    mkdir $tmpdir
    cd $tmpir
    apt-get download $packageName > /dev/null
    dpkg -x *.deb $tmpdir
    cat ${tmpdir}$1
    cd - >/dev/null
    rm -rf $tmpdir
    }

    September 26, 2014 at 4:59:47 PM GMT+2 - permalink - archive.org - https://links.infomee.fr/?tdQ_tA
    bash bashrc script
  • Quickly navigate your filesystem from the command-line

    jusqu'à présent j'utilisais des alias dans mon bashrc du genre :
    cdbackup() { cd /home/foo/backup/; }

    Mais la méthode proposée est bien plus pratique

    August 8, 2014 at 9:55:32 AM GMT+2 - permalink - archive.org - http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
    bash shell
  • Why Zsh is Cooler than Your Shell

    zsh ça a l'air bien quand même. Le coup des alias inline ça rox ( gp=|grep -i )

    June 29, 2014 at 10:14:30 PM GMT+2 - permalink - archive.org - http://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692
    bash shell zsh
  • Defensive BASH programming - Say what?

    via arnaudb

    June 2, 2014 at 1:20:25 PM GMT+2 - permalink - archive.org - http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/
    bash
  • xclip - Documentation Ubuntu Francophone

    Bien pratique pour intéragir avec le pressepapier en cmdline, exemple :

    function nowplz {
    xclip -i <<< $(date "+%Y-%m-%d %H:%M")
    }

    va copier dans le presse papier la date et l'heure actuelle

    March 27, 2014 at 3:16:31 PM GMT+1 - permalink - archive.org - http://doc.ubuntu-fr.org/xclip
    bash clipboard presse_papier
  • Running commands in parallell using bash | Michael Boman

    bien utile

    cat liste | parallel --gnu -j 10 ssh root@{} 'ls'

    March 20, 2014 at 3:27:31 PM GMT+1 - permalink - archive.org - http://blog.michaelboman.org/2012/04/running-commands-in-parallel-using-bash.html
    background bash parallel
  • thumbnail
    sorting - Bash - Difference Between two lists - Stack Overflow

    Pour obtenir la diff des éléments entre deux listes :

    To get the lines only in the old file:
    comm -23 <(sort /tmp/oldList) <(sort /tmp/newList)

    To get the lines only in the new file:
    comm -13 <(sort /tmp/oldList) <(sort /tmp/newList)

    comm -23 <(sort /tmp/1) <(sort /tmp/2)
    comm -13 <(sort /tmp/1) <(sort /tmp/2)

    March 19, 2014 at 3:24:21 PM GMT+1 * - permalink - archive.org - http://stackoverflow.com/questions/11165182/bash-difference-between-two-lists
    bash comm diff list
  • mktemp

    Pratique pour l'écriture de script en bash lorsqu'on a besoin d'un fichier temporaire :

    #Creation
    tmpfile=$(mktemp)

    #Utilisation...

    #Clean
    if [ -e "$tmpfile" ]
    then
    rm -f $tmpfile
    fi

    March 19, 2014 at 11:16:44 AM GMT+1 - permalink - archive.org - https://links.infomee.fr/?r6stZw
    bash mktemp tmp tweetit
  • BashGuide/InputAndOutput - Greg's Wiki

    You can avoid this by temporarily removing the indentation for the lines of your Heredocs. However, that distorts your pretty and consistent indentation. There is an alternative. If you use <<-END instead of <<END as your Heredoc operator, Bash removes any tab characters in the beginning of each line of your Heredoc content before sending it to the command. That way you can still use tabs (but not spaces) to indent your Heredoc content with the rest of your code. Those tabs will not be sent to the command that receives your Heredoc. You can also use tabs to indent your sentinel string.

    February 28, 2014 at 5:37:35 PM GMT+1 - permalink - archive.org - http://mywiki.wooledge.org/BashGuide/InputAndOutput
    bash heredoc
  • Execute local script remotly and get ouput into a local log file

    Cool stuff :

    ssh user@server 'bash -s' < local_script.sh > local_script.log 2>&1

    January 31, 2014 at 3:53:51 PM GMT+1 - permalink - archive.org - https://links.infomee.fr/?ORnmyQ
    bash ssh
  • Command line one-liners | Arturo Herrero

    Sympa tous ces one liners ! il y a même un repo dans lequel on peut ajouter les siens : https://github.com/fxn/tkn

    Mes préférés :
    $ echo "!!" > script.sh
    $ cp file.txt{,.bak}
    $ (cd /tmp && ls)
    $ nc -l 5566 > data-dump.sql
    $ nc <his-ip-address> 5566 < data-dump.sql

    via Olivier

    January 22, 2014 at 11:41:24 AM GMT+1 - permalink - archive.org - http://arturoherrero.com/2013/11/29/command-line-one-liners/
    bash commandline linux
  • More on Using Bash's Built-in /dev/tcp File (TCP/IP) | Linux Journal

    Créer une socket en bash :o

    January 10, 2014 at 11:40:47 AM GMT+1 - permalink - archive.org - http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
    bash socket tcp
  • Deux syntaxes pour écrire une fonction en bash

    function sayhello() {
    echo hello
    }

    OR

    sayhello() {
    echo hello
    }

    Et en one-line :

    sayhello() { echo hello; }

    January 2, 2014 at 2:24:13 PM GMT+1 - permalink - archive.org - https://links.infomee.fr/?zlvmKw
    bash fonction function
  • 12 Best Practices for Writing Bash Scripts - Kevin van Zonneveld

    Quelques bp sur bash

    December 2, 2013 at 5:52:27 PM GMT+1 - permalink - archive.org - http://kvz.io/blog/2013/11/21/bash-best-practices/
    bash
  • Returning Values from Bash Functions | Linux Journal

    Je prefere la deuxieme solution :

    function myfunc()
    {
    local myresult='some value'
    echo "$myresult"
    }

    result=$(myfunc) # or result=myfunc
    echo $result

    November 14, 2013 at 2:41:00 PM GMT+1 - permalink - archive.org - http://www.linuxjournal.com/content/return-values-bash-functions
    bash function
  • How to iterate over associative array in bash - Stack Overflow

    Comment déclarer et itérer sur un tableau associatif en bash :

    declare -A array
    array[foo]=bar
    array[bar]=foo

    for i in "${!array[@]}"
    do
    echo "key : $i"
    echo "value: ${array[$i]}"
    done

    November 14, 2013 at 1:15:22 PM GMT+1 - permalink - archive.org - http://stackoverflow.com/questions/3112687/how-to-iterate-over-associative-array-in-bash
    array associative bash iterate
  • Bash Argsparse : mieux gérer sa ligne de commande dans ses scripts. - LinuxFr.org

    à voir, il y a aussi getopts

    November 5, 2013 at 9:04:58 AM GMT+1 - permalink - archive.org - http://linuxfr.org/news/bash-argsparse-mieux-gerer-sa-ligne-de-commande-dans-ses-scripts
    arg argparse bash parse
  • showterm

    Un truc pour faire du screencast de terminal, ça peut servir

    October 23, 2013 at 4:54:03 PM GMT+2 - permalink - archive.org - http://showterm.io/
    bash enregistrement screencast terminal
  • Cheat - Pour vous souvenir de la bonne syntaxe « Korben Korben

    Old mais je viens d'y repenser. Finalement je fais pareil, j'ai des mémo pour chaque commande dans un dossier de mon dropbox alors pourquoi pas essayer de les utiliser avec ça ? à tester. Dans tous les cas ça ne doit pas remplacer le man

    October 23, 2013 at 7:53:20 AM GMT+2 - permalink - archive.org - http://korben.info/cheat-pour-vous-souvenir-de-la-bonne-syntaxe.html
    bash cheat console man memo shell syntax syntaxe
  • BashGuide - Greg's Wiki

    this one is good

    October 22, 2013 at 9:20:40 AM GMT+2 - permalink - archive.org - http://mywiki.wooledge.org/BashGuide
    bash tuto
  • "Bash Argsparse : mieux gérer sa ligne de commande dans ses scripts." http://feedly.com/k/16TWn5q
    October 21, 2013 at 9:31:16 AM GMT+2 - permalink - archive.org - http://"Bash Argsparse : mieux gérer sa ligne de commande dans ses scripts." http://feedly.com/k/16TWn5q
    art bash sdn
  • List of Bash online-tutorials [Bash Hackers Wiki]
    October 20, 2013 at 10:48:36 PM GMT+2 - permalink - archive.org - http://wiki.bash-hackers.org/scripting/tutoriallist
    bash cours tutorial
  • Learning the shell - Lesson 6: I/O Redirection
    October 20, 2013 at 10:08:04 PM GMT+2 - permalink - archive.org - http://linuxcommand.org/lts0060.php
    bash il redirection shell stdin stdout
  • How can I use an at command in a shell script? - Stack Overflow

    at now +10 minutes <<< "rm -rf /tmp/tobedeleted"

    at now +1 minutes <<< "init 6"

    /etc/init.d/networking stop && /etc/init.d/networking start

    atq

    atrm 2

    For multiline, consider a "HERE-doc"

    at now +10 minutes <<ENDMARKER
    rm -rf /tmp/tobedeleted
    echo all done | mail -s 'completion notification' sysadmin@example.com
    ENDMARKER

    October 20, 2013 at 9:46:44 PM GMT+2 - permalink - archive.org - http://stackoverflow.com/questions/15454199/how-can-i-use-an-at-command-in-a-shell-script
    at bash
  • Portknocking in bash

    Un serveur, mais surtout un client pour faire du port knocking

    October 15, 2013 at 10:32:22 AM GMT+2 - permalink - archive.org - http://www.prometheus-group.com/labs/unbounded/46-web-security/135-bash-pk.html
    bash knocking port portknocking serveur ssh
  • Screen for remote session management :D

    screen -S machineA (ensuite on se co en ssh à machineA, puis CTRL A D pour detach)
    screen -S machineB (ensuite on se co en ssh à machineB, puis CTRL A D pour detach)
    etc
    At the end of the day :
    screen -ls affiche tous les screens (avec chacun une connexion vers le serv en ssh)
    screen -r machineA pour aller sur le A
    screen -r machineB pour aller sur le B

    alias utiles :
    alias sls='screen -ls' #Pour lister les screen
    alias sr='screen -r' #Pour recover un screen
    alias sn='screen -S' #Pour créer un nouveau screen

    October 14, 2013 at 5:21:25 PM GMT+2 - permalink - archive.org - https://links.infomee.fr/?VQzf3w
    bash screen
  • bash - How do you find the age of a long-running Linux process and then kill it? - Stack Overflow
    October 10, 2013 at 1:19:54 PM GMT+2 - permalink - archive.org - http://stackoverflow.com/questions/6134/how-do-you-find-the-age-of-a-long-running-linux-process-and-then-kill-it
    bash etime process time
  • Bash String Manipulation Examples – Length, Substring, Find and Replace

    Manipulation de string en bash

    September 9, 2013 at 4:58:40 PM GMT+2 - permalink - archive.org - http://www.thegeekstuff.com/2010/07/bash-string-manipulation/
    bash concat string
  • Programmation Bash/Flux et redirections - Wikilivres

    com > fic redirige la sortie standard de com dans le fichier fic,
    com 2> fic redirige la sortie des erreurs de com dans le fichier fic,
    com 2>&1 redirige la sortie des erreurs de com vers la sortie standard de com,
    com < fic redirige l'entrée standard de com dans le fichier fic,
    com1 | com2 redirige la sortie standard de la commande com1 vers l'entrée standard de com2.

    September 3, 2013 at 2:33:05 PM GMT+2 - permalink - archive.org - http://fr.wikibooks.org/wiki/Programmation_Bash/Flux_et_redirections
    bash in out std
  • explainshell.com - match command-line arguments to their help text

    Petit outil sympa qui donne l'explication de n'importe quelle commande shell (on peut c/c ce qu'on veut)l

    August 30, 2013 at 2:24:02 PM GMT+2 - permalink - archive.org - http://www.explainshell.com/
    bash help linux man shell
Links per page: 20 50 100
◄Older
page 1 / 2
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation