Skip to content

Instantly share code, notes, and snippets.

View mtrimarchi's full-sized avatar
🍣
Sushi driven networking

Manuele Trimarchi mtrimarchi

🍣
Sushi driven networking
View GitHub Profile
Verifying that +mtrimarchi is my blockchain ID. https://onename.com/mtrimarchi

Keybase proof

I hereby claim:

  • I am mtrimarchi on github.
  • I am mtrimarchi (https://keybase.io/mtrimarchi) on keybase.
  • I have a public key ASC0bKswvvtpyABcGRV7cI8869hG5R1yn4bVfq1Y1OPMwAo

To claim this, I am signing this object:

@mtrimarchi
mtrimarchi / PinDecrypt.php
Created February 23, 2017 14:39
PinDecrypt - Convert encrypted data with DES_ECB using a key
<?php
/**
*
* PinDecrypt - Convert encrypted data with DES_ECB using a key
*
* @param String $Key - The key with which the data was encrypted.
* If the provided key size is not supported by the cipher,
* the function will emit a warning and return FALSE
* @param String $Data - The data that will be decrypted with the given cipher and mode.
@mtrimarchi
mtrimarchi / mips_toolchain.sh
Created March 4, 2017 17:27 — forked from Lochnair/mips_toolchain.sh
Debian wheezy mips(el) toolchain
#!/bin/sh
# Debian 7 MIPS Toolchain
ARCH=${ARCH:-mips}
# Update
mkdir /usr/src/$ARCH-toolchain && cd /usr/src/$ARCH-toolchain
apt-get update
apt-get upgrade
@mtrimarchi
mtrimarchi / README.md
Created April 24, 2017 17:18
Start keepalived over VLAN at boot

Enable systemd-networkd-wait-online systemctl enable systemd-networkd-wait-online.service

And modify /usr/lib/systemd/system/keepalived.service

@mtrimarchi
mtrimarchi / README.md
Created April 26, 2017 09:56
sed replace foo with bar on all .conf files

find . -type f -name "*.conf" -print0 | xargs -0 sed -i "s/foo/bar/g"

@mtrimarchi
mtrimarchi / alertPapertrail.php
Created November 14, 2017 11:36
Wrapper from Papertrail to Telegram using webhooks
<?php
/**
* alertPapertrail.php
*/
// Require https://github.com/Eleirbag89/TelegramBotPHP
include 'Telegram.php';
// Set the bot TOKEN
@mtrimarchi
mtrimarchi / tgbot_msg_with_emoji.ps1
Created October 3, 2018 16:19
Telegram Bot send message with Emoji
function U
{
param
(
[int] $Code
)
if ((0 -le $Code) -and ($Code -le 0xFFFF))
{
return [char] $Code
@mtrimarchi
mtrimarchi / Get-SqlServerKeys.ps1
Created November 22, 2018 09:28
Get-SqlServerKeys with support for SQL Server 2017
Function Get-SqlServerKeys {
<#
.SYNOPSIS
Gets SQL Server Product Keys from local and remote SQL Servers. Works with SQL Server 2005-2014
.DESCRIPTION
Using a string of servers, a text file, or Central Management Server to provide a list of servers, this script will go to each server and get the product key for all installed instances. Clustered instances are supported as well. Requires regular user access to the SQL instances, SMO installed locally, Remote Registry enabled and acessible by the account running the script.
Uses key decoder by Jakob Bindslet (http://goo.gl/1jiwcB)
@mtrimarchi
mtrimarchi / voip.py
Created December 5, 2018 12:51
Python Script VoIP TIM
# Credenziali voip TIM + Proxy IP
import sys
import random
import json
try:
import requests
except ImportError:
print ("ERRORE: Il modulo \"requests\" deve essere installato. Eseguire -> pip install requests")
raise SystemExit(0)