Pages

Wednesday, December 2, 2015

"No such file or directory” when adding application with alternatives in Linux


Issue 

# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws  20000
failed to read link /usr/bin/javaws: No such file or directory

or 

sudo update-alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000
failed to read link /usr/bin/jar: No such file or directory

Fix 

sudo rm /usr/bin/jar
sudo rm /var/lib/alternatives/jar
sudo alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

rm /var/lib/alternatives/javaws
rm /var/lib/alternatives/javawsrm: remove regular file `/var/lib/alternatives/javaws'? y alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws  20000

Saturday, November 21, 2015

How To Grant Access To Only One S3 Bucket Using AWS IAM Policy

Click on “My Account/Console” and select “Security Credentials”.

Select “Continue to Security Credentials”.

Select “Policies” on the left menu, then click “Create Policy”.

Select “Create Your Own Policy”.

Fill out the “Policy Name”, “Description” and “Policy Document” fields.
Replace “YOUR-BUCKET” in the example below with your bucket name.
Please note that we set “ListAllMyBuckets” to list all buckets owned by you, so that tools that lists buckets will work.

NOTE: If you explicitly list out the actions for your bucket, please also include
"s3:GetBucketLocation" so that ObjectiveFS can select the right S3 endpoint to talk with.
Example policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                        "s3:GetBucketLocation",
                        "s3:ListAllMyBuckets"
                      ],
            "Resource": "arn:aws:s3:::*"
        },
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::YOUR-BUCKET",
                "arn:aws:s3:::YOUR_BUCKET/*"
            ]
        }
    ]
}


Wednesday, November 18, 2015

Create SFTP server in Windows Server.



Normally we need to install ftp role and get the site configured to use the FTP/SFTP in the windows server. Now we can Create SFTP server in windows server by enabling freeftpd from following URL

http://www.freesshd.com/?ctt=download