Skip to content

Instantly share code, notes, and snippets.

View ObiWahn's full-sized avatar
:octocat:

Jan Christoph Uhde ObiWahn

:octocat:
View GitHub Profile
@ObiWahn
ObiWahn / qt-unix-signals.md
Created April 15, 2022 16:28 — forked from azadkuh/qt-unix-signals.md
Catch Unix signals in Qt applications

Unix signals in Qt applications

It's quite easy to catch unix signals in Qt applications. you may like to ignore or accept them.

#include <QCoreApplication>

#include <initializer_list>
#include <signal.h>
#include <unistd.h>
@ObiWahn
ObiWahn / mysql_query_log.md
Created November 18, 2021 16:03 — forked from joseluisq/mysql_query_log.md
How to enable the MySQL/MariaDB general query logs

How to enable the MySQL/MariaDB general query logs

  1. Enter to MySQL/MariaDB server command-line tool (change root with your username and password):
mysql -u root -proot
  1. Set the general log file path:
SET GLOBAL general_log_file='/var/log/mysql/mycustom.log';
" Configuration file for vim
" vim:expandtab:foldmethod=marker:foldlevel=0:tw=0
" fix ui language
set langmenu=en_US.UTF-8
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
@ObiWahn
ObiWahn / qemu_curses.md
Created July 29, 2017 20:43
qemu curses interface

source

qemu on Debian 9 has some issues showing the curses console when running a Debian 9 guest. To fix this the guest's grub needs to supply some extra parameters to the kernel and disable a module:

  • on the guest system open /etc/default/grub and add console=tty0 console=ttyS0 to GRUB_CMDLINE_LINUX this tells the linux kernel to use tty0 as console
    • note: see info -f grub -n 'Simple configuration' for difference between GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT
  • create (or change the file) /etc/modprobe.d/bochs_drm.conf so that its contents is the following line: install bochs_drm /bin/true
    • note: this configures modorobe to run /bin/true instead of loading bochs_drm, which disables the loading of
  • note: install is a modprobe command (not the shell command!), whereas /bin/true is a shell command.
@ObiWahn
ObiWahn / git_template_hooks.md
Created July 12, 2017 09:34
use git hooks with templates

create and register git template directory

> mkdir -p ~/.git-templates/hooks
> git config --global init.templatedir '~/.git-templates'

add some example pre-push hook

@ObiWahn
ObiWahn / .gitconfig
Created July 6, 2017 08:13
some aliases for your .gitconfig
[alias]
#https://github.com/seveas/git-spindle
##basic
treeall = "log --graph --pretty=oneline --decorate --abbrev-commit --all"
tree = "log --graph --pretty=oneline --decorate --abbrev-commit"
treelong = "log --graph --pretty='%C(yellow)%h %d %Cblue%ad %Cgreen%an %Creset%s ' --date=relative"
logall = "log --all --date-order"
stat = "diff --stat HEAD"
cat = "cat-file -p"