Skip to content

Instantly share code, notes, and snippets.

View maurice-schuppe's full-sized avatar
🏆
Goal archivements

Maurice Schuppe maurice-schuppe

🏆
Goal archivements
  • Freelancer
  • Toulouse, France
View GitHub Profile
@maurice-schuppe
maurice-schuppe / privileged.py
Created August 11, 2020 08:45 — forked from wdormann/privileged.py
List privileged services that don't come with Windows 10
import os
import subprocess
# See: https://blogs.msmvps.com/erikr/2007/09/26/set-permissions-on-a-specific-service-windows/
svcinfo = {}
FNULL = open(os.devnull, 'w')
win10builtin = ['AppVClient', 'ClickToRunSvc', 'COMSysApp', 'diagnosticshub.standardcollector.service',
'msiserver', 'ose', 'perceptionsimulation', 'SecurityHealthService', 'Sense',
'SensorDataService', 'SgrmBroker', 'Spooler', 'ssh-agent', 'TieringEngineService',
@maurice-schuppe
maurice-schuppe / .zshrc
Created June 3, 2020 14:56 — forked from ypresto/.zshrc
Fix "SSL certificate problem: certificate has expired" issue in homebrew
# Add this snippet to your .zshrc, .bashrc or etc.
# https://security.stackexchange.com/a/232446/235706
export CURL_SSL_BACKEND=secure-transport
# https://github.com/Homebrew/brew/issues/6274#issuecomment-507937736
export HOMEBREW_NO_ENV_FILTERING=1
@maurice-schuppe
maurice-schuppe / windows_hardening.cmd
Created May 12, 2020 07:02 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
/***********************************************************************
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel.
*
* Copyright (c) 2000-2006 Shun-ichi Goto
* Copyright (c) 2002, J. Grant (English Corrections)
* Copyright (c) 2010, Reini Urban (added realm to http_auth basic)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@maurice-schuppe
maurice-schuppe / UUID.hpp
Created December 6, 2019 07:42 — forked from fernandomv3/UUID.hpp
C++ UUID generator
#ifndef UUID_H
#define UUID_H
#include <string>
#include <cstdlib>
//*Adapted from https://gist.github.com/ne-sachirou/882192
//*std::rand() can be replaced with other algorithms as Xorshift for better perfomance
//*Random seed must be initialized by user
@maurice-schuppe
maurice-schuppe / getxkblayout.c
Created November 13, 2019 09:06 — forked from fikovnik/getxkblayout.c
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@maurice-schuppe
maurice-schuppe / browser_history.md
Created November 12, 2019 10:56 — forked from dropmeaword/browser_history.md
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@maurice-schuppe
maurice-schuppe / json.cpp
Created November 12, 2019 08:07 — forked from willkill07/json.cpp
JSON parser in modern C++
#include "json.hpp"
namespace json {
Wrapper::Wrapper(Value const &value) : v{value} {}
Wrapper::Wrapper(Value &value) : v{value} {}
Wrapper::operator Value &() { return v; }
Wrapper::operator Value const &() const { return v; }
@maurice-schuppe
maurice-schuppe / statvfs-df.c
Created November 6, 2019 15:30 — forked from vgerak/statvfs-df.c
Get disk usage with statvfs()
#include <stdio.h>
#include <sys/statvfs.h>
int main(int argc, const char *argv[])
{
const unsigned int GB = (1024 * 1024) * 1024;
struct statvfs buffer;
int ret = statvfs(argv[1], &buffer);
@maurice-schuppe
maurice-schuppe / system_uuid.sh
Created October 12, 2019 02:37 — forked from bencord0/system_uuid.sh
Unique id for a linux system
#!/bin/bash
cat /var/lib/dbus/machine-id && exit
# Provided by dbus, hence available on all systemd systems.
# Any user can read it and it is persistent accross boots.
# It is unique per installation, and works well in VMs.
# Not all systems (i.e. stage3 gentoo/handbook install)
# have dbus installed by default.
cat /sys/class/dmi/id/product_uuid && exit