Skip to content

Instantly share code, notes, and snippets.

@gmacario
gmacario / Dockerfile
Last active November 23, 2021 02:40
Can you run GUI apps in Docker?
# From http://stackoverflow.com/questions/16296753/can-you-run-gui-apps-in-a-docker
#
# Firefox over VNC
#
# VERSION 0.1
# DOCKER-VERSION 0.2
from ubuntu:12.04
# make sure the package repository is up to date
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
@tyrells
tyrells / disable-service.yml
Last active October 19, 2023 20:53
Ansible task to stop service even if it doesn't exist
# This task will stop and disable a service without failing if the service does not exist.
# Requires Ansible 1.4 or newer.
# Update Dec 2016: Have rewritten this for the latest version of ansible and put conditions for both Ubuntu and CentOS
- name: "disable unused services"
service: name={{item}} state=stopped enabled=no
register: command_result
failed_when: "unused_disable|failed and ('find' not in unused_disable.msg and 'found' not in unused_disable.msg)"
with_items:
@spuder
spuder / ssh.md
Last active August 13, 2017 02:39
logstash-grok-ssh ignore root user

I have ssh connections from multiple users. I want to log all connectsion except those from the user 'git'. How dow you create an exception to a filter ?

input {

  file {
     path => "/var/log/auth.log"
     type => "syslog"
  }
}
@ursuad
ursuad / kafka-cheat-sheet.md
Last active July 24, 2024 09:43
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@mehmetboraezer
mehmetboraezer / generator.md
Last active November 15, 2020 17:26
google authenticator alternative for cli

This flow is used to generate passcode on command-line in two-step verification.

OSX

  • Install brew

  • Install oath

brew install oath-toolkit

@mxschmitt
mxschmitt / cmd.bat
Last active April 18, 2024 21:48
Golang example of cmd stderr / stdout merge to a single channel
@echo off
echo Stdout
echo Stderr 1>&2
@bnekolny
bnekolny / migtrate_data.py
Last active December 15, 2021 14:46
MLFlow migration script from filesystem to database tracking data
import os
import yaml
## Execution for me was:
## `python migrate_data.py > ./migration_inserts.sql`
## `sed -i '' 's/None/NULL/' ./migration_inserts.sql`
## `psql -f ./migration_inserts.sql`
## NOTE: A few things to know about the script here:
## - Artifacts were stored remotely, so no artifact migration