Skip to content

Instantly share code, notes, and snippets.

View brccabral's full-sized avatar
🐔
Vamos, Galo! Ganhar o Brasileiro!

Bruno Cabral brccabral

🐔
Vamos, Galo! Ganhar o Brasileiro!
View GitHub Profile
@brccabral
brccabral / 01_README.md
Created April 11, 2024 00:28
Firefly III
@brccabral
brccabral / 01_README.md
Last active March 26, 2024 02:50
VNC server on Ubuntu Desktop

VNC server on Ubuntu Desktop

Followed these initial instructions
https://www.youtube.com/watch?v=3K1hUwxxYek

The video asks to install lightdm, but there is no need, we can use gdm3.
Install x11vnc.

sudo apt update
@brccabral
brccabral / xgrabkey.c
Created March 20, 2024 23:40
XGrabKey
// Original from https://gist.github.com/jouyouyun/669726de58df8d333666
// Compile: gcc xgrabkey.c `pkg-config --cflags --libs x11` -o xgrabkey
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
int main()
{
@brccabral
brccabral / 01_README.md
Last active April 7, 2024 18:24
Pihole
@brccabral
brccabral / 01_README.md
Last active October 21, 2023 02:33
Screen Capture

Screen Capture

C++

Linux

Get the pixels from X11 display and open the image in OpenCV window. Wayland yet to find out.

apt install libopencv-dev
@brccabral
brccabral / 01_README.md
Last active October 17, 2023 17:18
Keystroke

Keystroke

C++

Linux

Send a keystroke to focused window.
Compile with -lX11 -lXtst

Python

@brccabral
brccabral / webcam_capture.cpp
Last active May 12, 2023 22:24 — forked from mik30s/webcam_capture.cpp
Simple C++ program to capture a webcam frame in Linux
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <unistd.h>
@brccabral
brccabral / 01_README.md
Last active September 27, 2023 18:10
Yaru theme

Yaru theme

Build from source

sudo apt install meson sassc pkg-config libglib2.0-dev
cd $HOME
@brccabral
brccabral / 01_README.md
Last active October 27, 2023 04:14
Boot Windows from Linux using QEMU

Boot Windows from Linux using QEMU

Option 1: install from package repository

Installing virt-manager will install qemu as dependency.

sudo apt install virt-manager

I had to restart Ubuntu to get virtd privilegies.

Option 2: Compile QEMU