Skip to content

Instantly share code, notes, and snippets.

@pgrm
pgrm / set_random_mac_address.sh
Created May 23, 2014 07:25
I'm having troubles with my internet connection and need to connect to my router with a different mac address every time. This script creates a random mac address and tries to set it, when the two mac-addresses displayed by this script are the same, it was set successfully.
macAddress=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
sudo ifconfig en0 ether $macAddress
echo "new mac address:"
echo $macAddress
sudo ifconfig en0 ether
2014-06-09T18:30:40,093Z ERROR o.a.d.e.p.i.p.ProjectRecordBatch [zk1] [37daf04b-7d82-4d2f-987c-59851f2aeafe:frag:0:0] AbstractSingleRecordBatch:next(AbstractSingleRecordBatch.java:60) - Failure during query
org.apache.drill.exec.exception.SchemaChangeException: Failure while attempting to load generated class
at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:243)
at org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:57)
at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.next(ProjectRecordBatch.java:83)
at org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:45)
at org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.next(LimitRecordBatch.java:99)
at org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:45)
at org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.next(RemovingRecordBatch.java:94)
at org
package org.apache.drill.exec.test.generated;
import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.expr.holders.BitHolder;
import org.apache.drill.exec.expr.holders.VarCharHolder;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.record.RecordBatch;
import org.apache.drill.exec.vector.RepeatedVarCharVector;
import org.apache.drill.exec.vector.VarCharVector;
import org.apache.drill.exec.vector.complex.impl.RepeatedVarCharReaderImpl;
2014-06-21 10:24:03,729 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl: Stopping resource-monitoring for container_1403345039835_0001_01_000009
2014-06-21 10:24:04,961 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl: Start request for container_1403345039835_0001_01_000010 by user ubuntu
2014-06-21 10:24:04,961 INFO org.apache.hadoop.yarn.server.nodemanager.NMAuditLogger: USER=ubuntu IP=10.216.60.23 OPERATION=Start Container Request TARGET=ContainerManageImpl RESULT=SUCCESS APPID=application_1403345039835_0001 CONTAINERID=container_1403345039835_0001_01_000010
2014-06-21 10:24:04,961 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application: Adding container_1403345039835_0001_01_000010 to application application_1403345039835_0001
2014-06-21 10:24:04,966 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container: Container container_1403345039835_0001
@pgrm
pgrm / Sudoku.hs
Created October 20, 2012 01:56
Haskell Sudoku Solver
import Data.List
--2)
type Row = [Integer]
type Sudoku = [Row]
data Variant = Basic | Cross | Color deriving (Eq,Show)
isRowValid :: Row -> Bool
@pgrm
pgrm / SimpleCsvLoader.cs
Created October 20, 2012 15:03
Simple CSV Loader first version
using System;
using System.Collections.Generic;
using System.IO;
namespace SimpleCsvLoader
{
public class CsvLoader
{
private char _delimiter;
private string _fileName;
@pgrm
pgrm / gist:4130686
Created November 22, 2012 11:29
AMPP - weired max
max=MAX3(diag,down,right);
if (max <= 0) {
h[i][j]=0;
xTraceback[i][j]=-1;
yTraceback[i][j]=-1;
// these values already -1
}
else if (max == diag) {
h[i][j]=diag;
xTraceback[i][j]=i-1;
@pgrm
pgrm / smithWaterman.c
Created November 22, 2012 11:34
AMPP Full Code
/*-------------------------------------------------------------
Copyright (C) 2000 Peter Clote.
All Rights Reserved.
Permission to use, copy, modify, and distribute this
software and its documentation for NON-COMMERCIAL purposes
and without fee is hereby granted provided that this
copyright notice appears in all copies.
@pgrm
pgrm / gist:4130672
Created November 22, 2012 11:25
AMPP - crappy loop
do {
ch = fgetc(in1);
if ( ch == EOF ) break;
LOOP1: if ( ch == 10 || ch == 13 ) {
// newline or carriage return
ch = fgetc(in1);
if ( ch == EOF ) break;
goto LOOP1;
}
// Bad style with 'goto', but then
@pgrm
pgrm / gist:4263803
Created December 12, 2012 00:37
MPI Error
[root@CentOS src]# make run_mpi
mpicc -o sw.o smith_waterman.c
mpiexec -np 1 ./sw.o ../input_data/sequence1.dat ../input_data/sequence2.dat ../input_data/data.score -1
argv[0] = ./sw.o
argv[1] = ../input_data/sequence1.dat
argv[2] = ../input_data/sequence2.dat
argv[3] = ../input_data/data.score
argv[4] = -1
./sw.o: invalid option -- '1'
PAM file empty