Skip to content

Instantly share code, notes, and snippets.

View GaPhil's full-sized avatar

Phillip GaPhil

  • KTH -> EPFL -> MPI/RUB
  • Stockholm, Sweden
View GitHub Profile
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@GaPhil
GaPhil / README.md
Last active October 11, 2017 20:27
ssh and afs

Get files from local machine onto server

start off by copying your local files to a remote machine using scp. You can choose one of the servers here

general command: scp <file_name_with_path> <kth_username>@<host>:<path_on_host>
example command: scp <file_name_with_path> [email protected]:~/Desktop/engineering-skills

now to check that your files are on the server by connecting via ssh

general command: ssh <kth_username>@<host>
example command: ssh [email protected]

@SimoneStefani
SimoneStefani / AESenc.java
Last active January 6, 2025 13:36
Example of AES encryption and decryption in Java
/**
* Code written by P. Gajland
* https://github.com/GaPhil
*
* IMPORTANT:
* This code is for educational and demonstrative purpose only.
* If you need to do serious encryption for "production" it is
* recommended to investigate more traditional libraries and
* gain some specific knowledge on cryptography and security.
*/