Skip to content

Instantly share code, notes, and snippets.

View lucianmachado's full-sized avatar
:octocat:

Lucian lucianmachado

:octocat:
  • 07:35 (UTC -03:00)
View GitHub Profile
# Install these packages (use your favorite AUR tool here)
yay -S minikube-bin kubectl-bin docker-machine-driver-kvm2 libvirt qemu-headless docker-machine ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@ivan-marquez
ivan-marquez / polling.js
Last active February 3, 2024 00:13
Long polling implementation in Js
const axios = require('axios').default;
function getAPIClient() {
const axiosConfig = {
baseURL: 'https://csrng.net/csrng/csrng.php',
timeout: 5000,
};
return axios.create(axiosConfig);
}
@hanserya
hanserya / ConfigServerApplication.java
Last active March 2, 2022 15:23
Use Mounted Volume for SSH Key-Based Authentication in Dockerized Spring Cloud Config Server
@EnableConfigServer
@SpringBootApplication
@Import(SshLocationOverrideConfiguration.class)
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServiceApplication.class, args)
.start(); //<-- THIS IS IMPORTANT!
}
}
@CMCDragonkai
CMCDragonkai / nix_ca_certificate_handling.md
Created October 16, 2018 07:02
Nix CA Certificate Handling #nix

Nix CA Certificate Handling

Some applications requires contacting HTTPS endpoints. In those cases you need to supply the CA certificates.

Most Nix applications won't package in the CA certificates, this is because they can make use of the OS provided CA certificate store.

The NixOS location for this is at: /etc/ssl/certs.

The OpenSSL library in Nixpkgs is compiled to use that path if there is no environment variables such as SSL_CERT_FILE.

@Henningstone
Henningstone / webtail.py
Created August 14, 2017 04:04 — forked from scoffey/webtail.py
HTTP server that provides a web interface to run "tail" on a file, like the Unix command
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HTTP server that provides a web interface to run "tail" on a file,
like the Unix command.
This is a standalone script. No external dependencies required.
How to invoke:
@lummie
lummie / enum.go
Last active September 16, 2024 18:03
Golang Enum pattern that can be serialized to json
package enum_example
import (
"bytes"
"encoding/json"
)
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred
type TaskState int

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@vkroz
vkroz / Kafka commands.md
Last active January 21, 2024 12:12
Kafka frequent commands

Kafka frequent commands

Assuming that the following environment variables are set:

  • KAFKA_HOME where Kafka is installed on local machine (e.g. /opt/kafka)
  • ZK_HOSTS identifies running zookeeper ensemble, e.g. ZK_HOSTS=192.168.0.99:2181
  • KAFKA_BROKERS identifies running Kafka brokers, e.g. KAFKA_BROKERS=192.168.0.99:9092

Server

Start Zookepper and Kafka servers

@mowings
mowings / readme.md
Last active April 9, 2024 20:51
ffmpeg stream and save video from Dahua 4300s IP Camera

Use ffmpeg to stream video from a dahua 4300s to a file or files

You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good alternative to pricey dvrs which likely cannot record at full resolution, may not work with the camera, or are prohibitevly expensive

Simple Stream to file

Simple stream to file. Full resolution

ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \

-c copy -map 0 foo.mp4

@sebastianwebber
sebastianwebber / wildfly-toolbelt.md
Last active May 11, 2016 04:46
Wildfly administration tips

#Wildfly Toolbelt

Deploy Related

Find domain deployments in filesystem

Basically, you need to open domain.xml under WILDFLY_HOME/domain/configuration and find the <deployments> session. In that session, each deployment contain a <content> tag. The attribute sha1 contains details where the file is storaged on the filesystem. EG:

<deployments>