Skip to content

Instantly share code, notes, and snippets.

View cedricvidal's full-sized avatar

Cedric Vidal cedricvidal

View GitHub Profile
@cedricvidal
cedricvidal / README.md
Created October 29, 2016 14:03
Netflix Eureka curl registration

Registration

curl -v -X POST -H "Accept: application/xml" -H "Content-type: application/xml" --data @reg.xml http://localhost:8761/eureka/apps/test

Listing

curl -X GET -H "Accept: application/json" http://localhost:8761/eureka/apps

Keybase proof

I hereby claim:

  • I am cedricvidal on github.
  • I am cedricvidal (https://keybase.io/cedricvidal) on keybase.
  • I have a public key ASBfThWeQLMxGzhpoYGGVpSO1hx6Z2-j0opEXgXLbdXJJgo

To claim this, I am signing this object:

class Hello extends React.Component {
render() {
return (
<div>
<h1>Hello {this.props.name}</h1>
<p>What would you like to do today ?</p>
</div>
);
}
}
@cedricvidal
cedricvidal / preseed.cfg
Created June 23, 2016 23:52
Ubuntu 14.04 preseed - Full Disk Encryption
choose-mirror-bin mirror/http/proxy string
d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc boolean true
d-i clock-setup/utc-auto boolean true
d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select custom-lvm
d-i partman-auto/method string lvm
@cedricvidal
cedricvidal / streamed-copy.sh
Last active June 22, 2016 10:09
Streamed file copy from one (remote) source to another (remote) target
#!/bin/bash
IN="./in" # input directory
IN_LS="ls $IN" # input directory ls command
OUT="./out" # output directory
IP="../idempotent.py progress.db" # [optional] idempotent filter
#IN_RSH=ssh user@source_server
#OUT_RSH=ssh user@target_server
@cedricvidal
cedricvidal / idempotent.py
Last active April 29, 2016 07:47
Command line idempotent python script which uses a Sqlite LSM key value store as idempotent store
#!/usr/bin/env python
from lsm import LSM
import argparse
import time
import sys
parser = argparse.ArgumentParser(description='Idempotent')
parser.add_argument('store', type=str,
help='path of the LSM database to use as idempotent store')
parser.add_argument('--save', type=bool, default=False,
@cedricvidal
cedricvidal / TamperedTimestampLoggingEvent.java
Last active March 31, 2016 07:37
Logback timestamp tampering example
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.LoggingEvent;
/**
* @author <a href="mailto:[email protected]">Cedric Vidal, Quicksign</a>
*/
public class TamperedTimestampLoggingEvent extends LoggingEvent {
private final long tamperedTimestamp;
#!/bin/sh
V=0.2.1;JGFSVD=~/.jgitflow-semver/$V;JGFSV=$JGFSVD/jgitflow-semver-$V.sh; ([ ! -f $JGFSV ] && mkdir -p $JGFSVD && \
wget -q -O $JGFSV http://dl.bintray.com/cedric-vidal/jgitflow-semver/com/quicksign/jgitflow-semver/jgitflow-semver/$V/jgitflow-semver-$V-script.sh && \
chmod a+x $JGFSV || exit 0) && [ `md5 -q $JGFSV` == "90e7e6a8be2c198824e4d443f6f6f68e" ]
$JGFSV $*
@cedricvidal
cedricvidal / remote-docker-ssh-shellinit.sh
Last active August 31, 2015 09:20
Configure remote docker over SSH
HOST=user@host
# Make sure socat is installed on remote before starting tunnel
ssh $HOST socat -V | grep "socat version" | cat 1>&2
# Start tunnel
echo "starting tunnel" 1>&2
(socat "UNIX-LISTEN:/tmp/$HOST-docker.sock,reuseaddr,fork" "EXEC:'ssh -kTax $HOST socat STDIO UNIX-CONNECT\:/var/run/docker.sock'" 2>&1 | >&2 xargs echo) &
# Tell docker
@cedricvidal
cedricvidal / ObservablesCartesianProduct.java
Last active September 5, 2016 14:51
RxJava Observables Cartesian Product
import rx.Observable;
import rx.functions.Func1;
import rx.functions.Func2;
import static java.util.Arrays.asList;
import static java.util.Collections.singleton;
/**
* Computes the cartesian product of Observables.
*