Skip to content

Instantly share code, notes, and snippets.

@brcha
brcha / vcvars.ps1
Created May 22, 2024 01:51
vcvars.ps1
# Allow executing CMD scripts
function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
select-string '^([^=]*)=(.*)$' | foreach-object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
# Scid options file
# Version: 4.3
# This file contains commands in the Tcl language format.
# If you edit this file, you must preserve valid its Tcl
# format or it will not set your Scid options properly.
set boardSize 25
set boardStyle Alpha
set language E
set ::pgn::showColor 1
@brcha
brcha / openpgp.txt
Created June 17, 2019 18:41
Повезани идентитет Отвореног кључарника
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:9afc0a4bd2cef3d22cf6108196577bd3c105eda4]
/*
####################### dirtyc0w.c #######################
$ sudo -s
# echo this is not a test > foo
# chmod 0404 foo
$ ls -lah foo
-r-----r-- 1 root root 19 Oct 20 15:23 foo
$ cat foo
this is not a test
$ gcc -pthread dirtyc0w.c -o dirtyc0w
@brcha
brcha / keybase.md
Created March 23, 2017 17:31
Keybase verification

Keybase proof

I hereby claim:

  • I am brcha on github.
  • I am brcha (https://keybase.io/brcha) on keybase.
  • I have a public key ASD687gDKbqWCbv-MToQaPpxHbbCztoKOmK9G52I-7FZeAo

To claim this, I am signing this object:

@brcha
brcha / snapshotAndBackup.sh
Created February 5, 2015 20:15
Snapshot btrfs and backup using zbackup
#! /bin/sh
# Generate timestamp
TIMESTAMP=$(date +'%Y.%m.%d')
BACKUP_ROOT=/run/media/brcha/External/backup/perun--home.brcha
# Make snapshot
pushd /home &> /dev/null
sudo btrfs subvolume snapshot -r brcha @snapshot_brcha_${TIMESTAMP}
popd &> /dev/null
@brcha
brcha / qtyaml.h
Created September 30, 2014 13:09
Qt Yaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*