Skip to content

Instantly share code, notes, and snippets.

@c0mpiler
c0mpiler / hadoop_install.sh
Last active August 29, 2015 14:05
hadoop_2.5.0_Initial_setup_centos
cd ~ && mkdir tmp
sudo chown -R harsha:harsha tmp
cd tmp
wget http://www.carfab.com/apachesoftware/hadoop/common/stable/hadoop-2.5.0.tar.gz
tar xvzf hadoop-2.5.0.tar.gz
sudo mv hadoop-2.5.0 /usr/local/hadoop
sudo yum install -y java-1.7.0-openjdk java-1.7.0-openjdk-devel
java -version
echo "export JRE_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65-2.5.1.2.el7_0.x86_64/jre
@c0mpiler
c0mpiler / centos.ks
Last active June 7, 2020 19:13
Kickstart centos7 installation
# CentOS 7.0 kickstart for XenServer
# branch: develop
##########################################
# Install, not upgrade
install
# Install from a friendly mirror and add updates
url --url http://mirror.rackspace.com/CentOS/7.0.1406/os/x86_64/
repo --name=centos-updates --mirrorlist=http://mirrorlist.centos.org/?release=7.0.1406&arch=x86_64&repo=updates
@c0mpiler
c0mpiler / com.ins8s.hdfs.tools.HDFSUpload.java
Created February 10, 2016 22:14
ploading files through Java API to HDFS
package com.ins8s.hdfs.tools;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
@c0mpiler
c0mpiler / FileWritingPerfTest.java
Created March 4, 2016 10:54
Writing to a very very large file - performance test
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
public class FileWritingPerfTest {
printf "\nlocal: " ; ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'
myip=$(curl -s ipecho.net/plain)
printf "public: $myip " ; echo ; echo
geoiplookup $myip ; echo
cat lsof.log | awk '{ print $2 " " $1; }' | sort -rn | uniq -c | sort -rn | head -20
cd /proc
for pid in [0-9]*
do
echo "PID = $pid with $(ls /proc/$pid/fd/ | wc -l) file descriptors"
done
@c0mpiler
c0mpiler / reclaimWindows10.ps1
Created January 8, 2017 00:37
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <[email protected]>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
@c0mpiler
c0mpiler / chrome-different-tz.sh
Created January 9, 2017 00:17
Open chrome with a spoofed timezone set
#!/usr/bin/env bash
# chrome-different-tz
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@c0mpiler
c0mpiler / add-rabbitmq-admin.sh
Last active October 13, 2017 03:04
Create a new RabbitMQ user as 'administrator'
#user: c0mpiler
#password: testpwd123
rabbitmqctl add_user c0mpiler testpwd123
rabbitmqctl set_user_tags c0mpiler administrator
rabbitmqctl set_permissions -p / c0mpiler ".*" ".*" ".*"
curl -i -u c0mpiler:testpwd123 http://localhost:15672/api/whoami