Skip to content

Instantly share code, notes, and snippets.

View sponnusa's full-sized avatar
👻
Vicious Electron Journey!

Suri sponnusa

👻
Vicious Electron Journey!
View GitHub Profile
@yingray
yingray / main.go
Last active April 7, 2025 16:57
Golang: aes-256-cbc examples (with iv, blockSize)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
)
@GaiaAnn
GaiaAnn / 1_RSA_Encrypt.cs
Last active February 7, 2025 15:28
RSA Encrypt/Decrypt & Sing/VerifySign C# sample
private static string Encrypt(string publicKey, string content)
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
//Get publicKey information
RSAParameters parameters = ConvertFromPublicKey(publicKey);
rsa.ImportParameters(parameters);
//Convert to UTF8 bytes
var content_utf = rsa.Encrypt(Encoding.UTF8.GetBytes(content), false);
//Convert to Base64String
var encryptString = Convert.ToBase64String(content_utf);
@ryanmcgary
ryanmcgary / readme.html
Last active November 6, 2024 20:35 — forked from allewun/remove-watermark.sh
Remove a textual watermark from a PDF file.
zngguvnf's Blog
Processing multiple PDFs using the command line
:linux:
<2017-12-01>
Update [2018-04-17 Tue]
Remove password from pdf
Remove string from pdf
Update [2018-03-30 Fri]:
@mistic100
mistic100 / vimeo-downloader.js
Created September 15, 2018 09:01
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
@Dan-Q
Dan-Q / ev-ssl-ca-experiment.sh
Created September 4, 2018 21:39
Experiment to use OpenSSL to establish an EV-capable CA and issue illigitimate certificates which will be accepted and displayed as full valid EV certificates by Microsoft Internet Explorer and Edge on appropriately-configured Windows computers.
#!/bin/bash
# The following steps, which were tested on Ubuntu 18.04 LTS and on the Ubuntu-powered Linux for Windows Subsystem on Windows,
# will:
#
# * Compile a recent version of OpenSSL (you can skip this step and use your package maintainer's version if you prefer, but you
# might have to tweak a few bits)
# * Create a separate set of configuration files suitable for configuring a basic CA capable of signing EV certificates
# * Create such a CA (hackerca.local / HackerCA EV Root CA)
# * Create a certificate request for a site, hackersite.local, belonging to company "Barclays PLC [GB]"
@fay59
fay59 / Quirks of C.md
Last active November 3, 2025 03:10
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@mndrix
mndrix / sms.go
Last active June 23, 2020 17:20
SMS over IRC
// A proxy for sending/receiving SMS via IRC
//
// This code is part of our family IRC server whose code is available at
// https://gist.github.com/mndrix/7947009178e4a18c247b4bd25821661f
//
// This file won't compile by itself because it's only one file from
// my larger family server (movie hosting, Asterisk dialplan, Git
// hosting, personal assistant, etc).
//
// Copyright 2018 Michael Hendricks
@mndrix
mndrix / irc.go
Last active June 23, 2020 17:21
Family IRC server
// My small, family IRC server
//
// This file won't compile by itself because it's only one file from
// my larger family server (movie hosting, Asterisk dialplan, Git
// hosting, personal assistant, etc).
//
// Users authenticate via NICK and PASS. The USER is interpreted as a
// "device" name. That allows each user to connect from multiple
// devices simultaneously while still appearing as only one nick in
// channels. Each nick-device combo has a queue of messages which
@sam016
sam016 / AllGattCharacteristics.java
Last active November 21, 2025 13:26
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@picheljitsu
picheljitsu / Get-RemoteMFT.ps1
Last active August 2, 2024 19:55
Powershell Diskless MFT Grabber
function Get-RemoteMFT {
<#
.SYNOPSIS
Extracts master file table from volume.
Version: 0.1
Author : Jesse Davis (@secabstraction)