Skip to content

Instantly share code, notes, and snippets.

@pladaria
pladaria / Logitec-z960-IR-codes.md
Created December 12, 2019 11:35
Logitech Speaker System Z906 remote IR codes
@mrpeardotnet
mrpeardotnet / PVE-HP-ssacli-smart-storage-admin.md
Created November 25, 2019 22:10
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active July 19, 2024 07:06
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@uablacklist
uablacklist / sync_uablacklist
Last active July 9, 2024 22:11
Добавляет IP подсети, заблокированные украинским правительством, из https://uablacklist.net в список адресов вашего Mikrotik
:local apiPrefix "https://uablacklist.net/subnets_mikrotik_"
:local tempFile "uablacklist.txt"
:local listName "uablacklist"
/log info "removing existing '$listName'..."
:put "removing existing '$listName'..."
/ip firewall address-list remove [/ip firewall address-list find list=$listName]
# mikrotik can't load >4KB file inside a variable, so backend contains file pieces which we download and parse one by one
:local i 0
@Rulexec
Rulexec / crypto.js
Created January 27, 2018 21:39
Telegram crypto AES 256 IGE node.js implementation
var crypto = require('crypto');
/*
msg_key_large = SHA256 (substr (auth_key, 88+x, 32) + plaintext + random_padding);
msg_key = substr (msg_key_large, 8, 16);
sha256_a = SHA256 (msg_key + substr (auth_key, x, 36));
sha256_b = SHA256 (substr (auth_key, 40+x, 36) + msg_key);
aes_key = substr (sha256_a, 0, 8) + substr (sha256_b, 8, 16) + substr (sha256_a, 24, 8);
aes_iv = substr (sha256_b, 0, 8) + substr (sha256_a, 8, 16) + substr (sha256_b, 24, 8);
*/
@mattlockyer
mattlockyer / table.js
Created May 9, 2017 21:12
React Component for Draggable Re-ordering of Columns in react-table
import React, { Component } from 'react';
import ReactTable, { ReactTableDefaults } from 'react-table';
//https://github.com/tannerlinsley/react-table
//https://react-table.js.org/
import 'react-table/react-table.css'
Object.assign(ReactTableDefaults, {
defaultPageSize: 10,
minRows: 3,
});
@PatrickLang
PatrickLang / mikrotik-pxe.md
Last active June 7, 2024 03:09
Boot from Mikrotik router and install Windows

Using a Mikrotik router to boot and install Windows

Lately I've been using Mikrotik routers because they're cheap, powerful, and fast. Most of them have either a USB or MicroSD slot, so you can add enough space to store network boot images right on the router.

I got most of the tips needed from these two articles, and combined them into this step by step guide:

@wfjsw
wfjsw / tl_convert.js
Last active January 20, 2020 08:10
Convert TL-Schema File to JSON
'use strict';
var fs = require('fs')
var args = process.argv.slice(2);
// From https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L6891
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
@yutopio
yutopio / cert.cs
Created February 20, 2017 12:14
Certificate generation with BouncyCastle C#
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.Sec;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;
@iamarcel
iamarcel / Creating Neat .NET Core Command Line Apps.md
Last active November 28, 2023 10:41
Creating Neat .NET Core Command Line Apps

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat