Skip to content

Instantly share code, notes, and snippets.

View mariusvw's full-sized avatar

Marius van Witzenburg mariusvw

View GitHub Profile
@mariusvw
mariusvw / WebSockets.md
Created April 17, 2018 22:22 — forked from subudeepak/WebSockets.md
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
@mariusvw
mariusvw / Afas.class.php
Created August 3, 2017 12:11 — forked from tvisser/Afas.class.php
PHP Class for easily using the Afas GetConnector or UpdateConnector
<?php
/**
* Class Afas
*
* This class has 3 static functions for accessing data using the Afas GetConnectors and UpdateConnectors.
* It includes the GET, POST and PUT request in their valid format.
*
* IMPORTANT: For it to work, remember to change the BASE_URL and TOKEN constants in the class.
*
#!/bin/sh
#
# This will remove Haskell Platform
#
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf /Library/Haskell
sudo rm -rf /var/db/receipts/org.haskell.HaskellPlatform.*
sudo find -L /usr/local -type l -print0 | sudo xargs -0 rm

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&amp;staging