Managing a 30TB+ file services infrastructure with 3000+ shares I face in a daily basis simple challenges like the urgent need to know the path from a share.
The small powershell code below does the trick:
PS C:\Windows\system32> Get-WmiObject -Class Win32_Share -Computer FILESERVER01 | Select Name, Path | Where-Object { $_.Name -eq "Share Name" }
Replace the red marked parts with the server name and share respectively. Enjoy!
This blog will hold mine tech thoughts and solutions, links and other interesting stuff for the followers from the Nerd side of the force :)
terça-feira, 29 de março de 2016
quinta-feira, 29 de outubro de 2015
Install AWSCLI on Mac OS X El Capitan (python error solution)
So you installed the new OS X El Capitan in your MacBook. Then you tried to install AWSCLI... and it did not worked, right?
Probably you got the following error message:
How to fix it?
1) Install brew (if not installed):
2) Install xcode:
3) Reinstall python with brew:
4) Reinstall the failing package (in this case six-1.4.1):
5) And finally install the AWSCLI:
This fix worked for me perfectly and now I can start working with the awscli (see my other blogs to know how to setup the cli in your MAC).
Probably you got the following error message:
sudo -H pip2.7 install awscli Collecting awscli (...) Installing collected packages: six, python-dateutil, docutils, botocore, awscli Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. Uninstalling six-1.4.1: Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run root=options.root_path, File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install requirement.uninstall(auto_confirm=True) File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall paths_to_remove.remove(auto_confirm) File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove renames(path, new_path) File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 315, in renames shutil.move(old, new) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat os.chflags(dst, st.st_flags) OSError: [Errno 1] Operation not permitted: '/tmp/pip-Za5ewE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
How to fix it?
1) Install brew (if not installed):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2) Install xcode:
xcode-select --install
3) Reinstall python with brew:
brew reinstall python
4) Reinstall the failing package (in this case six-1.4.1):
sudo pip install -U six
5) And finally install the AWSCLI:
sudo -H pip install awscli
This fix worked for me perfectly and now I can start working with the awscli (see my other blogs to know how to setup the cli in your MAC).
terça-feira, 28 de julho de 2015
AWS: Resize Root EBS Volume - Linux Partition
The goal from this document is to be clear and help you as quick as possible to achieve your goal. Further recommended reading is provided in the end of this tutorial - I am considering you have basic knowledge in AWS Console.
- Expanding your EBS Volume: by default you can't extend an EBS volume attached to an instance. To do so you need to perform the following steps:
- Stop your instance (take care to verify if the Stop behavior is STOP and not TERMINATE - otherwise you will lose your instance).
- Create a snapshot from the volume you want to expand (this can take a while).
- Right click the snapshot and select "Create Volume" choose the size you want the disk to have (consider current space + increase needed => plan for future). Important here is to make sure that you are creating the new EBS volume in the same availability zone from your instance, otherwise you will not be able to attach the new volume to the instance.
- After Volume is ready:
- Detach the former volume from your instance (the one you are "increasing")
- Attach the new volume, make sure you type /dev/sda1 in the Device Name (if this is the root volume), otherwise your instance will not boot.
- Start the instance with the newly created expanded EBS volume.
- Expanding your Linux Root partition [Tested on CentOS]:
- When you type df -h you will see that the new space is not reclaimed.
- Get the partition name from df -h and the volume name, for example, /dev/xvda1 mounted as / and /dev/xvda for your device.
- Run fdisk -l /dev/xvda to list the partitions, probably the data partition you want to expand is the last one (hope to be). This command will also show the size from /dev/xvda which must reflect your expanded disk size.
- Take note from the Start and End sectors from your partitions, specially the one you want to extend.
- Delete your partition (the one you want to extend - no data will be lost but remember, you have one snapshot and the original volume is untouched): fdisk /dev/xvda
- Now you deleted your partition, time to recreate it. Usually keeping the defaults is OK, check the previously noted Start and End cylinders. Command (m for help): n
- If your partition had a "*" present in the Boot column, we have to add it with the command, change the partition number to your situation:
- Now is time to write down the changes:
- Reboot your instance. After reboot the partition will have the new space but it will not be allocated yet, so a df -h will still show the old values.
- After reboot, type the following command to extend your online partition to its full size (the size we gave with fdisk), here you will use the partition name, not the disk, so, instead of using /dev/xvda (our example) as you did for fdisk, here we use the partition number /dev/xvda1:
- Additional Resources:
Command (m for help): d
Selected partition 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-634, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-634, default 634):
Using default value 634
Command (m for help): d
Command (m for help): a
Partition number (1-4): 1
Partition number (1-4): 1
Command (m for help): w
The partition table has been altered!
The partition table has been altered!
resize2fs /dev/xvda1
quinta-feira, 25 de junho de 2015
Setup AWS cli to access your account [for a Linux/Mac client]
This short recipe shows how to setup your Access Key to view, change and manage your AWS resources.
1) You need to get your access keys. When you create a new account you have the option to generate an Access Key to the new user on creation. Take in mind that after generation the key is displayed only ONCE. You CANNOT recover a secret key, for obvious security reasons.
Best practice hint: NEVER use the Access keys from the root account (the Mail you used to create your AWS account), create an IAM account to manage all AWS resources.
2) After you have your Access Key ID and Secret Acess Key we can move forward.
3) Here we will cover the most simple way to setup your credentials, for a detailed overview, please check the document link in the end of this tech recipe.
If you have only one account you may type only
You must specify the AWS Access Key ID, the Secret Access Key and the Region. For a list of regions and endpoints, please refer to this document: http://docs.aws.amazon.com/general/latest/gr/rande.html
If you have multiple AWS customers or IAM accounts you can define different profiles for each of these.
1) You need to get your access keys. When you create a new account you have the option to generate an Access Key to the new user on creation. Take in mind that after generation the key is displayed only ONCE. You CANNOT recover a secret key, for obvious security reasons.
Best practice hint: NEVER use the Access keys from the root account (the Mail you used to create your AWS account), create an IAM account to manage all AWS resources.
2) After you have your Access Key ID and Secret Acess Key we can move forward.
3) Here we will cover the most simple way to setup your credentials, for a detailed overview, please check the document link in the end of this tech recipe.
If you have only one account you may type only
$ aws configure AWS Access Key ID [None]:Replace the red options with your settings, the region you use the most and the output format, for the output we have 3 options: json, text or table, default is json.AKIAIOSFODNN7EXAMPLEAWS Secret Access Key [None]:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYDefault region name [None]:us-west-2Default output format [None]:json
You must specify the AWS Access Key ID, the Secret Access Key and the Region. For a list of regions and endpoints, please refer to this document: http://docs.aws.amazon.com/general/latest/gr/rande.html
If you have multiple AWS customers or IAM accounts you can define different profiles for each of these.
$ aws configure --profile TEST-ENVIRONMENT AWS Access Key ID [None]:4) Test if your configured account is working: And you are done! Now it is time to explore the AWS CLI documentation and see what you can do with it.AKIAI44QH8DHBEXAMPLEAWS Secret Access Key [None]:je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEYDefault region name [None]:us-east-1Default output format [None]:text
$ aws ec2 describe-volumes --profile TEST-ENVIRONMENT
5. Further reading:
http://docs.aws.amazon.com/cli/latest/userguide/tutorial-ec2-ubuntu.html#configure-cli-launch-ec2
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html
terça-feira, 23 de junho de 2015
Setup AWSCLI on MacOS 10.9.5
A very short recipe how I just did it on my client:
1) Download Python: as I write the latest version is 3.4.3 - https://www.python.org/downloads/release/python-343/
2) Install it (GUI installer);
3) Install pip [easy installer for Python tools (easier to setup awscli later)]:
$ sudo easy_install pip
4) Install awscli with pip
$ sudo pip install awscli
5) Test it:
$ aws --version
1) Download Python: as I write the latest version is 3.4.3 - https://www.python.org/downloads/release/python-343/
2) Install it (GUI installer);
3) Install pip [easy installer for Python tools (easier to setup awscli later)]:
$ sudo easy_install pip
4) Install awscli with pip
$ sudo pip install awscli
5) Test it:
$ aws --version
aws-cli/1.7.35 Python/2.7.5 Darwin/13.4.0
And you are ready to setup your access to AWS. I will talk about it in another article.
quinta-feira, 5 de fevereiro de 2015
VSphere Web Cli: change the default language
If you had like me, the experience to work for multinacional companies and have several customers in different countries, you could have the need to support systems on foreign languages.
Recently I had to support a vSphere environment in Germany, and I got confused with the huge names on Web Cli. Here's how you workaround the language issue:
Append the localization parameter to the URL used for accessing the web client:
Note: Languages supported are English, German, French, Japanese, Korean, and Chinese.
Append the localization parameter to the URL used for accessing the web client:
Note: Languages supported are English, German, French, Japanese, Korean, and Chinese.
- The default URL for the vSphere Web Client is:
https://client-hostname:9443/vsphere-client - To specify a language, append:
- English:
/?locale=en_US - German:
/?locale=de_DE - French:
/?locale=fr_FR - Japanese:
/?locale=ja_JP - Korean:
/?locale=ko_KR - Chinese:
/?locale=zh_CN
- English:
- For example, to display the vSphere Web Client in French, use:
https://client-hostname:9443/vsphere-client/?locale=fr_FR
Source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1016403
sábado, 15 de fevereiro de 2014
Install Hadoop 2.2.0 on Ubuntu 12.0.4 LTS
I am starting to learn and study harder on the Big Data and Analytics area. You may notice from now on a shift from this blog from a more Microsoft-centric approach to a more mixed use, Open Source snippets followed by hints on Microsoft services I work with for years.
Let's start with Hadoop!
I will here only post a great tutorial: http://codesfusion.blogspot.com.br/2013/10/setup-hadoop-2x-220-on-ubuntu.html?m=1
This tutorial was applied with a 100% accuracy on Ubuntu 12.0.4. Enjoy!
Let's start with Hadoop!
I will here only post a great tutorial: http://codesfusion.blogspot.com.br/2013/10/setup-hadoop-2x-220-on-ubuntu.html?m=1
This tutorial was applied with a 100% accuracy on Ubuntu 12.0.4. Enjoy!
Assinar:
Postagens (Atom)