Skip to content

Instantly share code, notes, and snippets.

@cyberang3l
cyberang3l / .gitconfig
Last active April 6, 2018 11:28
My .gitconfig
[user]
name = Vangelis Tasoulas
email = vangelis@tasoulas.net
signingkey = A998DA61
[alias]
undo-commit = reset --soft HEAD^
logp = log --patch --graph --word-diff
logs = log --decorate=short --graph --pretty=oneline --abbrev-commit --stat
wdiff = diff --word-diff
signed-commit = commit --signoff --gpg-sign
@cyberang3l
cyberang3l / .vimrc
Last active March 6, 2023 19:15
My .vimrc file
" Install vim-plug if we don't already have it and try to install all the
" plugins
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
function! BuildYCM(info)
" info is a dictionary with 3 fields
@cyberang3l
cyberang3l / How to setup VirtualGL and TurboVNC on Ubuntu.md
Last active March 23, 2024 05:52
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding
@cyberang3l
cyberang3l / Finding the UDI of a device.md
Last active January 23, 2021 20:44
udevadm device info and DBus UDI of devices

The get the freedesktop UDI (Unique Device Identifier) of a device, forget about hal, lshal, hal-find-by-property etc, as HAL is long deprecated!

Use the DBus instead. The easiest way to use DBus without having to type a gazillion of commands is to use the qdbus command (or qdbusviewer for a GUI, but a gui won't make things any easier unless you want to navigate through different options):

To get a list of the available freedesktop (because we grep for it) system services (i.e. services provided by the operating system and also by any system daemons):

$ qdbus --system | grep freedesktop
 org.freedesktop.systemd1
 org.freedesktop.Avahi

org.freedesktop.NetworkManager

@cyberang3l
cyberang3l / How-To-Install-PXE-Server-On-Tomato.md
Last active May 6, 2018 19:10
A short step-by-step tutorial/howto to remind me how to install a PXE server on TomatoUSB (Shibby)
@cyberang3l
cyberang3l / Libvirt-Start-VMs-In-Order-Instructions.md
Last active February 23, 2024 13:41
Necessary scripts and procedure to start libvirt VMs in a provided order, with an given delay before starting each subsequent VM.
  1. Ensure that your VMs can shutdown gracefully when the power-button is pressed.

  2. Place the file vm-boot-order.py in /opt directory

  3. Make it executable: chmod +x /opt/vm-boot-order.py

  4. Check that the script starts and shuts down your VMs as expected. The script can be executed as follows:

     /opt/vm-boot-order.py start
     /opt/vm-boot-order.py stop
     /opt/vm-boot-order.py status
    
  5. Make a systemd service to execute the script when booting or shutting down the hypervisor:

@cyberang3l
cyberang3l / extract-git-folder-with-history.md
Created April 12, 2016 14:55
GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

NOTE: If you want to keep the history for a specific folder in the master branch, just skip steps in lines 3,4,5,6,7

git clone <git-repository-url>
cd <git-repository-dir>

git checkout <branch-name>              # line 3; Checkout the branch of interest
git merge --strategy=ours master        # line 4; keep the content of this branch only and record a merge
git checkout master                     # line 5; Go back to the master branch