Git Product home page Git Product logo

scripts's Introduction

Linkedin Blog

A collection of useful scripts for Linux, Windows & Mac.

Utilities for command line in Linux and Mac

  • git_configure.sh: Configure options in git such as alias, user name, email and credential helper.
  • git_update_repos.sh: It iteratively updates several git repositories for a user.
  • git_status_repos.sh: It iteratively finds the status of several git repositories for a user.
  • git_find_big.sh: List git objects ordered by size.
  • jupyter_configure.sh: Set up jupyter notebook environment in a Ubuntu server.
  • setup_bashrc.sh: Set up several functions to .bashrc like cs (a combination of cd+ls), ccat (cat with color) or reimplement evince to run in background.
  • setup_vim.sh: Set up functions for vim such as the line numbers

Utilities for Azure

Utilities for installing software

Misc

scripts's People

Contributors

lipusik avatar loomlike avatar miguelgfierro avatar siw3kosky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scripts's Issues

update script with new cuda

# install CUDA 9

CUDA_REPO_PKG="cuda-repo-ubuntu1604_9.0.176-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda

# install cuDNN v7.0.5.15

wget https://ikpublictutorial.blob.core.windows.net/deeplearningframeworks/libcudnn7_7.0.5.15-1%2Bcuda9.0_amd64.deb
wget https://ikpublictutorial.blob.core.windows.net/deeplearningframeworks/libcudnn7-dev_7.0.5.15-1%2Bcuda9.0_amd64.deb
wget https://ikpublictutorial.blob.core.windows.net/deeplearningframeworks/libcudnn7-doc_7.0.5.15-1%2Bcuda9.0_amd64.deb

CUDNN_RUNTIME_PKG="libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb"
CUDNN_DEV_PKG="libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb"
CUDNN_SAMPLES_PKG="libcudnn7-doc_7.0.5.15-1+cuda9.0_amd64.deb"

sudo dpkg -i ${CUDNN_RUNTIME_PKG}
sudo dpkg -i ${CUDNN_DEV_PKG}
sudo dpkg -i ${CUDNN_SAMPLES_PKG}

Update license

MIT: https://tldrlegal.com/license/mit-license Basically it means that anybody can use my code but I won't be liable/responsible for it.

Apache 2: https://tldrlegal.com/license/apache-license-2.0-(apache-2.0). Anybody can use my code. I won't be liable for it and nobody can use my name/trademark to promote their code. You have to maintain license, contributors and state changes.

BSD-0: https://tldrlegal.com/license/bsd-0-clause-license. Anybody can use my code. I won't be liable for it and you don't need to add the license

BSD-2: https://tldrlegal.com/license/bsd-2-clause-license-(freebsd). Identical to MIT

BSD-3: https://tldrlegal.com/license/bsd-3-clause-license-(revised). Code free to use. No liable and no trademark. Maintain copyright and license.

BSD-4: https://tldrlegal.com/license/4-clause-bsd. Idem to BSD-3 but you have to give credit to the author.

Error when uploading a folder with files in a premium blob

I got this error:

HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets?restype=container (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f4a75c11550>: Failed to establish a new connection: [Errno -2] Name or service not known',))
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/opt/az/lib/python3.6/site-packages/urllib3/util/connection.py", line 56, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/opt/az/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/opt/az/lib/python3.6/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/opt/az/lib/python3.6/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f4a75c11550>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/opt/az/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets?restype=container (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f4a75c11550>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/storageclient.py", line 269, in _perform_request
    response = self._httpclient.perform_request(request)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/_http/httpclient.py", line 92, in perform_request
    proxies=self.proxies)
  File "/opt/az/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/az/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets?restype=container (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f4a75c11550>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 197, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 369, in execute
    six.reraise(*sys.exc_info())
  File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 343, in execute
    result = cmd(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 182, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 436, in default_command_handler
    result = op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/blob/baseblobservice.py", line 630, in create_container
    self._perform_request(request, expected_errors=[_CONTAINER_ALREADY_EXISTS_ERROR_CODE])
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/storageclient.py", line 381, in _perform_request
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/storageclient.py", line 311, in _perform_request
    raise AzureException(ex.args[0])
azure.common.AzureException: HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets?restype=container (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f4a75c11550>: Failed to establish a new connection: [Errno -2] Name or service not known',))
uploading /data1/imagenet/ILSVRC2012_devkit_t12.tar.gz
HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets/imagenet/ILSVRC2012_devkit_t12.tar.gz (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f777f7b15f8>: Failed to establish a new connection: [Errno -2] Name or service not known',))
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/opt/az/lib/python3.6/site-packages/urllib3/util/connection.py", line 56, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/opt/az/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/opt/az/lib/python3.6/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/opt/az/lib/python3.6/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f777f7b15f8>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/opt/az/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/opt/az/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets/imagenet/ILSVRC2012_devkit_t12.tar.gz (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f777f7b15f8>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/storageclient.py", line 269, in _perform_request
    response = self._httpclient.perform_request(request)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/_http/httpclient.py", line 92, in perform_request
    proxies=self.proxies)
  File "/opt/az/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/az/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets/imagenet/ILSVRC2012_devkit_t12.tar.gz (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f777f7b15f8>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 197, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 369, in execute
    six.reraise(*sys.exc_info())
  File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 343, in execute
    result = cmd(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 182, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 436, in default_command_handler
    result = op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 199, in storage_blob_upload_batch
    if_none_match=if_none_match, timeout=timeout)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/util.py", line 218, in wrapper
    return True, func(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 185, in _upload_blob
    return upload_blob(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 286, in upload_blob
    return type_func[blob_type]()
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 279, in upload_block_blob
    return client.create_blob_from_path(**create_blob_args)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/blob/blockblobservice.py", line 463, in create_blob_from_path
    timeout=timeout)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/blob/blockblobservice.py", line 582, in create_blob_from_stream
    timeout=timeout)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/blob/blockblobservice.py", line 971, in _put_blob
    return self._perform_request(request, _parse_base_properties)
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/storageclient.py", line 381, in _perform_request
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storage/v2018_03_28/common/storageclient.py", line 311, in _perform_request
    raise AzureException(ex.args[0])
azure.common.AzureException: HTTPSConnectionPool(host='datasets.blob.core.windows.net', port=443): Max retries exceeded with url: /datasets/imagenet/ILSVRC2012_devkit_t12.tar.gz (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f777f7b15f8>: Failed to establish a new connection: [Errno -2] Name or service not known',))

mount fileshare in Mac

sudo mount_smbfs //[email protected]/share-name desired-mount-point

then it asks for the password and you add the key.

However, I don't have permissions to enter the drive unless I do sudo -s. It doesn't appear in the finder

Authentication without password using OpenSSH Key, certificates .pem and .pub

Based on this tutorial.

How to generate a Key Pair for authentication without password

ssh-keygen -t rsa -b 2048 -v

We have to add the keyname migonzagpup100_rsa:

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/miguel/.ssh/id_rsa): /Users/miguel/.ssh/migonzagpup100_rsa
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/miguel/.ssh/migonzagpup100_rsa.
Your public key has been saved in /Users/miguel/.ssh/migonzagpup100_rsa.pub.
The key fingerprint is:
SHA256:2VVHKEfxyzrawPDUzrYvK/WbMLlvYK/6PzUBCKoWmW4 [email protected]
The key's randomart image is:

You get two files, migonzagpup100_rsa.pub and migonzagpup100_rsa.

Uploading the generated certificate from client computer to server

Then we need to copy the public key to the server

ssh-copy-id -i /Users/miguel/.ssh/migonzagpup100_rsa.pub [email protected]

Now we make sure that we can log in using the private key (without the password):

ssh -i /Users/miguel/.ssh/migonzagpup100_rsa [email protected]

Authenticating directly through hostname

You can create the file ~/.ssh/config and add the following lines:

Host migonzagpup100 migonzagpup100.westeurope.cloudapp.azure.com
Hostname migonzagpup100.westeurope.cloudapp.azure.com
User hoaphumanoid
IdentityFile /Users/miguel/.ssh/migonzagpup100_rsa

Host migonzagpup100london migonzagpup100london.westeurope.cloudapp.azure.com
Hostname migonzagpup100london.westeurope.cloudapp.azure.com
User hoaphumanoid
IdentityFile /Users/miguel/.ssh/migonzagpup100london

Now you can ssh to the machine directly by using the hostname: ssh migonzagpup100.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.