Skip to content

Instantly share code, notes, and snippets.

View lynxluna's full-sized avatar
🎯
Focusing

Didiet lynxluna

🎯
Focusing
View GitHub Profile
@lynxluna
lynxluna / krip.go
Created November 24, 2021 02:39
AES-CBC-256 Crypto with Go
package main
import (
"bufio"
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
@lynxluna
lynxluna / pcx2bit.asm
Last active February 28, 2021 15:36
Open and read to stack
; vi: syntax=masm
.8086
.MODEL SMALL
CR EQU 0DH
LF EQU 0AH
; PCX Header Structure
; -not used at the moment
colors:
# Default colors
primary:
background: '#002b36' # base03
foreground: '#839496' # base0
# Cursor colors
cursor:
text: '#002b36' # base03
cursor: '#839496' # base0
colors:
# Default colors
primary:
background: '#002b36' # base03
foreground: '#839496' # base0
# Cursor colors
cursor:
text: '#002b36' # base03
cursor: '#839496' # base0
#!/bin/sh
gawk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s s s s s s s s s s s s s s s s;
for (colnum = 0; colnum<256; colnum++) {
r = 255-(colnum*255/255);
g = (colnum*510/255);
b = (colnum*255/255);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,row sep=3em,column sep=8em,minimum width=2em]
{
& \bullet \\
\bullet & \bullet \\
& \bullet \\};
\path[->] (m-2-1) edge [in=70,out=100,loop] node[auto](F) {$f$} ();
\path[->,draw] (m-2-1) edge [in=60,out=120,loop,distance=2cm] node[auto](G) {$g$} (m-2-1);
\path[->,draw] (m-2-1) to [in=40,out=140,loop,distance=4.5cm] node[auto](GCF) {$g\circ f$} (m-2-1);
@lynxluna
lynxluna / UnsafeAllocate.java
Created February 5, 2017 17:17
Allocating Instance without calling constructor, just like you're doing with malloc()
import java.lang.reflect.Field;
import java.lang.reflect.Method;
final class InstanceFactory <T> {
public T unsafeAllocate(final Class<?> clazz) {
final Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
final Field f = unsafeClass.getDeclaredField("theUnsafe");
f.setAccessible(true);
final Object unsafe = f.get(null);
final Method allocateInstance = unsafeClass.getMethod("allocateInstance", Class.class);
@lynxluna
lynxluna / post3-reboot.S
Last active September 24, 2016 19:52
Rebooting
.code16 # 16-bit Assembly (real mode)
.text # Mulai section text
.set MAGIC, 0xAA55 # Macro untuk MAGIC number boot record
.globl BootEntry # Simbol Entry Point
BootEntry:
cli # Matikan interrupt
xorw %ax, %ax # AX = 0
movw %ax, %ds # DS = AX = 0
@lynxluna
lynxluna / build.gradle
Created November 16, 2015 13:41
Kotlin Template
buildscript {
ext.kotlin_version = "1.0.0-beta-1103"
repositories {
jcenter()
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
@lynxluna
lynxluna / build.sh
Created October 12, 2015 10:49
Build Script
xcrun -v swiftc -emit-module -emit-library src/whiff.swift \
-sdk $(xcrun --show-sdk-path --sdk macosx) -module-name Haste \
-I deps/include -L deps/lib -luv -v \
-Xlinker -unexported_symbols_list -Xlinker symbols.exp -Xcc -O3 -Xcc -g0 -Xlinker -x