Posts

Showing posts from October, 2011

AWS CloudFormation Template: Is It Possible To Add Many CidrIp As A List?

Answer : Afraid not, as the documentation states it only accepts String and not List therefore multiple blocks are required. Think of it the same way as ingress rules are created within the web console, one new rule for each CIDR. Unfortunately, there's no iteration available through CloudFormation's Intrinsic Functions, and as you pointed out the AWS::EC2::SecurityGroupIngress resource itself only accepts a single String for its CidrIp property. As an alternative, I would recommend choosing an intermediate format to compile down to CloudFormation template JSON using a preprocessor, if/when greater expressive power is needed. You can use a full-featured library like troposphere, but it's also easy enough to code up your own basic preprocessing layer to suit your use-case and programming-language/library preferences. My current choice is a combination of YAML with embedded Ruby (ERB), mostly because I'm already familiar with them. Here's an example templ

Fileopen In C Code Example

Example: fopen c FILE * fopen ( const char * filename , const char * mode )
Note This module is part of ansible-base and included in all Ansible installations. In most cases, you can use the short module name include_vars even without specifying the collections: keyword. Despite that, we recommend you use the FQCN for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name. New in version 1.4: of ansible.builtin Synopsis Parameters Notes See Also Examples Return Values Synopsis Loads YAML/JSON variables dynamically from a file or directory, recursively, during task runtime. If loading a directory, the files are sorted alphabetically before being loaded. This module is also supported for Windows targets. To assign included variables to a different host than inventory_hostname , use delegate_to and set delegate_facts=yes . Note This module has a corresponding action plugin . Parameters Parameter Choices/Defaults Comments depth integer added in 2.2 o

Angular Ngfor Sort By Key Code Example

Example: angular 6 key value pair getvalue example @Component({ selector: 'app-myview', template: ` < div *ngFor = " let key of objectKeys(items) " > {{key + ' : ' + items[key]}} </ div > ` }) export class MyComponent { objectKeys = Object.keys; items = { keyOne: 'value 1', keyTwo: 'value 2', keyThree: 'value 3' }; constructor(){} }

Button Generator Css Code Example

Example: css button generator <!-- The <button> tag produces a button. Place the text/media you want to be on the button by placing it between the opening and closing tags: --> < button > Click me! </ button > <!-- It is possible to add attributes, such as 'id' and 'type', into the opening tag, just like most other elements: --> < button id = " submitButton " type = " submit " > Click here to submit! </ button >

Arduino Pinmode Mean Electronica Code Example

Example 1: arduino pinmode void setup() { pinMode(13, OUTPUT); // sets the digital pin 13 as output } void loop() { digitalWrite(13, HIGH); // sets the digital pin 13 on delay(1000); // waits for a second digitalWrite(13, LOW); // sets the digital pin 13 off delay(1000); // waits for a second } Example 2: arduino pinMode pinMode(Pin_number, State); ex: pinMode(2, HIGH);

Basics Of Python Encryption W/ Hashlib Sha1

Answer : The hashlib module provides hashing functions. While there is some relation to encryption, once you hash some data you can not go back to get the original data from the hash result. Instead of encripting the data you can take a different approach: creating a unique signature using a hash of the data and some secret. shared_private_key = "ABCDEF" def create_signature(data): return hashlib.sha1(repr(data) + "," + shared_private_key).hexdigest() def verify_signature(data, signature): return signature == create_signature(data) Finally, you send to the Website 2 the data plus the signature. That way you can be (mostly) sure that no unauthorized person tampered the data. What you want is an encryption library not one that just provides hash algorithms. With python's hashlib library: import hashlib m = hashlib.sha1() m.update("The quick brown fox jumps over the lazy dog") print(m.hexdigest()) Returns: 2fd4e1c67a2d28fced849ee

Black Sheep Discord Bot Commands Code Example

Example: black sheep discord Black Sheep Is the best Discord Bot To Ever Exist It's in 1000+ servers You can read more here - http://bit.ly/botsheep

C How To Use Extern Variable Code Example

Example: what is the usage of extern in c # include <stdio.h> extern int x = 32 ; int b = 8 ; int main ( ) { auto int a = 28 ; extern int b ; printf ( "The value of auto variable : %d\n" , a ) ; printf ( "The value of extern variables x and b : %d,%d\n" , x , b ) ; x = 15 ; printf ( "The value of modified extern variable x : %d\n" , x ) ; return 0 ; }

Boolean In C Print Code Example

Example: how to print boolean in c printf ( "%s" , x ? "true" : "false" ) ;

What Does ^ Mean Js Code Example

Example 1: what does += mean in JavaScript /* JavaScript shorthand += += is shorthand to add something to a variable and store the result as that same variable. */ // The standard syntax: var myVar = 2 ; console . log ( myVar ) // 2 var myVar = myVar + 3 ; console . log ( myVar ) // 5 // The shorthand: var myVar = 2 ; console . log ( myVar ) // 2 var myVar += 3 ; console . log ( myVar ) // 5 /* In JavaScript, += can also concatenate strings */ // The standard syntax: var myName = "Hi, I'm" console . log ( myName ) // Hi, I'm var myName = myName + " Joe." console . log ( myName ) // Hi, I'm Joe. // The shorthand: var myName = "Hi, I'm" console . log ( myName ) // Hi, I'm var myName += " Joe." console . log ( myName ) // Hi, I'm Joe. Example 2: what does -= mean in JavaScript /* JavaScript shorthand -= -= is shorthand to subtract something from a variable and store the res