Skip to content

Instantly share code, notes, and snippets.

@marcinwol
marcinwol / dcmtk_compile.sh
Last active March 8, 2024 14:36
Compile dcmtk 3.6.1 on Ubuntu 14.04
# The gist shows how to compile latest development snaphost of DCMTK 3.6.1
# in Ubuntu 14.04. The version of the dcmtk avaliable in ubuntu's repositiries
# is 3.6.0, which is from 2011. The gist also shows how to setup include
#and lib folders so thatwe can use them to write our own C++ programs
# using the develpment version.
# first need to install required packages
sudo apt-get install build-essential cmake libpng12-dev libtiff5-dev libxml2-dev libjpeg8-dev zlib1g-dev libwrap0-dev libssl-dev
# where to install DCMTK
@marcinwol
marcinwol / setup_proxychains-ng.sh
Last active November 9, 2023 15:54
Setup and test proxychains-ng on Ubuntu 14.04
# if you havent done it yet, please download the tor-browser and start it
# https://www.torproject.org/download/download-easy.html.en
wget https://www.torproject.org/dist/torbrowser/5.0/tor-browser-linux64-5.0_en-US.tar.xz
tar xf tor-browser-linux64-5.0_en-US.tar.xz
# download the source of proxychains-ng
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
@marcinwol
marcinwol / CMakeLists.txt
Created June 20, 2015 03:59
Basic CMakeLists.txt for DCMTK 3.6.0 that is avaliable for Ubuntu 14.04
# This is example of the cmake file that can be used for basic compilation of a C++11 program
# that uses DCMTK 3.6.0 avaliable in ubuntu 14.04
# to install DCMTK 3.6.0 for ubuntu 14.04
# sudo apt-get install libdcmtk2-dev
cmake_minimum_required(VERSION 2.8)
# name of the cpp project
project(testDMCTK)
@marcinwol
marcinwol / dir_tree_read.cpp
Last active April 1, 2023 22:09
An example showing how to find all paths in a given folder and its sub folders using fts_read function.
#include <errno.h>
#include <string.h>
#include <fts.h>
#include <iostream>
#include <vector>
using namespace std;
@marcinwol
marcinwol / example.cpp
Created November 5, 2015 04:19
Boost python vector to py list and py list to vector
#include <iostream>
#include <vector>
#include <memory>
#include "boost/shared_ptr.hpp"
#include "boost/python.hpp"
#include "boost/python/stl_iterator.hpp"
using namespace std;
@marcinwol
marcinwol / CMakeLists.txt
Created June 20, 2015 03:44
Basic CMakeLists.txt for compiled DCMTK 3.6.1
# This is example of the cmake file that can be used for basic compilation of a C++11 program
# that uses DCMTK 3.6.1 in ubuntu 14.04
# Compilation instructions are here:
# https://gist.github.com/marcinwol/089d4a91f1a1279e33f9
cmake_minimum_required(VERSION 2.8)
# name of the cpp project
@marcinwol
marcinwol / compile_monero.sh
Created August 16, 2015 01:19
Ubuntu 14:04: compile CPUMiner/minerd (forked by LucasJones & Wolf) for Monero mining
# get git to install it
sudo apt-get install git
# dependencies
sudo apt-get install build-essential autotools-dev autoconf libcurl3 libcurl4-gnutls-dev
# download latest version
git clone https://github.com/wolf9466/cpuminer-multi
cd cpuminer-multi/
@marcinwol
marcinwol / imagemagick7.sh
Created November 5, 2016 06:51
Compile ImageMagick 7 on Ubuntu 16.04
sudo apt install build-essential autoconf automake autopoint chrpath cm-super-minimal debhelper dh-autoreconf dh-strip-nondeterminism doxygen doxygen-latex gir1.2-rsvg-2.0 graphviz libbz2-dev libcairo-script-interpreter2 libcairo2-dev libcdt5 libcgraph6 libclang1-3.6 libdjvulibre-dev libexif-dev libfftw3-bin libfftw3-dev libfftw3-long3 libfftw3-quad3 libfile-stripnondeterminism-perl libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libglib2.0-dev libgvc6 libgvpr2 libharfbuzz-dev libharfbuzz-gobject0 libice-dev libilmbase-dev libjasper-dev libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-jquery liblcms2-dev libllvm3.6v5 liblqr-1-0-dev liblzma-dev libobjc-5-dev libobjc4 libopenexr-dev libpango1.0-dev libpathplan4 libpcre3-dev libpcre32-3 libpcrecpp0v5 libperl-dev libpixman-1-dev libpng12-dev libpotrace0 libptexenc1 libpthread-stubs0-dev librsvg2-bin librsvg2-dev libsigsegv2 libsm-dev libsynctex1 libtexlua52 libtexluajit2 libtiff5-dev libtiffxx5 libwmf-dev libx11-dev li
@marcinwol
marcinwol / chunker_example.cpp
Last active July 17, 2020 20:03
Split vector, list or deque into chunks of an equal size in C++
/**
* Split container into chunks of an equal size
*
* An example C++11 function called chunker that takes
* a container (vector, list, deque), divides it
* into equal chunks of a given size, and returns
* container of chunks.
*
*
* The example code is based on the two following posts:
@marcinwol
marcinwol / compilemonero.sh
Last active June 10, 2018 17:10
Compile latest bitmonero source on Ubuntu 14.04
# The gist shows how to compile latest monero source code on
# Ubuntu 14.04
# install git
sudo apt-get install git
# install dependencies
sudo apt-get install build-essential cmake libboost1.55-all-dev libssl-dev libgtextutils-dev pkg-config libunbound-dev libevent-dev libgtest-dev graphviz doxygen libdb5.3++-dev