Tuesday, 1 March 2016
Hadoop - Just the Basics for Big Data Rookies
This session assumes absolutely no knowledge of Apache Hadoop and will provide a complete introduction to all the major aspects of Hadoop.
Friday, 26 February 2016
How To Use SSH to Connect to a Remote Server in Ubuntu VIA a BASTION
What Is SSH?
One essential tool to master as a system administrator is SSH.
SSH, or Secure Shell, is a protocol used to securely log onto remote systems. It is the most common way to access remote Linux and Unix-like servers, such as VPS instances.
In this guide, we will discuss how to use SSH to connect to a remote system.
It is often good practice to set up a Bastion server which is essentially a Gateway to other servers.
If you do this then you can configure your otheer servers to only allow SSH access from your Bastion ONLY.
This post is to help with that process...
If stuck completly read this first ... https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server-in-ubuntu
SSH connection via the Bastion
SSH into any instance should be done via the Bastion server.
SSH-ing from the Bastion server into a different server generally requires the Bastion public key to be in the authorized_keys in the target server.
Connecting to a new instance, where the Bastion public key is not in authorized_keys
Ensure that the security group for the new instance allows connection from the Bastion.
You can use SSH agent forwarding. This technique allows you to use a keypair to connect from the Bastion, without the private key needing to be on the Bastion.
You should know the keypair the new instance is created with. Open Pageant (on your PC) and import the keypair corresponding to your new instance.
Note: You know Pageant is running if you check the Notification Icons on your PC's task bar.
Connecting to a new instance, where the Bastion public key is not in authorized_keys
Ensure that the security group for the new instance allows connection from the Bastion.
You can use SSH agent forwarding. This technique allows you to use a keypair to connect from the Bastion, without the private key needing to be on the Bastion.
You should know the keypair the new instance is created with. Open Pageant (on your PC) and import the keypair corresponding to your new instance.
Note: You know Pageant is running if you check the Notification Icons on your PC's task bar.
The other way you know it isn't running is if your Linux server gives the following error following issuing the ssh-add -L command: In putty, connect to the Bastion using its private key, but in ”Connection → ssh → auth” check the box for Allow agent forwarding.
ssh-add –LNow from the Bastion server, ssh into the target instance:
ssh [PRIVATE IP OF TARGET INSTANCE]Once you are here, add the Bastion public key to authorized_keys so that agent forwarding won't be required for future connections from the Bastion.
Or leave it as is to make things easy.
Thursday, 25 February 2016
generatedata.com - Fake Your Data
Sometimes you need fake data for things like testing software, populating databases, creating realistic-looking mockups and so on. For text, we have lorem ipsum; but for everything else you have to do a bit of legwork. Human-data especially - like names, addresses, town names etc. - are particularly hard to fake because you need a semi-realistically looking data set.
Friday, 12 February 2016
Word of the Day: zombie server (comatose server)
A zombie server is a physical server that is running but has no external communications or visibility and contributes no compute resources; essentially, it consumes electricity but serves no useful purpose. Zombie servers are also referred to as comatose servers.
Zombie servers are often created because user-requested applications end up getting no use or almost no use (typically defined as under six percent). Other causes include redundant or legacy applications and services that have been replaced. An estimated one in three servers in North America falls into the "undead" category.
According to a study conducted by the consulting firm Anthesis Group and Jonathan Koomey, a research fellow at Stanford University, there are approximately 3.6 million zombie servers in the United States; worldwide, the total could be as high as 10 million.
AOL's five-year project to purge its sites of zombie servers netted the organization $10 million and in just one year resulted in a 35 percent reduction in its carbon footprint. Based on calculations by TSO Logic, a company with 1000 servers could achieve a net savings of $300,000 simply by pulling the plug on its comatose servers.
Zombie servers are often created because user-requested applications end up getting no use or almost no use (typically defined as under six percent). Other causes include redundant or legacy applications and services that have been replaced. An estimated one in three servers in North America falls into the "undead" category.
According to a study conducted by the consulting firm Anthesis Group and Jonathan Koomey, a research fellow at Stanford University, there are approximately 3.6 million zombie servers in the United States; worldwide, the total could be as high as 10 million.
AOL's five-year project to purge its sites of zombie servers netted the organization $10 million and in just one year resulted in a 35 percent reduction in its carbon footprint. Based on calculations by TSO Logic, a company with 1000 servers could achieve a net savings of $300,000 simply by pulling the plug on its comatose servers.
[Originaly published on http://whatis.techtarget.com/]
Monday, 18 January 2016
Word of the day: unikernel
A unikernel is an executable image that can execute natively on a hypervisor without the need for a separate operating system. The image contains application code as well as all the operating system functions required by that application.
Unikernels are usually built using compilers that leverage library operating systems, which are collections of libraries that represent an operating system's core capabilities. This allows a unikernel developer to selectively include only those library components required to make an application work. Traditional operating system functions, such as network or file system handling, are selectively compiled in to the final executable on an as-needed basis.
Unikernels use a fraction of the resources required by full multipurpose operating systems, such as Linux or Microsoft Windows Server. Their diminutive size enables sub-second startup times and high deployment densities unmatched in traditional server virtualization. Additionally, the minimal footprint of the library OS functions and the absence of traditional operating system utilities greatly reduces the attack surface available for exploitation by malicious hackers.
Some unikernel build systems leverage type-safe languages like Haskell or Erlang, while others can bind to more common languages like C, C++, or Java. Not all applications are suitable for unikernels. Applications that require multiple processes in a single VM are not good candidates, but a huge number of traditional application images could become much smaller and faster when recompiled as unikernels.
Numerous unikernel build systems are available from multiple sources, with the open source community leading the way. Some of the more popular unikernel systems include MirageOS from the Xen Project incubator, Drawbridge from Microsoft, Haskell Lightweight Virtual Machine (HaLVM), LING (formerly Erlang on Xen), OSv, Project Guest VM Microkernel, IncludeOS, rump kernels which leverage NetBSD's library of OS functions, ClickOS created by NEC Laboratories Europe, and Clive from researchers at the Universidad Rey Juan Carlos of Madrid (Spain).
Unikernels are usually built using compilers that leverage library operating systems, which are collections of libraries that represent an operating system's core capabilities. This allows a unikernel developer to selectively include only those library components required to make an application work. Traditional operating system functions, such as network or file system handling, are selectively compiled in to the final executable on an as-needed basis.
Unikernels use a fraction of the resources required by full multipurpose operating systems, such as Linux or Microsoft Windows Server. Their diminutive size enables sub-second startup times and high deployment densities unmatched in traditional server virtualization. Additionally, the minimal footprint of the library OS functions and the absence of traditional operating system utilities greatly reduces the attack surface available for exploitation by malicious hackers.
Some unikernel build systems leverage type-safe languages like Haskell or Erlang, while others can bind to more common languages like C, C++, or Java. Not all applications are suitable for unikernels. Applications that require multiple processes in a single VM are not good candidates, but a huge number of traditional application images could become much smaller and faster when recompiled as unikernels.
Numerous unikernel build systems are available from multiple sources, with the open source community leading the way. Some of the more popular unikernel systems include MirageOS from the Xen Project incubator, Drawbridge from Microsoft, Haskell Lightweight Virtual Machine (HaLVM), LING (formerly Erlang on Xen), OSv, Project Guest VM Microkernel, IncludeOS, rump kernels which leverage NetBSD's library of OS functions, ClickOS created by NEC Laboratories Europe, and Clive from researchers at the Universidad Rey Juan Carlos of Madrid (Spain).
Friday, 18 December 2015
Java Random
I helped a colleague recently determine whether Java Random() was worth using in a situation where the client had to be certain that the numbers were truly random.
Our concern was that while a small sample of random numbers (especially while seeded with the current time ) are fit for most purposes they are not appropriate where due dillegence needs to be performed.
The reason being most random number generators are only pseudo random.
So we did some research and asked some of our experts about the suitability
of the Java Random function. Things to note are defined below:
- Most of the documents on the subject are quite old and therefore there may be improvements, but I couldn’t find anything which said it had materially changed.
- It is worth noting that we are looking at Pseudo Random Number Generators and not truly random numbers. For the use cases discussed I don’t believe that would be an issue, but that would not be the case in some gambling and cryptography applications
- Where true random numbers are required, a random number service and/or specific random number hardware is used. I don’t believe this is required in this application [https://api.random.org/json-rpc/1/]
- People have been fairly scathing of Java Random, identifying that the current implementation only uses 17 bits of entropy from the initial seed (i.e. 1 in 131072 starting points) and demonstrates repeating patterns after low numbers of calls to generate numbers (of the order of ~50000). Statistical tests have been used to identify that it doesn’t produce very good random numbers [http://www.alife.co.uk/nonrandom/]
- SecureRandom is a drop in replacement for Random and does produce much better random numbers that pass Statistical tests, but it is 60 times slower than Random [https://dzone.com/articles/java-programmer%E2%80%99s-guide-random]. In the way that the Batch report is using random numbers, it appears that of the order of 500 random numbers would be required. A quick test shows that 500 SecureRandom numbers only takes ~15 Milliseconds to calculate. Which isn’t going to significantly affect the time taken for a result.
- There are libraries that support alternative ways of creating random numbers. These produce good quality pseudo random numbers in less time than the standard Java implementations, but would require additional libraries and dependencies to be managed. In this case I do not believe it would be worth the additional effort. [http://maths.uncommons.org/] [https://www.bouncycastle.org/java.html]
Based on the
number of random numbers being generated (maximum of around 500 at a time),
Random may well be sufficient. But given the minimal cost of using
SecureRandom it may be worth converting to that instead, to remove even a small
possibility of concern.
Monday, 30 November 2015
The AWS Well-Architected Framework
A repost from InfoQ but with a good PDF for later reading.
Amazon has published the AWS Well-Architected Framework (PDF), a guide for architecting solutions for AWS, with design principles that apply to systems running on AWS or other clouds.
Amazon has based the AWS Well-Architected Framework on four pillars and a number of design principles as outlined in short bellow.
Amazon has published the AWS Well-Architected Framework (PDF), a guide for architecting solutions for AWS, with design principles that apply to systems running on AWS or other clouds.
Amazon has based the AWS Well-Architected Framework on four pillars and a number of design principles as outlined in short bellow.
Security.
According to Amazon, security in the cloud regards 4 areas - Data Protection, Privilege Management, Infrastructure Protection, Detective Controls – and they recommend the following design principles to strengthen the security of a system:
- Apply security at all levels
- Trace everything
- Automate responses to security events
- Secure the system at the application, data and OS level
- Automate security best practices
Reliability.
This pillar represents a system’s ability to “recover from infrastructure or service disruptions, dynamically acquire computing resources to meet demand, and mitigate disruptions such as misconfigurations or transient network issues.” The areas covered by reliability are Foundations, Change Management and Failure Management, and the paper recommends the following design principles:
- Test recovery procedures
- Automatically recover from failure
- Use horizontal scalability to increase availability
- Automatically add/remove resources as needed
Efficiency.
This is about efficient use of CPU, storage, and database resources. It also covers the space-time trade-off, i.e. consuming more memory and disk space to solve a problem quicker or using less resources but solving it in more time. The design principles recommended are:
- Use advanced technologies
- Deploy the system globally for lower latency
- Use services rather than servers
- Try various configurations to find out what performs better
Cost Optimization.
This is evidently about optimizing costs, eliminating unneeded or suboptimal resources. Cost optimization should consider matching supply with demand, using cost effective resources, keeping an eye on expenses, and lowering the costs over time. This can be done by:
The framework includes a list of questions to be used when assessing a proposed architecture, such as “How are you encrypting and protecting your data at rest?” or “How are you planning your network topology on AWS?”. The authors also provide their recommendations for addressing each of the problems mentioned in these questions, some of them applying only to AWS, others being valid for any cloud computing architecture.
This article has extracted the main points from the 56-pages whitepaper on architecting solutions for the cloud. For a detailed explanation of all the best practice.
- Transparently attribute expenditure
- Use managed services
- Buy computing resources in the cloud rather than hardware
- Use the cloud for its pay-as-you-go policy
- Do not invest in data centers
The framework includes a list of questions to be used when assessing a proposed architecture, such as “How are you encrypting and protecting your data at rest?” or “How are you planning your network topology on AWS?”. The authors also provide their recommendations for addressing each of the problems mentioned in these questions, some of them applying only to AWS, others being valid for any cloud computing architecture.
This article has extracted the main points from the 56-pages whitepaper on architecting solutions for the cloud. For a detailed explanation of all the best practice.
Subscribe to:
Posts (Atom)


