Skip to content

Instantly share code, notes, and snippets.

View algorythm's full-sized avatar
💭
Stuff and things

Anders Wiberg Olsen algorythm

💭
Stuff and things
View GitHub Profile
importér djava.util.*; //djava = dansk java
importér djava.kollektioner.*;
klasse Dyr {
privat Streng navn;
privat heltal alder;
privat dobbelt højde;
privat statisk heltal antalDyr = 0;
// Search in constant time
public static void WibergSearch(int[] list)
{
if (list.Length > 10000) return;
const int MaxTime = 1000000000;
var watch = Stopwatch.StartNew();
for (var i = 0; i <= list.Length - 2; i++)
{
for (var j = 0; j <= list.Length - 2; j++)
{
@algorythm
algorythm / Setup Secure Linux.md
Last active May 1, 2019 20:22
Configure New Raspberry Pi

Configuring a secure Linux Server (i.e. Raspberry Pi)

This guide will configure a simple secured linux server. In this example, I will configure a raspberry pi.

Prepare SD Card from Mac OS X

This section is for preparing an SD card with Raspbian from a Mac. Start by opening a terminal. Start by downloading the latest version of raspbian:

curl -O -J -L https://downloads.raspberrypi.org/raspbian_lite_latest
@algorythm
algorythm / weapons.json
Created January 10, 2018 15:51
CPH Industries API - Test Json Objects
[
{
"id": 1,
"name": "Bob's Gun",
"ip": "127.0.0.1",
"mac": "aa:bb:cc:00:11:22",
"firemode": "single",
"connectionStrength": 2,
"batteryLevel": 37,
"model": "AK-47",
@algorythm
algorythm / Setup GPG.md
Last active February 20, 2020 14:29
Useful Git Tips

Setup GPG Key

Install latest GPG version (the one MacOS ships with is out of date):

$ brew install gpg2 gnupg pinentry-mac

Create a new GPG key

public static void SleepSort(int[] list)
{
foreach (var i in list)
{
Task.Run(() =>
{
Thread.Sleep(i);
Console.Write($"{i} ");
});
}
@algorythm
algorythm / recon.md
Last active March 28, 2018 07:54
Tips for CTF

CTF tips

Recon the server

It is a good idea to start a port scan on the server. A very basic fast way is:

nmap -sS <ip/fqdn>
@algorythm
algorythm / Encrypted Installation.md
Last active June 6, 2018 00:26
Secure Arch Linux Installation

Secure Arch Linux Install

Following this guide from YouTube: https://www.youtube.com/watch?v=gB1N00wj3bw

This installation procedure follows installing a secure encrypted lvm version of Arch Linux on my MacBook Pro in Parallels.

Harddisk Setup

Let us start by looking at the naming of harddrives:

@algorythm
algorythm / create_cd.sh
Created November 28, 2018 16:45
Automate all the things
#!/bin/bash
# Call this file with `bash ./project-create.sh project-name [service-name]`
# - project-name is mandatory
# - service-name is optional
# This will creates 4 directories and a git `post-receive` hook.
# The 4 directories are:
# - $GIT: a git repo
# - $TMP: a temporary directory for deployment
@algorythm
algorythm / client.py
Last active December 15, 2018 17:18
OAuth Client
from http.server import BaseHTTPRequestHandler, HTTPServer
import webbrowser
def get_code_from_httpserver(address = "127.0.0.1", port = 8000):
"""
Starts a webserver
When a GET request with query parameter "?code=something" is
received, stop the webserver and return that code
"""