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
# This shell script displays hostname and IP Address of the Ubuntu machine before the login prompt. | |
# Add this file to '/etc/network/if-up.d/' and '/etc/network/if-post-down.d/' folders and mark them as executables. | |
# Display Ubuntu default information [the current version of Ubuntu]. | |
cat /etc/issue.net > /etc/issue | |
# Display the hostname. | |
hostname >> /etc/issue | |
# Display the IP Address of eth0. |
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
sudo service iptables save | |
sudo service iptables stop | |
sudo chkconfig iptables off | |
# Ubuntu | |
sudo ufw status | |
sudo ufw off |
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
import os | |
# Current working directory where files and folders are present. | |
rootDir = os.getcwd() | |
# Destination directory to copy files. | |
destinationDir = 'D:/GBR/' | |
# Walk thru the directories in this root directory. | |
for dirName, subdirList, fileList in os.walk(rootDir): |
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
import os | |
folder_name = 'D:/issue/' | |
for i in range(1, 79): | |
fileName = folder_name + str(i) + ".tsv" | |
if not os.path.isfile(fileName): | |
with open(fileName, 'w') as f: | |
f.write('word\tcount\n') | |
f.close() |
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
import java.io.IOException; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.LongWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.io.NullWritable; | |
import org.apache.hadoop.mapreduce.Job; | |
import org.apache.hadoop.mapreduce.Mapper; |
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
Lifecycle Phase Description | |
validate Validates whether project is correct and all necessary information is available to complete the build process. | |
initialize Initializes build state, for example set properties | |
generate-sources Generate any source code to be included in compilation phase. | |
process-sources Process the source code, for example, filter any value. | |
generate-resources Generate resources to be included in the package. | |
process-resources Copy and process the resources into the destination directory, ready for packaging phase. | |
compile Compile the source code of the project. | |
process-classes Post-process the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes. | |
generate-test-sources Generate any test source code to be included in compilation phase. |
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
# This script lists down commands to download Chromium [both 32 and 64 bit] from the shell. | |
#Just in case, if you dont want to go thru this hassle, check Chromium Auto Updater. http://www.firstever.eu/en/chromium-auto-updater. | |
#Steps for downloading 32 bit Chromium for Windows. | |
export ver=`curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE` | |
echo $ver | |
wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/$ver/chrome-win32.zip | |
mv chrome-win32.zip chrome-win32__$ver.zip |
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
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget. | |
### You can download all the binaries one-shot by just giving the BASE_URL. | |
### Script might be useful if you need Oracle JDK on Amazon EC2 env. | |
### Script is updated for every JDK release. | |
### Features:- | |
# 1. Resumes a broken / interrupted [previous] download, if any. | |
# 2. Renames the file to a proper name with including platform info. |
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
import java.util.Random; | |
import java.util.concurrent.TimeUnit; | |
import com.google.common.base.Stopwatch; | |
/** | |
* Sample example demonstrating usage of Stopwatch API of Google Guava. | |
* | |
* @see <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Stopwatch.html">Guava Stopwatch</a> | |
*/ |
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
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.URL; | |
import java.util.Properties; | |
import com.google.common.io.ByteSource; | |
import com.google.common.io.Resources; | |
/** | |
* Reads a properties file and print all the key value pairs to the console. |