Skip to content

Instantly share code, notes, and snippets.

View apetresc's full-sized avatar

Adrian Petrescu apetresc

View GitHub Profile
@apetresc
apetresc / 250.py
Created January 30, 2014 04:11
SRM 605 - apetresc
class EllysSubstringSorter(object):
def applyDevice(self, S, L, i):
return S[0:i] + ''.join(sorted([c for c in S[i:i+L]])) + S[i+L:]
def getMin(self, S, L):
return sorted([self.applyDevice(S, L, i) for i in range(0, len(S) - L + 1)])[0]
@apetresc
apetresc / gist:8905793
Created February 9, 2014 20:54
Result of vagrant halt
$ vagrant halt
[default] Attempting graceful shutdown of VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
sudo /usr/sbin/shutdown -y -i5 -g0
@apetresc
apetresc / connection2.py
Created April 29, 2014 20:36
connection2.py
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the fol-
# lowing conditions:
#
@apetresc
apetresc / jetty.xml
Created May 14, 2014 21:15
SmartOS/Solaris SMF Manifest for Jetty
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle
    type="manifest"
    name="jetty">
    <service
        name="application/servers/jetty"
        type="service"
        version="1">
        <create_default_instance enabled="false" />
@apetresc
apetresc / dabblet.css
Created May 26, 2014 21:16
Triangle with Shadow
/*
Triangle with Shadow
*/
.triangle-with-shadow {
width: 100px;
height: 100px;
position: relative;
overflow: hidden;
box-shadow: 0 0px 10px -17px rgba(0,0,0,0.5);
@apetresc
apetresc / backtype.storm.cluster-test.xml
Created June 16, 2014 19:33
Error report for v0.9.2-incubating
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite package="backtype.storm" name="cluster-test">
<testcase name="test-basics" classname="backtype.storm.cluster-test">
</testcase>
<testcase name="test-ephemeral" classname="backtype.storm.cluster-test">
</testcase>
<testcase name="test-storm-cluster-state-errors" classname="backtype.storm.cluster-test">
RuntimeException =&gt; java.lang.IllegalArgumentException
at backtype.storm.cluster_test$fn__6869.invoke(cluster_test.clj:211)
@apetresc
apetresc / dmesg
Created August 6, 2014 19:26
dmesg
[ 4469.277419] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 4469.278023] IP: [< (null)>] (null)
[ 4469.278317] PGD 12988067 PUD 13f6d067 PMD 0
[ 4469.278600] Oops: 0010 [#20] SMP
[ 4469.278874] Modules linked in: vboxsf(OF) dm_crypt ppdev nfsd vboxvideo(OF) auth_rpcgss nfs_acl psmouse nfs lockd sunrpc serio_raw i2c_piix4 vboxguest(OF) parport_pc fscache drm lp mac_hid parport e1000
[ 4469.279733] CPU: 0 PID: 3448 Comm: bash Tainted: GF D O 3.13.0-24-generic #46-Ubuntu
[ 4469.280041] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[ 4469.280041] task: ffff8800170947d0 ti: ffff8800128f8000 task.ti: ffff8800128f8000
[ 4469.280041] RIP: 0010:[<0000000000000000>] [< (null)>] (null)
[ 4469.280041] RSP: 0018:ffff8800128f9d00 EFLAGS: 00010246

Keybase proof

I hereby claim:

  • I am apetresc on github.
  • I am apetresc (https://keybase.io/apetresc) on keybase.
  • I have a public key whose fingerprint is 4569 D011 F994 531A D8F3 A362 4A3F AF25 27A0 B509

To claim this, I am signing this object:

@apetresc
apetresc / gist:d5d8ff851bf7f01fb3a7
Created January 12, 2015 21:18
Cassandra JVM params
-ea
-javaagent:/usr/local/cassandra/lib/jamm-0.2.6.jar
-XX:+CMSClassUnloadingEnabled
-XX:+UseThreadPriorities
-XX:ThreadPriorityPolicy=42
-Xms7540M
-Xmx7540M
-Xmn800M
-XX:+HeapDumpOnOutOfMemoryError
-Xss256k
@apetresc
apetresc / .zsh-aliases
Created May 13, 2015 14:33
This alias causes zsh to segfault on `brew upgrade`
alias brew-upgrade='brew upgrade'
brew-upgrade() {
brew upgrade --all
}