4343 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
◄Older
page 42 / 218
Newer►
  • SQS — Boto 3 Docs 1.4.4 documentation

    On peut "remettre" ou plutot rendre disponible de nouveau un message SQS en changeant sa visibility timeout à 0

    July 12, 2017 at 11:37:59 AM GMT+2 - permalink - archive.org - http://boto3.readthedocs.io/en/latest/reference/services/sqs.html#SQS.Client.change_message_visibility
    aws sqs
  • Note: Count object in bucket/folder

    aws s3 ls s3://bucket/path/ --recursive --summarize | grep "Total Objects:"

    July 12, 2017 at 10:12:14 AM GMT+2 - permalink - archive.org - https://links.infomee.fr/?rcG0hg
    aws count s3
  • set-repository-policy — AWS CLI 1.11.117 Command Reference

    Truc con : on ne peut pas utiliser le résultat du get-repository-policy dans le set-repository-policy pour cloner.

    Il faut au passage enlever les \n qui trainent dans la réponse

    July 11, 2017 at 5:19:45 PM GMT+2 * - permalink - archive.org - http://docs.aws.amazon.com/cli/latest/reference/ecr/set-repository-policy.html
    aws ecs
  • Logging HOWTO — Python 3.6.2rc2 documentation

    python3 log to file AND stdout
    import logging
    logging.basicConfig(handlers=[logging.FileHandler('/var/log/runner/process1.log'),logging.StreamHandler()],format='%(asctime)s %(levelname)s %(message)s',level=logging.INFO)

    logging.info('foo')

    Encore mieux pour supporter le logrotate sans copytruncate :
    import logging.handlers
    logging.basicConfig(handlers=[logging.handlers.WatchedFileHandler('/var/log/worker/worker1.log'),logging.StreamHandler()],format='%(asctime)s %(levelname)s %(message)s',level=logging.INFO)

    /var/log/worker/*.log {
    monthly
    rotate 12
    compress
    delaycompress
    missingok
    notifempty
    create 644 root root
    }

    Python 2:

    import logging as loggingg

    logging = loggingg.getLogger('simple_example')
    logging.setLevel(loggingg.INFO)

    formatter = loggingg.Formatter('%(asctime)s %(levelname)s %(message)s')

    console_handler = loggingg.StreamHandler()
    console_handler.setLevel(loggingg.INFO)
    console_handler.setFormatter(formatter)

    file_handler = loggingg.FileHandler('/var/log/worker/worker3.log')
    file_handler.setLevel(loggingg.INFO)
    file_handler.setFormatter(formatter)

    logging.addHandler(console_handler)
    logging.addHandler(file_handler)

    July 11, 2017 at 10:05:21 AM GMT+2 * - permalink - archive.org - https://docs.python.org/3/howto/logging.html
    log logrotate python
  • thumbnail
    Newer docker client with older Docker host - Server Fault

    :~$ docker -H tcp://10.73.204.73:2375 ps
    Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.19)

    :~$ DOCKER_API_VERSION=1.19 docker -H tcp://x.x.x.x:xxxx ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

    July 6, 2017 at 11:01:38 AM GMT+2 - permalink - archive.org - https://serverfault.com/questions/664999/newer-docker-client-with-older-docker-host
    api client dcoker version
  • Which is the fastest method to delete files in Linux

    wtf?

    cd dir
    time perl -e 'for(<*>){((stat)[9]<(unlink))}'

    July 3, 2017 at 4:51:54 PM GMT+2 - permalink - archive.org - http://www.slashroot.in/which-is-the-fastest-method-to-delete-files-in-linux
    delete dir linux perl
  • Note: lol

    When using programs that use GNU Parallel to process data for publication please cite:

    O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
    ;login: The USENIX Magazine, February 2011:42-47.

    This helps funding further development; and it won't cost you a cent.
    Or you can get GNU Parallel without this requirement by paying 10000 EUR.

    To silence this citation notice run 'parallel --bibtex' once or use '--no-notice'.

    June 29, 2017 at 2:16:28 PM GMT+2 - permalink - archive.org - https://links.infomee.fr/?OqiirQ
    lol parallel
  • Note: rsync parallel

    find -L . -type f | parallel -j 30 rsync -a {} /DESTINATION_EFS_FILESYSTEM

    June 29, 2017 at 2:13:25 PM GMT+2 - permalink - archive.org - https://links.infomee.fr/?bSM2yw
    parallel rsync
  • firewall - How to Unban an IP properly with Fail2Ban - Server Fault

    fail2ban-client status

    June 28, 2017 at 1:51:12 PM GMT+2 - permalink - archive.org - https://serverfault.com/questions/285256/how-to-unban-an-ip-properly-with-fail2ban
    fail2ban
  • thumbnail
    List remote Git branches and the last commit date for each branch. Sort by most recent commit date.

    for branch in git branch -r | grep -v HEAD;do echo -e git show --format="%ci %cr" $branch | head -n 1 \t$branch; done | sort -r

    June 27, 2017 at 4:41:12 PM GMT+2 - permalink - archive.org - https://gist.github.com/jasonrudolph/1810768
    git
  • User-guided caching in Docker for Mac - Docker Blog

    Mieux vaut être sous GNU/Linux

    June 27, 2017 at 11:14:13 AM GMT+2 - permalink - archive.org - https://blog.docker.com/2017/05/user-guided-caching-in-docker-for-mac/
    docker
  • Amazon Glacier Direct Upload vs Glacier Upload via Amazon S3

    So you can put your data into glacier with 2 differents ways:
    1) directly to glacier via API
    2) Store them to s3 then with a management policy, it'll go to Glacier

    Warning : Huge cost when you download from glacier and when you delete before 3 months

    June 27, 2017 at 11:01:12 AM GMT+2 - permalink - archive.org - https://www.cloudberrylab.com/blog/compare-amazon-glacier-direct-upload-and-glacier-upload-through-amazon-s3/
    aws glacier s3
  • Creating a Redis (cluster mode enabled) Cluster with Replicas from Scratch - Amazon ElastiCache
    June 20, 2017 at 11:31:28 AM GMT+2 - permalink - archive.org - http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.CreatingReplGroup.NoExistingCluster.Cluster.html
    aws redis
  • Creating a Redis (cluster mode disabled) Cluster with Replicas from Scratch - Amazon ElastiCache
    June 20, 2017 at 11:31:18 AM GMT+2 - permalink - archive.org - http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.CreatingReplGroup.NoExistingCluster.Classic.html
    aws redis
  • Replication: Redis (cluster mode disabled) vs. Redis (cluster mode enabled) - Amazon ElastiCache
    June 20, 2017 at 9:59:57 AM GMT+2 - permalink - archive.org - http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.Redis-RedisCluster.html
    aws redis
  • Replication: Multi-AZ with Automatic Failover (Redis) - Amazon ElastiCache
    June 19, 2017 at 5:05:58 PM GMT+2 - permalink - archive.org - http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoFailover.html
    aws redis
  • Using CloudFormer to Create AWS CloudFormation Templates from Existing AWS Resources - AWS CloudFormation

    CloudFormer to create AWS CloudFormation templates from existing AWS resources

    June 19, 2017 at 3:52:44 PM GMT+2 - permalink - archive.org - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-cloudformer.html
    cloudformation
  • Note: Poor guy monitoring with tmux

    tmux <3

    while true; do python monitor_beanstalk.py; bg_color=$([ $? == 0 ] && echo "green" || echo "red"); tmux set-window-option -t${TMUX_PANE} window-status-bg $bg_color; sleep 30; clear; done

    June 16, 2017 at 11:36:55 AM GMT+2 - permalink - archive.org - https://links.infomee.fr/?OlX-xw
    monitoring tmux
  • 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
  • Note: EFS size by api

    aws efs describe-file-systems| jq '.FileSystems|.[]|[.Name, .SizeInBytes.Timestamp, .SizeInBytes.Value]' -c

    Retourne une ligne par EFS
    Sur chaque ligne, un array avec :
    [0] = nom de l'efs
    [1] = timestamp du moment où la taille a été calculée
    [2] = la taille en bytes

    Pour avoir la taille en GB :

    aws efs describe-file-systems| jq '.FileSystems|.[]|[.Name, .SizeInBytes.Timestamp, .SizeInBytes.Value / 1024 /1024 / 1024]' -c

    aws efs describe-file-systems| jq '.FileSystems|.[]|[.Name, .SizeInBytes.Value / 1024 /1024 / 1024]' -c

    June 13, 2017 at 11:56:27 AM GMT+2 * - permalink - archive.org - https://links.infomee.fr/?MzuW2A
    aws efs size
Links per page: 20 50 100
◄Older
page 42 / 218
Newer►
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation