Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mdellabitta's full-sized avatar

Michael Della Bitta mdellabitta

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mdellabitta on github.
  • I am michaeldb (https://keybase.io/michaeldb) on keybase.
  • I have a public key ASBExrW5r7uG2cWtfoa1ahCcsFQYAiex64LB8AjfbwJK7go

To claim this, I am signing this object:

@mdellabitta
mdellabitta / README.md
Last active December 31, 2021 02:16
How to build hadoop native dylibs for macOS for Spark

How to build hadoop native dylibs for macOS for Spark

This worked for me for the versions of Hadoop and Spark that I needed to use. Probably will work for other versions as well, until macOS takes the next step further from the light...

  1. Install dependencies with homebrew:
    • snappy
    • zlib
    • zstd
    • bzip2

Keybase proof

I hereby claim:

  • I am mdellabitta on github.
  • I am mdellabitta (https://keybase.io/mdellabitta) on keybase.
  • I have a public key ASBjFMmoR7kiSy8ncYpQwNh9_0tJDm6xWvu5u9_nm9mE6go

To claim this, I am signing this object:

@mdellabitta
mdellabitta / assembly.xml
Created July 23, 2013 19:58
assembly.xml for hadoop jar... in src/main/resources
<?xml version="1.0" ?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>hadoop</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
@mdellabitta
mdellabitta / gist:6065621
Created July 23, 2013 19:57
Maven assembly for hadoop jar
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>some-id</id>
<configuration>
<finalName>some-name</finalName>
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Mapper;
public class SolrMapper extends Mapper<LongWritable, Text, Text, Text> {
private HttpSolrServer solrServer;
private Text outKey = new Text();
@Override
<add>
<doc>
<field name="one">1</field>
<field name="one">3</field>
<field name="two">2</field>
<field name="two">4</field>
<field name="two">6</field>
<field name="two">8</field>
</doc>
</add>
@mdellabitta
mdellabitta / gist:4171654
Created November 29, 2012 20:23
Simple script for autodetecting number of displays and switching between xrandr/arandr layouts
#!/usr/bin/env ruby
output = `xrandr --query`
ids = output.lines.find_all do |line|
line =~ /\sconnected/
end
if ids.size == 1
@mdellabitta
mdellabitta / gist:1444522
Created December 7, 2011 20:35
Fedora HTTP client settings
<param name="httpClientTimeoutSecs" value="20">
<comment>Number of seconds Fedora http client will wait for a connection before timing
out.</comment>
</param>
<param name="httpClientSocketTimeoutSecs" value="120">
<comment>Number of seconds Fedora http client will wait for data coming across an
established http connection.</comment>
</param>
<param name="httpClientMaxConnectionsPerHost" value="20">
<comment>Maximum number of Fedora http client connections allowed to a given host.</comment>
@mdellabitta
mdellabitta / gist:1444504
Created December 7, 2011 20:31
Fedora DOS Attack?
require 'csv'
CSV.open("list_of_pids.csv", "rb").each do |csv|
pid = csv[1]
["JP2", "THUMBNAIL", "WIDE_THUMBNAIL", "REFERENCE_THUMBNAIL"].each do |ds_id|
response = `curl --silent -I "http://example.org:8080/fedora/objects/#{pid}/datastreams/#{ds_id}/content" --user "fedoraAdmin:somepassword"`
puts "#{csv[0]},#{csv[1]},#{ds_id},#{response.lines.first}"
end
end