Skip to content

Instantly share code, notes, and snippets.

View madduci's full-sized avatar

Michele Adduci madduci

View GitHub Profile
@madduci
madduci / caesar.cpp
Last active August 29, 2015 14:13
Caesar Code
#include <iostream>
#include <string> //usiamo std::string
#include <cctype> //usato per std::isalnum
#include <algorithm> //usato per std::transform ed std::erase
using namespace std;
//la chiave di default
int key{3};
@madduci
madduci / memory.cpp
Created February 6, 2015 07:21
Modern C++ - Memory
#include <iostream>
#include <memory>
void classic_cpp()
{
std::cout << "***Classic C++***" << std::endl;
/*Classic C++*/
int *x = new int(10);
std::cout << "value of x: " << *x << " ---- address of x: " << x << std::endl;
*x = 100;
@madduci
madduci / CMakeManifest.txt
Created October 18, 2016 13:00 — forked from bjornblissing/CMakeManifest.txt
CMake script to add manifest to exe-file
# Amend manifest to tell Windows that the application is DPI aware (needed for Windows 8.1 and up)
IF (MSVC)
IF (CMAKE_MAJOR_VERSION LESS 3)
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
ELSE()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_TARGETNAME}
POST_BUILD
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaleing.manifest\" -inputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1
COMMENT "Adding display aware manifest..."
@madduci
madduci / server.py
Last active September 25, 2019 07:44
Python3 HTTPS Server
#!/usr/bin/python3
from http.server import HTTPServer, SimpleHTTPRequestHandler
import socket
import ssl
import socketserver
listen_addr = 'test.de'
listen_port = 4443
server_cert = './ssl/server-crt.pem'
version: '3.3'
services:
db:
image: mongo:latest
container_name: mongo
expose:
- "27017"
chat:
image: rocket.chat:latest
container_name: rocket
@madduci
madduci / usc_parser.py
Created October 21, 2017 13:04
Conversion of Ground Truth data for the USC dataset
import sys
import glob
import os
import argparse
import xml.etree.ElementTree
# dlib output format: <image file='*.jpg'><box top='' left='' width='' height=''/> </image>
# USC format: <Object><Rect x="142" y="22" width="28" height="73"/></Object>
@madduci
madduci / packages.ps1
Created December 13, 2017 14:55
Common used packages for Windows
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y flashplayerplugin firefox 7zip.install vlc notepadplusplus.install paint.net malwarebytes teamviewer foxitreader
@madduci
madduci / introrx.md
Created February 2, 2018 11:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@madduci
madduci / sign.sh
Created April 18, 2018 08:46 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
@madduci
madduci / custom_launcher
Last active January 22, 2020 18:10
bumblebee optirun steam launcher
# For NVidia/Bumblebee
LD_PRELOAD="libpthread.so.0 libGL.so.1" __GL_THREADED_OPTIMIZATIONS=1 optirun %command%
# For AMD/Vega
LD_PRELOAD=/usr/lib32/libopenal.so.1 %command%