4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
    Type 1 or more characters for results.
    Links per page: 20 50 100
    page 1 / 1
    6 results tagged List x
    • thumbnail
      Show some equivalent list comprehensions in filter examples · Issue #1068 · pallets/jinja · GitHub
      # filter out all elements not with x > 5
      a = [el for el in data if el['x'] > 5]
      
      # get all the 'c' attributes as a list
      b = [el['c'] for el in data]
      
      # get all the 'c' attributes for the elements with x > 5
      c = [el['c'] for el in data if el['x'] > 5]
      
      In Jinja2:
      
      a: {{ data | selectattr('x', 'gt', 5) | list }}
      b: {{ data | map(attribute='c') | list }} 
      c: {{ data | selectattr('x', 'gt', 5) | map(attribute='c') | list }} 
      September 24, 2021 at 11:47:44 AM GMT+2 * - permalink - archive.org - https://github.com/pallets/jinja/issues/1068
      ansible comprehension list python
    • EC2 Instance Types & Pricing
      March 20, 2018 at 9:27:45 AM GMT+1 - permalink - archive.org - http://ec2pricing.net/beta/
      compare ec2 list price
    • Note: some draft about monitoring beanstalk applications health with boto3 python script
      import pprint
      p = pprint.PrettyPrinter(indent=4)
      p.pprint(x)

      or

      import pprint
      pprint.pformat(x)


      import logging
      import pprint
      logging.info(pprint.pformat(dict))



       $ cat monitor_beanstalk.py
      #!/bin/python

      import boto3
      import pprint
      pp = pprint.PrettyPrinter(indent=4)


      #List all env and status and instances health

      client = boto3.client('elasticbeanstalk')


      envs = client.describe_environments()['Environments']

      #pp.pprint(envs)


      for env in envs:
          print 'ApplicationName: {} EnvironmentName: {} Health: {} HealthStatus: {} Status: {}'.format(env['ApplicationName'].ljust(30),env['EnvironmentName'].ljust(30),env['Health'].ljust(10),env.get('HealthStatus', 'N/A').ljust(10),env['Status'].ljust(10))
          if (env['Health'] != 'Green') or (env.get('HealthStatus', 'N/A') != 'Ok' and env.get('HealthStatus', 'N/A') != 'N/A'):
              print '\nProblem'
              details = client.describe_environment_health(EnvironmentName=env['EnvironmentName'],AttributeNames=['All'])
              #pp.pprint(details)
              print details['Causes']
              print details['InstancesHealth']
              print '\n'
      June 15, 2017 at 11:12:05 AM GMT+2 * - permalink - archive.org - https://links.infomee.fr/?eFFzMg
      aws beanstalk boto pprint python
    • thumbnail
      git diff - Show all changed files between two Git commits - Stack Overflow

      Je prends de plus en plus le réflexe de "git init" dans certains dossiers un peu chaud qui bougent beaucoup comme des dossiers de configuration..

      Et là arrive le moment où je me pose la question : qu'est ce que j'ai touché depuis que j'ai fais mon git ini ? Et voilà la commande magique qui répond à ma question :

      git diff --name-only SHA1 SHA2

      Après si vous voulez la liste entre le premier et le dernier commit :
      git diff --name-only HEAD $(git log --format=%H | tail -1)

      November 5, 2014 at 2:53:43 PM GMT+1 - permalink - archive.org - http://stackoverflow.com/questions/1552340/show-all-changed-files-between-two-git-commits
      diff file git list
    • 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
    • Full Disclosure Mailing List
      May 24, 2013 at 2:50:57 PM GMT+2 - permalink - archive.org - http://seclists.org/fulldisclosure/
      list mail network
    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