Skip to content

Instantly share code, notes, and snippets.

View cyrus-and's full-sized avatar

Andrea Cardaci cyrus-and

View GitHub Profile
@cyrus-and
cyrus-and / print_type_of.cpp
Created August 4, 2017 09:44
C++ debug type prints
#include <iostream>
template <typename T>
void print_type_of(T value = T()) {
(void)value;
std::clog << __PRETTY_FUNCTION__ << std::endl;
}
int main()
{
$ ./hashall.py asd
BLAKE2s256  256  2521f2bce24415ca048d86e965b49e9c0695547dffe6b441cc48cfb0043e6157
blake2b512  512  e4139471a1800a05b5e02b56669f025d01e33c5655153a4faa29f694f7849c63f97577fcc3e397d1138cf4640e0c2053e74a7af646598310d076dc6f15d1af50
SHA256      256  688787d8ff144c502c7f5cffaafe2cc588d86079f9de88304c26b0cb99ce91c6
SHA512      512  e54ee7e285fbb0275279143abc4c554e5314e7b417ecac83a5984a964facbaad68866a2841c3e83ddf125a2985566261c4014f9f960ec60253aebcda9513a9b4
blake2s256  256  2521f2bce24415ca048d86e965b49e9c0695547dffe6b441cc48cfb0043e6157
MD4         128  61118995d26bef582a59dec9220483e8
sha256      256  688787d8ff144c502c7f5cffaafe2cc588d86079f9de88304c26b0cb99ce91c6
sha512      512  e54ee7e285fbb0275279143abc4c554e5314e7b417ecac83a5984a964facbaad68866a2841c3e83ddf125a2985566261c4014f9f960ec60253aebcda9513a9b4
[Adblock Plus 1.1]
wikipedia.org##div#centralNotice
wikipedia.org##div#siteNotice
wikipedia.org##div#frb-inline
blogspot.it##div#cookieChoiceInfo
blogspot.it##div#navbar
blogspot.com##div#cookieChoiceInfo
blogspot.com##div#navbar
developer.android.com##div.dac-toast-group
dev.mysql.com##div.truste_box_overlay
@cyrus-and
cyrus-and / fix.css
Last active October 26, 2016 21:11
Style fix for Amazon's Send To Kindle Chrome extension
/* hide useless elements */
#s2k-feedback-menu,
#s2k-reader-header-logo,
#s2k-metadata-menu,
#s2k-reader-header-close {
display: none;
}
/* remove top bar */
#s2k-reader-header {
@cyrus-and
cyrus-and / adjust.js
Last active July 14, 2016 11:49
CSS color adjustment
// javascript:
(function () {
/* inject dat.gui library */
var script = document.createElement('script');
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5.1/dat.gui.min.js';
document.head.appendChild(script);
/* wait for the script to be loaded */
script.addEventListener('load', function () {
/* CSS params */
var params = [
@cyrus-and
cyrus-and / memio.py
Last active June 12, 2016 13:55
Simple I/O for /proc/<pid>/mem (since those files allow lseek-based access only)
#!/usr/bin/env python
import os
import sys
def show_usage():
sys.stderr.write('''memio - Simple I/O for /proc/<pid>/mem
Dump /proc/<pid>/maps:
memio.py <pid>
@cyrus-and
cyrus-and / nic-stats.sh
Last active March 13, 2016 15:31
NIC stats from /sys/class/net/
#!/usr/bin/env bash
width=10
declare -a stats=(rx_bytes tx_bytes rx_packets tx_packets)
declare -a names=('RX Bps ' 'TX Bps' 'RX pps' 'TX pps')
declare -a fmt=('--to iec --suffix B' '--to iec --suffix B' '--to si' '--to si')
function get_stat() {
local iface="$1"
local stat="$2"
@cyrus-and
cyrus-and / README.md
Last active July 16, 2023 11:33
let-in - User-initiated reverse shell via OpenSSL

let-in

User-initiated reverse support shell via OpenSSL from a host user behind a firewall to the guest.

Usage

  1. Both parties run:
@cyrus-and
cyrus-and / apk.sh
Last active January 27, 2016 23:43
Stupid ADB wrapper for APK retrival
#!/bin/bash -e
usage() {
echo "Usage:
apk list
apk path <package>
apk fetch <package>
"
}
@cyrus-and
cyrus-and / .muteonlogout.plist
Last active January 24, 2016 12:35
Mute audio on logout on Mac OS X
#!/bin/bash
# Install:
# 1. wget -P ~ https://gist.githubusercontent.com/cyrus-and/76e2b92bfc16d65617ff/raw/921a91b765944f0aed3cf85490631ac58182037d/.muteonlogout.plist
# 2. chmod +x ~/.muteonlogout.plist
# 3. sudo defaults write com.apple.loginwindow LogoutHook ~/.muteonlogout.plist
# Uninstall:
# sudo defaults delete com.apple.loginwindow LogoutHook