Skip to content

Instantly share code, notes, and snippets.

View anthonydahanne's full-sized avatar

Anthony Dahanne anthonydahanne

View GitHub Profile
@anthonydahanne
anthonydahanne / PhotoStation_remote_api.md
Last active July 20, 2019 02:21
*unofficial* Documentation of the Synology PhotoStation remote api

Logging in :

POST /photo/mApp/ajax/login.php HTTP/1.1
Content-Length: 113
Content-Type: application/x-www-form-urlencoded
Host: 192.168.1.2:80
Connection: Keep-Alive

action=login&username=user&passwd=password&video_formats=%5B%5B%22*%22%2C0%2C0%2C1280%2C720%2C0%2C%5B%5D%5D%5D
@anthonydahanne
anthonydahanne / restassured-issue181
Last active December 28, 2015 16:49
RestAssured Issue #181, using 1.8.2-SNAPSHOT
given()
.log().all()
.contentType(ContentType.JSON)
.expect()
.log().all()
.statusCode(200)
.when()
.get("/agents/probeUrl/" + agentUrl);
$ gradle --version
------------------------------------------------------------
Gradle 1.7
------------------------------------------------------------
Build time: 2013-08-06 11:19:56 UTC
Build number: none
Revision: 9a7199efaf72c620b33f9767874f0ebced135d83
package net.dahanne.eclipse.m2e.localizer;
import java.io.File;
import java.util.Set;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.m2e.core.MavenPlugin;
@anthonydahanne
anthonydahanne / WebMvcConfiguration.java
Created June 1, 2015 16:51
Supporting matrix variable in Spring Boot 1.2.3
package org.ehcache.agent;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
/**
* Created by Anthony Dahanne on 2015-06-01.
*/
@Configuration

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@anthonydahanne
anthonydahanne / README.md
Created May 26, 2020 22:02
Configure Prometheus for AWS EC2 discovery

I had trouble figuring out how to configure Prometheus EC2 instances discovery once, so I'm sharing this gist that includes some sample config that worked fine for me with Prometheus v2.17.2!

Good luck!

@anthonydahanne
anthonydahanne / jenkins-jobs.main.kts
Created November 12, 2021 18:52
Find all Jenkins Jobs Git origin urls
#!/usr/bin/env kotlin
@file:DependsOn("com.github.kittinunf.fuel:fuel:2.3.1")
@file:DependsOn("com.google.code.gson:gson:2.8.6")
@file:DependsOn("com.beust:klaxon:5.5")
import com.beust.klaxon.JsonObject
import com.beust.klaxon.Klaxon
import com.beust.klaxon.Parser
import com.beust.klaxon.PathMatcher
import com.github.kittinunf.fuel.core.extensions.authentication
@anthonydahanne
anthonydahanne / aws-last-services-used.sh
Created March 23, 2022 13:42
Retrieve last accessed services in AWS
#!/usr/bin/env bash
ARN=arn:aws:iam::xxx:user/xxx
JOB_ID=$(aws iam generate-service-last-accessed-details --arn $ARN --output=json | jq -r .JobId)
aws iam get-service-last-accessed-details --job-id $JOB_ID --output=json | jq '[.ServicesLastAccessed[] | select (.TotalAuthenticatedEntities | contains(1))] | sort_by(.LastAuthenticated)'
@anthonydahanne
anthonydahanne / extract-all-links.js
Last active August 26, 2022 02:47
Extract all links (with a non empry rel attribute) from a webpage - to run from firefox or chrome, convenient for hackernews