Skip to content

Instantly share code, notes, and snippets.

@varhub
varhub / CriticalSectionGuard.h
Created November 14, 2019 16:54
C++ Windows: fixing stupidity of `CRITICAL_SECTION`. Bringing back C++ standards to non-standard broken class.
#pragma once
#ifndef CRITICAL_SECTION_GUARD_H_
#define CRITICAL_SECTION_GUARD_H_
#include <windows.h>
// (c) 2019 <[email protected]>
// Released under BSD-3 clause.
class CriticalSectionGuard {
@varhub
varhub / sshd.sh
Created November 7, 2018 13:35
Docker: On-demand isolated SSHD server without affect host configuration. But not 100% trully with security ;)
docker run --rm --publish=10022:22 \
--env ROOT_PASSWORD=simple_password \
-v $PWD:/data \
hermsi/alpine-sshd
@varhub
varhub / python3_loop_functional.py
Created April 20, 2018 09:40
Python: infinite loop in functional syntax
"""
From Python 3.3, functional programing on top of generators has been reached a new state-level.
Infinite loop without memory footprint with just a `list()` over the magic.
https://stackoverflow.com/questions/13243766/python-empty-generator-function
A new ofuscated way to hide traditional server-loops is here, muajajaja.
"""
def classical_yield():
[Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
## https://bugs.launchpad.net/fwts/+bug/1249978
# **https://ubuntuforums.org/showthread.php?t=1613132**
i915
### ???
realtek: No valid SSID, checking pincfg
### FIXED (overriding)
## https://bugzilla.redhat.com/show_bug.cgi?id=785417
@varhub
varhub / list_hashes.sh
Created June 9, 2017 17:24
git list_hashes
_pwd=$PWD
find . -name '.git' -type d | while read repo
do
repo_dir=$(dirname $repo)
cd $repo_dir
echo "$(git rev-parse --short HEAD) $(git rev-parse --show-toplevel)"
#echo -e "$(git rev-parse --show-toplevel) \t $(git rev-parse HEAD)"
cd $_
@varhub
varhub / Android - Enable ADB from recovery.md
Created December 23, 2016 17:54
Android - Enable ADB from recovery

Android - Enable ADB from recovery

Credits to @TheOnlyAnil-@Firelord[^stackoverflow]

  • Requirements: a) stock recovery + rooted phone b) custom recovery

  • Files changed:

@varhub
varhub / Install msu file.md
Created November 29, 2016 19:54
Windows - Install msu file

Install msu file (Windows Update Package)

Inside a msu file (a file with the extension msu) there can be Windows updates (security updates, critical updates, updates, update rollups or hotfixes) or downloadable setup packages. msu stands for Microsoft Update Standalone Package.

To install an .msu update package, you can either double click it, or run Wusa.exe together with the full path of the file:

 wusa.exe \
@varhub
varhub / to_webm.sh
Created April 10, 2016 19:23
Converting video to WebM with ffmpeg/avconv
#!/bin/sh
#
# -*- varribas archive -*-
#
## Converting video to WebM with ffmpeg/avconv
# https://superuser.com/questions/556463/converting-video-to-webm-with-ffmpeg-avconv
#
# The following information is taken from the FFmpeg vpx (WebM) Encoding Guide
# and gives a basic overview of WebM encoding. As the libvpx encoder for FFmpeg
# hasn't really been documented before, any suggestions for improvement are
@varhub
varhub / dronecampeones_run_test.sh
Created March 23, 2016 20:23
The runner for single command execution of dronecampeones trainning test.
#!/bin/sh
#
# Copyright (c) 2016
# Author: Victor Arribas <[email protected]>
# License: GPLv3 <http://www.gnu.org/licenses/gpl-3.0.html>
if pgrep gzserver || pgrep gzclient
then
killall gzserver
@varhub
varhub / privacy-guard_recover-from-bootloop.md
Last active July 6, 2018 12:30
Privacy Guard - Recover from bootloop

Privacy Guard - Recover from bootloop

Copyright (C) 2016 Victor Arribas (CC-BY-NC-SA-4.0)


Abstract

Recover from bootloop after break CyanogenMod's Privacy Guard without data lost.