Amazon Ubuntu Deep Learning Instance Configuring Steps

Git server building. $ ssh-­keygen -­t rsa ­-C "user.email" Modifying hooks: $ vim sample.git/hooks/post-receive Sample code for hooks: #!/bin/sh GIT_WORK_TREE=/home/ubuntu/Deployment/sample git checkout -f chmod -R 777 /home/ubuntu/Deployment/sample Install bazel. 1). Add Bazel distribution URI as a package source (one time setup)

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - [Read More]

Convert mp3 to mp4 In Batch

Solution 1:
ls *.mp3 | while read mp3File ; do outputFile=$(basename "${mp3File}" .mp3) ; ffmpeg -i "${mp3File}" -loop 1 -i image.png -c:a copy -c:v libx264 -shortest "${outputFile}".mp4 ; done

Solution 2:

$ mkdir out
$ for f in *.mp3; do ffmpeg -f lavfi -i color=s=160x120:r=2 -i "$f" \
-c:v libx264 -preset ultrafast -c:a copy -shortest \
out/"${f%.mp3}.mp4"; done
[Read More]

Amazon Ubuntu Instance Suffers `Permission Denied(publickey).`

N.B. There are dozens of reasons to lead to this problem, for example, wrong permission of your pem file, incorrect username(e.g., ec2-user, ubuntu),wrong spelling in your command, etc..

The reason which causes my problem, if I am right, is that I run command `sudo chmod -R ./` under the wrong directory, namely, my home folder.

The solution is just setting your home folder permissions back.

Stop your problematic instance. Create a new instance and stop the new problem-free instance. The newly created instance should be in the same `Availability Zone` like ‘us-west-2c’ which can be set on the ‘Network’ step under which the menu is ‘Subnet’.
  • Detach your ‘ebs volume’ from the problematic instances and attach it on your new problem-free instance.
  • Your need input your instance id as well as the mount point which looks like ‘/dev/sda2’. Start your new instance and mount the second drive that you just attached.

    [ubuntu ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvdf 202:80 0 100G 0 disk xvda1 202:1 0 8G 0 disk / [ubuntu ~]$ sudo mount /dev/xvdf/ /mnt [Read More]

  • PERMISSION DENIED (PUBLICKEY).

    A problem occurred while I `git push` to my git server on ec2.

    I handled this by following this three guide of which their original links are:

    http://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository

    https://chenhuachao.com/2016/05/26/ssh%E5%87%BA%E9%94%99-sign-and-send-pubkey-signing-failed-agent-refused-operation/

    Sorry for missing out the second source link, I will add that later.

    sign_and_send_pubkey: signing failed: agent refused operation
    Permission denied (publickey).
    fatal: Could not read from remote repository.

    1. mkdir ~/.ssh
    2. vim known_hosts – if you already have known_hosts, skip this.
    3. ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
    4. ssh-keygen -t rsa -C "user.email"
    5. Add the id_rsa.pub key to SSH keys list on your GitHub profile.

    Set up your client

    1. Generate your key
      • ssh-keygen
    2. Configure ssh to use the key
      • vim ~/.ssh/config
    3. Copy your key to your server
      • ssh-copy-id -i /path/to/key.pub SERVERNAME

    Your config file from step 2 should have something similar to the following:

    Host SERVERNAME Hostname ip-or-domain-of-server User USERNAME PubKeyAuthentication yes IdentityFile ./path/to/key [Read More]

    How to install python3 version of package via pip on Ubuntu?

    Reference Link:

    http://stackoverflow.com/questions/10763440/how-to-install-python3-version-of-package-via-pip-on-ubuntu

    You may want to build a virtualenv of python3, then install packages of python3 after activating the virtualenv. So your system won’t be messed up 🙂

    This could be something like:

    virtualenv -p /usr/bin/python3 py3env source py3env/bin/activate pip install package-name [Read More]

    Tensorflow compiling from source failed on Amazon Ubuntu

    RoboForex – Professional services on Forex market

    Reference Links:

    https://github.com/tensorflow/tensorflow/issues/7660

    https://github.com/tensorflow/tensorflow/issues/349

    To compile tensorflow on my Amazon AWS server, I always get some strange error. No answer got upon enormous googling.

    I installed swig which is needed. However, I don’t know if this matters.

    sudo apt install swig

    Otherwise, maybe it just a simple running out of memory problem.

    Try reducing number of parallel builds by passing ‘–local_resources 2048,.5,1.0’, which would instruct bazel to spawn no more than one compiler process at the time.

    bazel build -c opt --jobs 1 --local_resources 2048,0.5,1.0 --verbose_failures --config=cuda //tensorflow/tools/pip_package:build_pip_package [Read More]

    (Solved)How to break the loop “Restart Surface to Modify security settings”

    Handing on my new Surface Pro 4,I try to  install ubuntu on it. But I lost my “Security” menu in UEFI while I try to boot from a PE in my USB stick.Then I get stuck in the “Restart to Surface UEFI” loop with a message ‘The security settings on Surface cannot be modified at this time. A restart is required to make changes to the security settings’. The default security settings menu no longer appear no matter how many times I restart. I googled as many as I can, but I still cannot find a way to fix this. [Read More]