Skip to content

Instantly share code, notes, and snippets.

View xsnpdngv's full-sized avatar

Tamás Dezső xsnpdngv

View GitHub Profile
"set guifont=Monospace
set guifont=Consolas
"colorscheme desert
colorscheme darkblue
set columns=80 "number of columns
set lines=40 "number of lines
winpos 700 150 "window position
"set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
@xsnpdngv
xsnpdngv / .bashrc
Last active February 20, 2017 19:57
# user@host dir [branch] $
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(git_branch)\[\033[00m\] $ "
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
@xsnpdngv
xsnpdngv / Vagrantfile
Last active February 21, 2017 10:26
C development environment
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@xsnpdngv
xsnpdngv / overload.h
Last active February 19, 2017 21:19
C function-like macro overload
/* overload for function-like macros with various number of named arguments */
#define OVERLOAD(Func, .../* Arg1[, Arg2[, Arg3]] */) \
FUNC_SEL(__VA_ARGS__, Func##3, Func##2, Func##1, x)(__VA_ARGS__)
#define FUNC_SEL(Arg1, Arg2, Arg3, Func, ...) Func
#define FUNC(/* arg1[, arg2[, arg3]] */ ...) OVERLOAD(FUNC, __VA_ARGS__)
#define FUNC2(arg1, arg2) arg1#arg2 /* whatever to do with 2 args */
#define FUNC3(arg1, arg2, arg3) arg1#arg2#arg3 /* whatever to do with 3 args */
@xsnpdngv
xsnpdngv / passwordless_login.md
Last active February 17, 2017 12:37
ssh key generation and placement for passwordless login

Generate identity locally

cd $HOME/.ssh
ssh-keygen -f id_rsa -t rsa

This will result: id_rsa, id_rsa.pub.

@xsnpdngv
xsnpdngv / exportEachPageToSvg.vba
Created February 17, 2017 09:43
Visio macro to export each page to svg
Sub exportSvg()
Dim formatExtension As String
formatExtension = ".svg"
' initializations
folder = ThisDocument.Path
Set doc = Visio.ActiveDocument
folder = doc.Path
@xsnpdngv
xsnpdngv / batteryFullNotif.vbs
Last active October 28, 2021 03:18
battery full notification VB script
' Battery Full Notification VBS - checking in each 5 min
' To start automatically on logon, put into the directory that opens on:
' Win+R: Open: [shell:startup] -> [OK]
' (C:\Users\YOU\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)
set oLocator = CreateObject("WbemScripting.SWbemLocator")
set oServices = oLocator.ConnectServer(".","root\wmi")
set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
for each oResult in oResults
iFull = oResult.FullChargedCapacity
@xsnpdngv
xsnpdngv / profiling.md
Created February 17, 2017 12:42
Profiling HowTo

Profiling with Callgrind

Callgrind is a profiling tool that can be used via the Valgrind framework and its report can be displayed/inspected with the KCachegrind profile data visualization tool.

Install

@xsnpdngv
xsnpdngv / sources.list
Created April 8, 2017 19:35
apt sources
# deb cdrom:[Ubuntu 17.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://hu.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://hu.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://hu.archive.ubuntu.com/ubuntu/ xenial-updates main restricted