Skip to content

Instantly share code, notes, and snippets.

View gunchev's full-sized avatar

Doncho N. Gunchev gunchev

View GitHub Profile
@ronald112
ronald112 / CMakeLists.txt
Created September 18, 2020 10:41
CMAKE MACRO and function to include all directories recursively
# MACRO to add all directories in result
MACRO(SUBDIRLIST result firstdir curdir)
file(GLOB ENDF6_SRC_TOP RELATIVE
${curdir} ${curdir}/*)
file(GLOB_RECURSE ENDF6_SRC_NESTED ${curdir}/*)
set(children ${ENDF6_SRC_TOP} ${ENDF6_SRC_NESTED})
SET(dirlist "${firstdir}")
FOREACH(child ${children})
IF(IS_DIRECTORY ${curdir}/${child})
@jart
jart / printimage.c
Last active December 20, 2023 11:13
/*bin/echo ' -*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;coding:utf-8 -*-┤
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
│ To the extent possible under law, Justine Tunney has waived │
│ all copyright and related or neighboring rights to this file, │
│ as it is written in the following disclaimers: │
│ • http://unlicense.org/ │
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
╚────────────────────────────────────────────────────────────────────'>/dev/null
if ! [ "${0%.*}.exe" -nt "$0" ]; then
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active July 24, 2024 09:32
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 23, 2024 00:25
set -e, -u, -o, -x pipefail explanation
@yougg
yougg / proxy.md
Last active July 17, 2024 09:23
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@abcdefg30
abcdefg30 / installation.md
Last active July 18, 2024 12:13
Unofficial, manual content installation for OpenRA

Manual (unrecommended) installation of the required content files for OpenRA

⚠️ This method is not recommended and should only be applied if automatic installation fails. Success of manually installing the files can not be guaranteed. ⚠️

⚠️ The automatic installation may fail for non-english content. OpenRA does not support other languages at the current stage of development and no such content should be installed. ⚠️

⚠️ Manually installing files can corrupt your game and lead to crashes. ⚠️

If you have trouble with automatic installation, please contact the developers (via IRC, our forum, the webpage comments or our issue tracker) before attempting a manual install.

@mbinna
mbinna / effective_modern_cmake.md
Last active July 20, 2024 22:17
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@imayobrown
imayobrown / migrate_jenkins_job.py
Last active January 26, 2023 20:44
Python script to migrate jenkins job from one sever to another via config.xml file
# Script to migrate jenkins job from one server to another via cli
# Make sure python-jenkins is installed in order to use script
import argparse
import jenkins
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('-j', '--job_name', type=str, required=True, help='Name of job that is to be migrated')
parser.add_argument('-o', '--original_server', type=str, required=True, help='Server to migrate from')
@weigon
weigon / lz4.py
Last active June 21, 2023 19:03
LZ4 uncompress in pure python
# Copyright 2016,2020 Jan Kneschke <jan@kneschke.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@gabrieljcs
gabrieljcs / lvm-cache-fedora.md
Last active July 14, 2024 11:47
Instructions to create an LVM cache for root in Fedora

LVM cache in Fedora

From the man-pages: "The cache logical volume type uses a small and fast LV to improve the performance of a large and slow LV. It does this by storing the frequently used blocks on the faster LV. LVM refers to the small fast LV as a cache pool LV. The large slow LV is called the origin LV. Due to requirements from dm-cache (the kernel driver), LVM further splits the cache pool LV into two devices - the cache data LV and cache metadata LV. The cache data LV is where copies of data blocks are kept from the origin LV to increase speed. The cache metadata LV holds the accounting information that specifies where data blocks are stored (e.g. on the origin LV or on the cache data LV). Users should be familiar with these LVs if they wish to create the best and most robust cached logical volumes. All of these associated LVs must be in the same VG."

Assuming LVM is already setup in HDD (e.g. from anaconda) and SSD is untouched.

Create a physical