Skip to content

Instantly share code, notes, and snippets.

@vheon
vheon / README.md
Created March 30, 2022 12:07 — forked from gbraad/README.md
Git post-update hook

Git post-update hook

Checkout working copy and publish it. Put into .git/hooks and chmod +x post-update

For use with bare and non-bare repositories.

2020/07/15 17:28:58 [INFO] Packer version: 1.6.1-dev [go1.14.4 darwin amd64]
2020/07/15 17:28:58 Checking 'PACKER_CONFIG' for a config file path
2020/07/15 17:28:58 'PACKER_CONFIG' not set; checking the default config file path
2020/07/15 17:28:58 Attempting to open config file: /Users/andrea.cedraro/.packerconfig
2020/07/15 17:28:58 [WARN] Config file doesn't exist: /Users/andrea.cedraro/.packerconfig
2020/07/15 17:28:58 Setting cache directory: /Users/andrea.cedraro/code/mold/centos/packer_cache
2020/07/15 17:28:58 Creating plugin client for path: /usr/local/bin/packer
2020/07/15 17:28:58 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-virtualbox-iso"}
2020/07/15 17:28:58 Waiting for RPC address for: /usr/local/bin/packer
2020/07/15 17:28:58 packer-builder-virtualbox-iso plugin: [INFO] Packer version: 1.6.1-dev [go1.14.4 darwin amd64]
@vheon
vheon / ffs.c
Created November 20, 2017 14:00 — forked from jnthn/ffs.c
cross-platform first set bit
#include <stdio.h>
#include <stdlib.h>
#define MVMint32 int
#ifdef __GNUC__
#define FFS(x) __builtin_ffs(x)
#elif defined(_MSC_VER)
static __inline MVMint32 FFS(MVMint32 x) {
MVMint32 i = 0;
@vheon
vheon / asio_sendfile.cpp
Created September 13, 2017 13:24 — forked from mpapierski/asio_sendfile.cpp
boost.asio + sendfile(2)
// how to use boost.asio + sendfile(2)
// Michał Papierski <michal@papierski.net>
#include <iostream>
#include <string>
#include <boost/asio.hpp>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/ref.hpp>
#include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp>

Keybase proof

I hereby claim:

  • I am vheon on github.
  • I am vheon (https://keybase.io/vheon) on keybase.
  • I have a public key ASAI_hbGOrpvr_5GuSM8v7oJiP5jOpKnd-67d2-2NDuK5Qo

To claim this, I am signing this object:

@vheon
vheon / Vagrantfile
Created January 24, 2016 18:00
Vagrant file for ycmd dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure( VAGRANTFILE_API_VERSION ) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.synced_folder ".", "/home/vagrant/ycmd", type: "rsync",
@vheon
vheon / dummysign.vim
Created December 9, 2015 01:07
Simple function for always display sign column in vim
sign define DummySign
function! s:place_dummy_sign(bufid)
if !getbufvar( a:bufid, 'dummy_sign' )
execute "sign place 1234 line=1 name=DummySign buffer=".a:bufid
call setbufvar( a:bufid, 'dummy_sign', 1 )
endif
endfunction
Autocmd BufEnter * call s:place_dummy_sign( bufnr( '%' ) )
@vheon
vheon / build-tmux.sh
Created November 24, 2015 09:47
build-tmux.sh
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# Credit to the dude who created the initial version that I tweaked long ago
# exit on error
set -e
@vheon
vheon / build-arm-none-eabi-gdb.sh
Created November 3, 2015 22:18 — forked from ilg-ul/build-arm-none-eabi-gdb.sh
Build the ARM version of GDB on OS X.
#! /bin/bash
set -euo pipefail
IFS=$'\n\t'
GDB_VERSION="7.10"
GDB_BUILD_FOLDER="~/Work/gdb"
mkdir -p "${GDB_BUILD_FOLDER}"
cd "${GDB_BUILD_FOLDER}"
@vheon
vheon / simplebox
Created June 9, 2015 12:33
Test case for `tmux list-sessions | ./simplebox`
package main
import (
"bufio"
"io"
"log"
"os"
"github.com/nsf/termbox-go"
)