Skip to content

Instantly share code, notes, and snippets.

View Bios-Marcel's full-sized avatar
:shipit:
I am busy abandoning projects

Marcel Schramm Bios-Marcel

:shipit:
I am busy abandoning projects
View GitHub Profile
@Bios-Marcel
Bios-Marcel / opsec.md
Last active June 9, 2019 19:41
My document regarding OpSec

OpSec - The definitive guide

Hello there fella. I have written this guide in order to help you, who might be my future self, to maintain operational security while searching for security vulnerabilities and whatever not.

Contents

  • What is operational security
  • Why is this important
  • How to maintain OpSec
  • Behaving correctly
@Bios-Marcel
Bios-Marcel / config
Created January 9, 2019 08:44
i3 config
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Windows / Command key as modifier
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:FontAwesome 9
@Bios-Marcel
Bios-Marcel / oop-at-its-best.md
Created November 26, 2018 10:19
Object orientation at its best

Today at work, I found a class with the following hierarchy:

TreeTable extends SortableTable extends CategorizedTable extends CellSpanTable extends CellStyleTable
extends NavigableTable extends ContextSensitiveTable extends JideTable extends JTable extends JComponent
extends Container extends Component

Amusing!

@Bios-Marcel
Bios-Marcel / pkginfo.go
Created October 12, 2018 15:52
Add package-info.java to all folders containing .java files
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
fun main(arguments: Array<String>) {
Application.launch(App::class.java)
}
class App : Application() {
override fun start(primaryStage: Stage) {
primaryStage.title = "Popup Example"
primaryStage.initStyle(StageStyle.UTILITY)
primaryStage.opacity = 0.0
@Bios-Marcel
Bios-Marcel / SturdyWindow.java
Created July 30, 2018 07:39
Creating a Frame that stays in the background (Swing only)
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JWindow;
public class SturdyWindow
{
public static void main( final String[] args )
{
@Bios-Marcel
Bios-Marcel / cdb.sh
Last active July 23, 2018 06:31
function that adds the capability to go back to any directory named X using cd. Just put it into ~/.bashrc
function cdb() {
#suppress all output and run the original cd with all given arguments
command cd $@ &>/dev/null
#If the original ran successfully, do an early exit
if [ $? -eq 0 ]; then
return
fi
START_DIR="$PWD"
@Bios-Marcel
Bios-Marcel / keybinderpoc.kt
Last active July 1, 2018 20:20
PoC for a basic KeyBinder that allows for text to be output on key press. Written using JNativehOOK and Kotlin.
package com.msc.serverbrowser
import org.jnativehook.GlobalScreen
import org.jnativehook.keyboard.NativeKeyAdapter
import org.jnativehook.keyboard.NativeKeyEvent
import java.awt.Robot
import java.awt.event.KeyEvent
import java.util.logging.Level
import java.util.logging.Logger
@Bios-Marcel
Bios-Marcel / linecountsofjavafiles.java
Created June 27, 2018 14:31
Recursively counts the lines of all java files in a directory
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
/**