Install the Rails gem if you haven't done so before
CSV FILE DIFF SCRIPT
- Uses standard Python3 modules
- Finds diff between 2 CSV files & prints results to HTML
- Finds and prints list of items found in both files
- Does NOT find duplicates in same file
USAGE:
- Download script file and sample CSVs to a directory on your computer
- Run script with this command>>
python3 compare_csv_files.py
- Script will generate html report in same directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
yum install httpd -y | |
yum update -y | |
aws s3 cp s3://mywebbucket-cloudguru /var/www/html/ --recursive | |
service httpd start | |
chkconfig httpd on | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Basic blocks of code that will build a CSV file using repsonse data from API calls | |
This is a "one-off" process, meaning you will | |
1. run Gatling script to generate CSV file using REST calls (usually POSTS, but GETS or datbase queries could work ) | |
2. copy the file into your project | |
3. compile and run Gatling | |
*/ | |
class MySimulation extends Simulation { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is the difference between "express": "^4.13.3" and "express": "~4.13.3" ? | |
What happens if I use `npm install <package> --save` instead of `npm install <package> --save-dev` ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Take note of length - it is used as a String[] property > strings.length AND as a method for a String | |
array element > strings[i].length(). | |
*/ | |
public Map<String, String> pairs(String[] strings) { | |
Map<String,String> map = new HashMap<String,String>(); | |
for (int i = 0; i < strings.length; i++ ) { | |
if (strings[i].length() == 1 ) { | |
Character first = strings[i].charAt(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* MAVEN TO GRADLE */ | |
- Navigate to directory where the POM is located | |
- Run gradle init | |
> this will convert the Maven build to Gradle build (new settings.gradle & one or more build.gradle files) | |
/* GRADLE TO MAVEN */ | |
- Add Maven plugin to build.gradle file | |
ex. | |
apply plugin: 'java' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an alternative method for getting a list of defined enums to avoid system creating a clone of the String array | |
// this is the .values() method | |
public enum Car { | |
TESLA, VOLVO, TOYOTA; | |
} | |
// normally what would happen | |
public static Car[] values() { | |
return (Car[])$VALUES.clone(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package src.main.java; | |
import java.util.Collections; | |
import java.util.List; | |
/** | |
* Created by nwhit8 on 11/1/15. | |
*/ | |
public class Day { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While you can get the public and private IP address of your Amazon EC2 instance via the AWS Console, it may be extremely useful to query it from anywhere you can make an HTTP request, such a shell script. The operation is really simple, just make a GET request to the following URL from within your EC2 instance: | |
Local IP: | |
curl http://169.254.169.254/latest/meta-data/local-ipv4 | |
Public IP: | |
curl http://169.254.169.254/latest/meta-data/public-ipv4 | |
I often use this feature to pre-configure services and update configuration files, as in EC2 you get a new IP Address each time you reboot |
NewerOlder