Skip to content

Instantly share code, notes, and snippets.

View andersevenrud's full-sized avatar
🤘
w^w^^w^w

Anders Evenrud andersevenrud

🤘
w^w^^w^w
View GitHub Profile
@andersevenrud
andersevenrud / README.md
Last active July 22, 2022 12:55
UE5 on Arch

UE5 on Arch Linux

Just some personal in order to make Unreal Engine 5 compile on Arch Linux (25th of June 2022).

Don't even bother trying to make the marketplace run. You gotta do that shit under Wine (Lutris is great for auto-setup) and copy assets over to your Linux drive.

Dependencies:

sudo pacman -S dotnet-sdk xdg-user-dir clang make git
@andersevenrud
andersevenrud / index.js
Last active April 21, 2022 21:49
OS.js v3 - Basic Iframe Example
import './index.scss';
import osjs from 'osjs';
import {name as applicationName} from './metadata.json';
// Our launcher
const register = (core, args, options, metadata) => {
// Create a new Application instance
const proc = core.make('osjs/application', {args, options, metadata});
// Create a new Window instance
@andersevenrud
andersevenrud / index.js
Last active July 24, 2021 06:07
OS.js x-frame-bypass iframe example
/*
This is just a demonstration of how this browser hack could be used
to make a "browser".
NOTE: This just bypasses *some* of the ways a browser allows loading
content within an iframe. Most google services etc does not work as
expected, and might just crash or not load.
*/
import './index.scss';
@andersevenrud
andersevenrud / bl-fullscreen-server-browser.user.js
Last active November 30, 2020 01:44
Fullscreen Battlelog Server Browser (BF4)
// ==UserScript==
// @name Fullscreen Battlelog Server Browser (BF4)
// @namespace http://andersevenrud.github.io/
// @version 0.5.0
// @description Fullscreen Battlelog Server Browser (BF4)
// @match http://battlelog.battlefield.com/bf4
// @match http://battlelog.battlefield.com/bf4/*
// @match http://cte.battlelog.battlefield.com/bf4
// @match http://cte.battlelog.battlefield.com/bf4/*
// @match http://cte.battlelog.com/bf4
@andersevenrud
andersevenrud / wordpress-hack.md
Created March 5, 2016 19:37
wordpress-hack.md

Wordpress is a very popular target for hackers. They normally get in with holes found in plugins, themes or in wordpress core.

Prevention methods

An up-to-date installation (including plugins and themes) is crutial!

Hardening Wordpress is sadly not a part of the standard installation documentation, but they have a guide available in the "codex": http://codex.wordpress.org/Hardening_WordPress

Removing unused plugins and users, setting htpasswd and/or ip-whitelisting in //wp-admin// also should be considered.

@andersevenrud
andersevenrud / index.js
Created September 12, 2020 20:41
Parse fstab
/**
* Parse fstab from either string (from file) or an array of lines
* @author Anders Evenrud <andersevenrud@gmail.com>
* @license MIT
*/
const parse = input => (input instanceof Array ? input : input.split('\n'))
.map(line => line.replace(/\s+/g, ' ').replace(/(\s+)?,(\s+)?/g, ',').trim())
.filter(line => line.length > 0 && line.substring(0) !== '#')
.map(line => line.split(/\s/g))
.map(([dev, dir, type, options, dump, fsck]) => ({
@andersevenrud
andersevenrud / iframe.html
Created July 27, 2020 22:31
PoC to do bi-directional communiction between a parent and iframe document
<html>
<body>
<img id="image" />
<script>
const image = document.getElementById('image')
const postMessage = (data) => {
top.postMessage(JSON.stringify(data), '*')
}
@andersevenrud
andersevenrud / index.js
Created February 25, 2020 19:42
OS.js Webcam application example (localhost or https only)
//
// NOTE: THIS ONLY WORKS ON "localhost" OR A HOST WITH "https:"
//
import osjs from 'osjs';
import {name as applicationName} from './metadata.json';
const createVideoElement = () => {
const video = document.createElement('video');
video.style.width = '100%';
video.style.height = '100%';
@andersevenrud
andersevenrud / README.md
Last active December 24, 2019 23:42
Very basic OS.js Chat application

Based on example from https://manual.os-js.org/v3/guide/framework/#react

Very basic chat application:

  • Uses a custom websocket server
  • Uses React to render UI
  • Uses event subscription model to handle websocket messages

THIS IS JUST FOR DEMONSTRATION PURPOSES

@andersevenrud
andersevenrud / sso-with-wordpress.md
Last active May 23, 2019 13:16
SSO with Wordpress

This is a guide for setting up SSO in Wordpress using Apache.

It is done in these steps:

  1. Set up Active Directory
  2. Install dependencies
  3. Synchronize clocks
  4. Setting up Kerberos
  5. Setting up Apache
  6. Testing