Skip to content

Instantly share code, notes, and snippets.

View jvshahid's full-sized avatar

John Shahid jvshahid

View GitHub Profile
@jvshahid
jvshahid / multiple_implicits.scala
Created December 27, 2011 20:45
Multiple implicits with the same name cause a compilation error
package bmrk.eod.parsing.examples.inference
import java.util.SortedMap
object Implicits {
implicit def implicitDef[T <: AnyRef](key:String,columns:SortedMap[String,String]) (implicit m:Manifest[T]):T = {
null.asInstanceOf[T]
}
// If the next method is removed this file will compile
implicit def implicitDef[T <: AnyRef](key:String,columns:List[(String,String)]) (implicit m:Manifest[T]): T = {
@jvshahid
jvshahid / agent.rb
Last active December 21, 2015 18:19
Errplane agent chef recipe
# determine package type and architecture
user "errplane" do
action :create
system
end
if platform_family?("debian")
arch = node['kernel']['machine'] =~ /x86_64/ ? "amd64" : "i386"
package_name = "errplane-agent_latest_#{arch}.deb"
distro_provider = Chef::Provider::Package::Dpkg
@jvshahid
jvshahid / foo.rs
Last active December 27, 2015 07:59
rust trait implementation
trait HasName {
fn get_name(&self) -> ~str;
}
trait HasGreeting {
fn get_greeting(&self) -> ~str;
}
impl <T: HasName> HasGreeting for T {
fn get_greeting(&self) -> ~str {

Keybase proof

I hereby claim:

  • I am jvshahid on github.
  • I am jvshahid (https://keybase.io/jvshahid) on keybase.
  • I have a public key whose fingerprint is DF99 0D2D 66FD 16A5 BB26 0307 A788 1EF6 BD40 4BA5

To claim this, I am signing this object:

@jvshahid
jvshahid / influxdb#1033
Created October 16, 2014 17:12
Stacktrace for influxdb issue #1003
[10/16/14 07:35:13] [INFO] Loading configuration file /opt/influxdb/shared/config.toml
[10/16/14 07:35:13] [INFO] Redirectoring logging to stdout
[10/16/14 07:35:13] [INFO] Starting Influx Server 0.8.3 bound to 0.0.0.0...
[10/16/14 07:35:13] [INFO] Opening database at /var/lib/influxdb/db
[10/16/14 07:35:13] [INFO] Opening wal in /var/lib/influxdb/wal
[10/16/14 07:35:13] [INFO] Ssl will be disabled since the ssl port or certificate path weren't set
[10/16/14 07:35:13] [INFO] Initializing Raft HTTP server
[10/16/14 07:35:13] [INFO] Raft Server Listening at 0.0.0.0:8090
[10/16/14 07:35:13] [INFO] Initializing Raft Server: http://influx1e:8090
[10/16/14 07:35:13] [INFO] (raft:67e282ae6e3c28d1) Attempting to join leader: influx1b:8090
@jvshahid
jvshahid / terminate.cs
Last active February 18, 2024 02:23
C# terminating a child process (as opposed to killing, i.e. sigkill vs. sigint on linux)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace TestCtrlEvent
@jvshahid
jvshahid / deploy_errors
Created November 1, 2016 18:23
bosh deploy error
± |master {9} S:2 U:4 ✗| → bosh -d deployments/influxdb.yml deploy --no-redact
RSA 1024 bit CA certificates are loaded due to old openssl compatibility
Acting as user 'admin' on deployment 'influxdb' on 'micro-google'
Getting deployment properties from director...
Detecting deployment changes
----------------------------
resource_pools:
- name: grafana_z1
stemcell:
{"timestamp":"1495156965.358874321","source":"guardian","message":"guardian.create.volume-creator.image-plugin-create.image-plugin-result","log_level":2,"data":{"action":"create","error":"exit status 1","handle":"vizzini-3-91df9fcb","session":"36615.2.1","spec":{"RootFS":{"Scheme":"docker","Opaque":"","User":null,"Host":"","Path":"/cloudfoundry/busybox-alice","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Username":"","Password":"","Namespaced":true,"QuotaSize":134217728,"QuotaScope":0},"stdout":"pulling the image: creating volume for layer `sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4`: creating volume symlink: symlink /var/vcap/data/grootfs/store/unprivileged/volumes/5f6dd32651343d19f608964426d5fd655818ac2deb74dbc6486a15489b15d755-incomplete-1495156965354797608-4509262706469024597 /var/vcap/data/grootfs/store/unprivileged/l/SCUMRlrMM: file exists\n"}}
SIGABRT: abort
PC=0x466fa1 m=0
goroutine 0 [idle]:
runtime.futex(0x1813910, 0x0, 0x0, 0x0, 0x0, 0x7f5d34000048, 0x7f5d34000070, 0x0, 0x0, 0x7ffd92fe12a0, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:387 +0x21
runtime.futexsleep(0x1813910, 0x0, 0xffffffffffffffff)
/usr/local/go/src/runtime/os_linux.go:45 +0x62
runtime.notesleep(0x1813910)
/usr/local/go/src/runtime/lock_futex.go:145 +0x9e
@jvshahid
jvshahid / t9904-diff-branch-submodule-push.sh
Created May 27, 2017 13:17
test case for push with submodules
#!/bin/sh
test_description='diff-branch-submodule-push'
. ./test-lib.sh
test_expect_success setup '
mkdir pub.git &&
mkdir sub.git &&
GIT_DIR=pub.git git init --bare &&