create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| image: cosmintitei/bash-curl | |
| stages: | |
| - senrty_push_release | |
| job: | |
| stage: senrty_push_release | |
| script: | |
| - chmod +x sentry_push_release.sh | |
| - bash sentry_push_release.sh | |
| only: |
| import win32com.client | |
| import os | |
| from pprint import pprint | |
| # constants | |
| MQ_RECEIVE_ACCESS = 1 | |
| MQ_SEND_ACCESS = 2 | |
| MQ_PEEK_ACCESS = 32 | |
| MQ_DENY_NONE = 0 |
| result = db.session.execute('SELECT * FROM some_table WHERE some_column_name = :val', {'val': 5}) | |
| or | |
| result = db.session.execute('SELECT * FROM some_table WHERE some_column_name = :val').params(var=5) | |
| from collections import namedtuple | |
| Record = namedtuple('Record', result.keys()) | |
| records = [Record(*r) for r in result.fetchall()] | |
| for r in records: | |
| print(r.some_column_name) |
| #/usr/bin/env python3 | |
| import time | |
| import threading | |
| import functools | |
| import tqdm | |
| def long_running_function(*args, **kwargs): |
| sudo apt-get update | |
| sudo apt-get install build-essential git libreadline-dev zlib1g-dev libssl-dev libbz2-dev libsqlite3-dev | |
| curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | |
| # may need this, but install script above should handle it; and yeah, you can do multiline inserts with awk/sed or whatever | |
| echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(pyenv init -)"' >> ~/.bashrc | |
| echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc | |
| source ~/.bashrc | |
| pyenv install 3.6.0 |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| import logging | |
| import logging.handlers | |
| log = logging.getLogger(__name__) | |
| log.setLevel(logging.DEBUG) | |
| handler = logging.handlers.SysLogHandler(address = '/dev/log') | |
| formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s') |
| """ | |
| A perl Data.Dumper clone for Python | |
| Author: simon@log4think.com | |
| 2011-07-08 | |
| Copyright 2011 Jinyu LIU | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| # dump all databases once every 24 hours | |
| 45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz | |
| # vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night) | |
| 45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze" | |
| 45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet" | |
| # re-index all databases once a week | |
| 0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"' |