Skip to content

Instantly share code, notes, and snippets.

@wahello
wahello / docker-compose-consul.yml
Created January 14, 2022 03:04 — forked from gnilchee/docker-compose-consul.yml
Stand up a single node consul server and export ui/api over port 80 and consul dns over port 53
version: '2'
services:
consul:
image: consul
volumes:
- ./data/consul:/consul/data
command: /bin/consul agent -server -data-dir="/consul/data" -bootstrap -client="0.0.0.0" -advertise="127.0.0.1" -ui
ports:
- 80:8500 #HTTP API/UI
- 53:8600/udp #DNS
@wahello
wahello / notworking_ssh_term_x11forwarding.go
Created November 4, 2021 02:46 — forked from blacknon/notworking_ssh_term_x11forwarding.go
notworking_ssh_term_x11forwarding.go
package main
import (
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"golang.org/x/crypto/ssh"
@wahello
wahello / intel-nvidia.md
Created November 1, 2021 06:33 — forked from wangruohui/intel-nvidia.md
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@wahello
wahello / README.md
Created September 25, 2021 01:44 — forked from ahmozkya/README.md
Homebrew with DNSMasq + DNSCrypt-proxy (OpenDNS)

Install & Configure

  1. Install DNSMasq
$ brew install dnsmasq
  1. Install DNSCrypt-proxy
$ brew install dnscrypt-proxy
@wahello
wahello / rasterizeDxf.py
Created September 9, 2021 03:02 — forked from msjamali52/rasterizeDxf.py
Python Script to rasterize / convert CAD DXF figures to PNG / JPG
import dxfgrabber
import cv2
import numpy as np
import sys
"""
def absdiff(num1, num2):
if num1 <= num2:
return num2 - num1
else:
@wahello
wahello / generate-gif-from-webm
Created February 22, 2021 07:11 — forked from ryanlerch/generate-gif-from-webm
Generates an Animated GIF from a webm
#!/bin/bash
echo "$1"
mkdir /tmp/"$1"/
gst-launch-1.0 filesrc location="$1" ! decodebin ! videoconvert ! pngenc ! multifilesink location="/tmp/$1/%04d.png"
echo "Trim files manually, and press enter to generate the GIF"
nautilus /tmp/"$1"/ &
read
echo "Generating GIF..."
convert -delay 5 /tmp/"$1"/*.png /tmp/"$1"/animation.gif
@wahello
wahello / swift-disable.yaml
Created February 22, 2021 03:25 — forked from jfrancoa/swift-disable.yaml
Ansible playbook to disable multiple systemd services
---
- hosts: 127.0.0.1
connection: local
gather_facts: no
tasks:
- name: Check if swift-storage services are deployed
command: systemctl is-enabled --quiet "{{ item }}"
register: swift_services_enabled
ignore_errors: true
@wahello
wahello / pushd.py
Created January 26, 2021 02:15 — forked from Tatsh/pushd.py
pushd for Python
from os import chdir, getcwd
from os.path import realpath
class PushdContext:
cwd = None
original_dir = None
def __init__(self, dirname):
self.cwd = realpath(dirname)
@wahello
wahello / PNGWhiteTrim.py
Created December 22, 2020 08:04 — forked from thomastweets/PNGWhiteTrim.py
Python script to trim all png images with white background in a folder
import Image
import sys
import glob
import ImageOps
# Trim all png images with white background in a folder
# Usage "python PNGWhiteTrim.py ../someFolder"
try:
folderName = sys.argv[1]
@wahello
wahello / tftpServer.sh
Created November 20, 2020 11:04 — forked from mertcangokgoz/tftpServer.sh
macOS Sierra and Missing TFTP Server Management Tool
#!/bin/bash
# macOS Sierra TFTP Server Creator
# Author Mertcan GÖKGÖZ - 07.05.2017 15:00 (GMT +3)
#
# Requirements
# - Macos Sierra 10.12.4 and later
# - 'homebrew' package manager
# - brew install dialog
#
# How to use