Skip to content

Instantly share code, notes, and snippets.

View Cyl18's full-sized avatar
🌝

Cyl18

🌝
View GitHub Profile
@dylech30th
dylech30th / Collections.cs
Last active May 29, 2021 14:21
Dragon book chapter 3 code
using System.Collections;
using System.Collections.Generic;
namespace CompilerExercise
{
public static class Collections
{
public static int IntArrayHash(this int[] array)
{
return StructuralComparisons.StructuralEqualityComparer.GetHashCode(array);
@TonyDecvA180XN
TonyDecvA180XN / rail_not_tileable
Created March 22, 2021 08:43
Rail cluster (fit inside chunk)
0eNqlfd3uZ8eN3KsYc5UAMnBI9gfbj5HbYBH4Y+IdRJYNabSIsfC7Z2TJCeBUH1dNXS28tgp9SFb99GeT1f/54Xff/vjxL99/+u7zh9/854cfvvvtX379+c+//uP3n/7w03/+3x9+U/nNh7/+9H/+9s2H3/7uhz9/++Pnj7/+6X/3l0/f/fHDbz5//+PHbz58+v2fv/vhw2/++xeET3/87rff/vTPfv7rXz5++M2HT58//unDNx++++2ffvpP3//207cfviB9+u4PH7+Ax9/+7ZsPH7/7/Onzp48///N//w9//R/f/fin3338/sv/4P/+k7//8fv/+PiHX/8d4JsPf/nzD1/+mT9/98shx9/P+NMR//Dp+4+///m/2X/75v/DSwVv/Gu84vAS4Q2ANwy8AHjTiN8CeMvAS4C3jXwgvDbwJsA7Rj4QXjzaARFEaGdCEGmksRDg/+PBD5+/YP3x3z9fIOPvkPGvKzeGBlkE5LROCT98sZCFIJGkxLZOCSFbO2URkMdKD9Tmx4ololuGFUsImSokAvH4gpQvyZ+ORf9UTgWQ+K3MZYgz+rFM59cDCUS2EUP0c5nHAERZrsdICgQMAxDxo1IDRBBlRA2pdA1LWVCp1LQkFUJ6vyXww+nfksn+llRrkITw17FOiapwyL8lCCSshCC6DZIdzar0KAWQUOkxDEGAf9I4vyOIJ2MZMUQqPbYBCLPcRlIg4DEAET/mowEiiDCihsRqpiUD8M/fssQKQg7rlPDD6d+Szar0XBokodJzW6eEVdhqLBGI9+uB6LZIdvz01zwn0yskREKnVxqSgHR6Ob8kiClrOFGE3afpIMJMLycvEHE7iIglq0VEhHGcyCHR2o8lB6hgdliiBSHTOiX8cPo35bBqvYcGSaj1ntYpUR3upcYSgXi/IrCHzPIjWbXeR0Ik1LofRxWQXLf1i4K40unEEel1l4MI+/vDyQxEnA4i4kkvERFhbCdySLa6LUGABXMs2UKQ57FOiT788D1guqF+UsQkFPu
@FreddieOliveira
FreddieOliveira / docker.md
Last active August 24, 2025 06:26
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

Seed Cracking

Part 1: A little explanation about Java Random

  • java.util.Random, An instance of this class is used to generate a stream of pseudorandom numbers. The class uses a 48-bit seed, which is modified using a linear congruential formula. (See Donald Knuth, The Art of Computer Programming, Volume 2, Section 3.2.1.)

  • This class has 6 nifty functions:

    • nextBoolean()
    • nextDouble()
  • nextFloat()

  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04 -> 21.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@kmxz
kmxz / run-in-browser-console.js
Created January 7, 2019 04:37
Script to add to gartic.io
const assertEqual = (a, b, opt_msg) => {
if (a !== b) {
throw new RangeError((opt_msg || 'Assertion failed') + ' (expected: ' + b + '; actual: ' + a + ')');
}
};
const verifyWords = words => {
const lines = words.split('\n').filter(_ => _).map(_ => _.trim());
assertEqual(lines.shift(), 'Word,Difficulty (1 - 3),Dirtyness (1 - 3)');
@SMSAgentSoftware
SMSAgentSoftware / New-WizTreeDiskUsageReport.ps1
Created August 15, 2018 13:27
Creates csv and html disk usage reports using WizTree portable
# Script to export html and csv reports of file and directory content on the system drive
# Use to identify large files/directories for disk space cleanup
# Uses WizTree portable to quickly retrieve file and directory sizes from the Master File Table on disk
# Download and extract the WizTree64.exe and place in the same directory as this script
# Set the running location
$RunLocation = $PSScriptRoot
#$RunLocation = "C:\temp"
$TempLocation = "C:\temp"
@yuan3y
yuan3y / jekyll.service
Last active September 8, 2024 13:48
to make `jekyll serve` a system service and start on boot
# Author: @yuan3y
# Date: 2017-09-29
# Description: to make `jekyll serve` a system service and start on boot
#
# Usage: place this file at `/etc/systemd/system/jekyll.service`
# then run
# sudo systemctl start jekyll.service
# sudo systemctl enable jekyll.service
[Unit]
@fotock
fotock / nginx.conf
Last active July 22, 2025 04:42 — forked from plentz/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
title description date categories slug
QQ协议分析
QQ协议分析
2014-04-16
protocol
qq-protocol

一. 文字聊天协议族(TCPF, Text Chatting Protocol Family)