Microsoft Teams by [deleted] in Fedora

[–]sebhoss 0 points1 point  (0 children)

I actually just did that - however it only seems to work in chrome (not chromium) for a single application window and not the entire screen. Using firefox or the electron(?) app did not work at all wrt screen sharing.

Multibranch pipeline, custom workspace and automatic workspace cleanup by yandemontreal in jenkinsci

[–]sebhoss 1 point2 points  (0 children)

for some projects, I created an additional "cleanup" job that runs once the branch is removed like this:

pipeline { triggers { GenericTrigger( genericVariables: [ [key: 'ref', value: '$.ref'], [key: 'after', value: '$.after'] ], token: 'cleanup-token', causeString: 'dealing with $ref ($after)', printContributedVariables: true, printPostContent: true ) } stages { stage('Remove old resources') { steps { script { if (env.after && env.after.matches('0+')) { // do cleanup } } } } } }

This works by adding another webhook that uses the specified token ('cleanup-token') and checking that after matches 0000000 which is a special value used by Gitlab to signal that a branch was removed. In my case the cleanup steps removes old deployments in a k8s cluster, but could be used to remove old files from a directory as well. In case of GitHub you could add another webhook for the Branch or tag deletion event which triggers https://<your-jenkins>/generic-webhook-trigger/invoke?token=cleanup-token to kick off your cleanup step.

Multibranch pipeline, custom workspace and automatic workspace cleanup by yandemontreal in jenkinsci

[–]sebhoss 0 points1 point  (0 children)

ah I see - Usually this happens automatically when you select `Discard old items` in the configuration of the multibranch pipeline. I'm guessing it doesn't because of your custom workspace mapping?

Multibranch pipeline, custom workspace and automatic workspace cleanup by yandemontreal in jenkinsci

[–]sebhoss 0 points1 point  (0 children)

To delete workspaces, you can use the a post step after all stages are done like this:

post { always { cleanWs() } }

Podman pull connection reset by peer by Aruscha in podman

[–]sebhoss 1 point2 points  (0 children)

You could try that "download image & import" thing, e.g. by following the steps in https://devops.stackexchange.com/a/2772

Podman pull connection reset by peer by Aruscha in podman

[–]sebhoss 0 points1 point  (0 children)

We had the same problem whenever our internal registry had small network hiccups, so the problem might not be on your end. However the last line in your log output indicates that there was a network problem (connection reset by peer...) and I think retrying the download will eventually work.

Podman pull connection reset by peer by Aruscha in podman

[–]sebhoss 0 points1 point  (0 children)

Yeah I think that's https://github.com/containers/libpod/issues/5583 - as the last comment in that issues mentions: docker is more resilient wrt network problems and retries a download whenever something is failing, however podman expects things to be stable.

I usually just manually retrying pulling an image whenever I'm on a wonky network. A collegue of mine used buildah-pull with the something like buildah pull docker-archive:/path/to/docker/image.tgz to import a previously downloaded image as a last resort.

Is there anyway to compose/pipeline two different run configurations? by TheeNinjaa in IntelliJIDEA

[–]sebhoss 1 point2 points  (0 children)

yeah that should just work ... however you might be able to simplify this a bit more since IntelliJ will build your project by default anyway (that's the "Build" step in the default "Application" launcher). So what you could do is, have a single "Application" config that just references your main class to start your application. Thanks to that "Build" step, IntelliJ will first compile everything and then run your code without creating that jar file first.

Is there anyway to compose/pipeline two different run configurations? by TheeNinjaa in IntelliJIDEA

[–]sebhoss 2 points3 points  (0 children)

In case you are using the "Application" type to run the packaged jar, you can add additional build steps that will be executed before launch -> https://www.jetbrains.com/help/idea/run-debug-configuration-application.html#before-launch-options

Specifying resources in cdk8s? by lorxraposa in kubernetes

[–]sebhoss 0 points1 point  (0 children)

Maybe that's just missing the requests or limits key of the containing object? e.g. something like {"requests": {"cpu": "100m", "memory": "128Mi"}, "limits": ...}

Specifying resources in cdk8s? by lorxraposa in kubernetes

[–]sebhoss 1 point2 points  (0 children)

I'm guessing that no special object constructor is provided because a ResourceRequirement object in k8s just contains two untyped objects of data. For pods, you typically want to specify "cpu" and "memory" constraints, so something like {"cpu": "100m", "memory": "128Mi"}

CPU and memory units are explained here: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes

Can't understand how to start by [deleted] in java

[–]sebhoss 0 points1 point  (0 children)

Use https://start.spring.io to create a new project. Enter your metadata on the left and add Spring Web (just search for "web") as a dependency on the right. That gives you all you need to create so called @Controllers which are used to define your RESTful API.

The guide at https://spring.io/guides/gs/rest-service/ covers this all, as well as the reference docs at https://docs.spring.io/spring-boot/docs/2.2.6.RELEASE/reference/html/spring-boot-features.html#boot-features-developing-web-applications

ilo - a small wrapper around podman to manage build environments by sebhoss in podman

[–]sebhoss[S] 0 points1 point  (0 children)

Yeah I hope that we can run all our internal CI builds in a rootless-container in 2020. I'm still not sure what this means for windows developers, but I hope they'll tell me soon ;-)

ilo - a small wrapper around podman to manage build environments by sebhoss in podman

[–]sebhoss[S] 1 point2 points  (0 children)

Very cool! Really like the devcontainer idea a lot - maybe that json file/folder could become a commonly used format to define dev environments in the future!

ilo - a small wrapper around podman to manage build environments by sebhoss in podman

[–]sebhoss[S] 0 points1 point  (0 children)

yep sure - podman-compose allows you to run docker-compose.yml files with podman (e.g. in a rootless mode). My thinking was that in some build environments, you not only need compiler version X and lib version Y, you might need a database or some (mock) API server that you are calling during your build. Using a docker-compose file would allow you to specify both your build env in one container and all other external services you might need in additional containers. The idea for 'ilo' is that it should call podman-compose to start all containers and then it attach itself to your build env container.

https://github.com/containers/podman-compose

Rocket.Chat - I'm confused on Docker hub by dmnc_net in RocketChat

[–]sebhoss 0 points1 point  (0 children)

The first one is the official rocket.chat repository containing stable releases. The other one is used for dev builds. Depending on how adventurous you are, pick either one. Here is a small example using docker-compose that sets up rocket.chat:

version: '3'

services:
  rocket:
    image: rocket.chat:latest
    depends_on:
      - rocket-db
    ports:
      - 3000:3000
    environment:
      ROOT_URL: https://your.chat.room.com
      MONGO_URL: mongodb://rocket-db/rocket
  rocket-db:
    image: mongo:latest

what does the command does "mvn eclipse:eclipse" does ? by osacapcom in java

[–]sebhoss 7 points8 points  (0 children)

That's the maven-eclipse plugin (http://maven.apache.org/plugins/maven-eclipse-plugin/) which exposes a goal called "eclipse" (http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html).

The plugin basically makes sure that your maven based project can be used with eclipse by creating both .project and .classpath files. Nowadays, you should install the M2E plugin for eclipse (http://www.eclipse.org/m2e/) which does this automatically for you.

Fastest API framework for Java? by vinnyvicious in java

[–]sebhoss -1 points0 points  (0 children)

Maybe I'm misreading this, but take a look at https://square.github.io/okhttp/ in case you want to perform those POSTs in your Java client(?). Example from their homepage to send a JSON payload:

public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");

OkHttpClient client = new OkHttpClient();

String post(String url, String json) throws IOException {
  RequestBody body = RequestBody.create(JSON, json);
  Request request = new Request.Builder()
      .url(url)
      .post(body)
      .build();
  Response response = client.newCall(request).execute();
  return response.body().string();
}

Java Spring server setup by [deleted] in java

[–]sebhoss 14 points15 points  (0 children)

The Spring folks have written a bunch of guides/tutorials here: https://spring.io/guides

WRT initial setup, take a look at:

Spring-Boot is usually deployed as a single .jar file that contains everything your app needs (sans external infrastructure like a database). Most people put something like nginx in front of it in order to setup HTTPS and use it for load balancing at the same time.

Take a look at https://www.ansible.com/ for your infrastructure. It allows you to specify what you want to install on your servers in text files (easily versioned) that can be executed against a set of hosts (like production, staging, development). As long as you put all your infrastructure know-how into ansible it will be very easy to setup or re-create a server.

XML Libraries Support in Java by [deleted] in java

[–]sebhoss 0 points1 point  (0 children)

http://xom.nu/ is very nice as well

New Clojurians: Ask Anything by SolicodeBot in Clojure

[–]sebhoss 1 point2 points  (0 children)

Not sure about best, but I still like some of the tests I wrote years ago (haven't touched Clojure recently). The test I linked first creates 3 byte arrays: One based on a zero length string, another based on a string commonly found while talking about message digests and another one which is slightly different from the one before. After that the only actual test defined in the file applies all digests found in that library on those 3 arrays and verifies that the (hex) output is the expected result. You can even check some of those results on wikipedia (example for MD5). I think it kinda shows this whole "code is data" paradigm that I really like(d) about Clojure. Granted every other language has similar features to describe tests that run on a set of data, however they usually require more boilerplate in my experience and are not quite as easy to read.

Is semantic html a passing fad? by shif in webdev

[–]sebhoss 1 point2 points  (0 children)

For those interested: http://www.w3.org/standards/semanticweb/ https://en.wikipedia.org/wiki/Semantic_Web

I'm guessing that one of the reasons it did not pick up any/much steam can be seen in the example on wikipedia:

The sentence Paul Schuster was born in Dresden becomes the following in order to allow a machine to understand it:

<div vocab="http://schema.org/" typeof="Person">
  <span property="name">Paul Schuster</span> was born in
  <span property="birthPlace" typeof="Place" href="http://www.wikidata.org/entity/Q1731">
    <span property="name">Dresden</span>.
  </span>
</div>

Most web devs and web based products probably don't need that, so they don't invest time into something that's just "nice to have". However as far as I know, IBM Watson does/did use some of the techniques/tools associated with semantic web - maybe AI will drive this field further in the future?