Skip to content

Instantly share code, notes, and snippets.

View alem0lars's full-sized avatar
💭
corrupting memory

Alessandro Molari alem0lars

💭
corrupting memory
View GitHub Profile
@alem0lars
alem0lars / either_maybe_usage.rb
Last active December 10, 2015 08:08
Either + Maybe usage
Maybe([1,2,3]).select {|e| e < 3} # Just([1, 2])
Maybe([1,2,3]).select {|e| e < 0} # Nothing
Maybe([1,2,3]).select {|e| e < 3} # Just([1, 2])
Either(Maybe([1,2,3]).select {|e| e < 3}) # Success([1, 2])
Either(Maybe([1,2,3]).select {|e| e < 0}) # Failure(Nothing)
@alem0lars
alem0lars / create_osgi_mvn_project.sh
Last active December 11, 2015 08:29
Create a OSGi Maven Project
PRJ_BASE_DIR="/usr/local/archive/projects" # Change this with your project parent directory.
PRJ_GROUP_ID="my.group.id"
PRJ_ARTIFACT_ID="myArtifact"
cd ${PRJ_BASE_DIR}
mvn org.ops4j:maven-pax-plugin:create-project -DgroupId=${PRJ_GROUP_ID} -DartifactId=${PRJ_ARTIFACT_ID}
# It allows to manage the OSGi runtime using the web-ui
mvn pax:import-bundle -DgroupId=org.apache.felix -DartifactId=org.apache.felix.webconsole -DimportTransitive=true -DimportOptional=true
@alem0lars
alem0lars / debian_expl_box_provision
Last active August 29, 2015 14:07
Provisioning script for a Linux (Debian-based) Exploitation Box
#!/bin/sh
set -e # Exit script immediately on first error.
set -x # Print commands and their arguments as they are executed.
# Update Debian package index.
sudo apt-get update -y
# Install basic packages.
@alem0lars
alem0lars / Vagrantfile_deb_expl_box
Created October 18, 2014 14:01
The Vagrantfile for a Debian-based exploitation box
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "fileutils"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@alem0lars
alem0lars / Vagrantfile_win_expl_box
Created October 18, 2014 14:01
The Vagrantfile for a Windows-based exploitation box
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "fileutils"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@alem0lars
alem0lars / keyboard_chars
Created October 23, 2014 07:38
Keyboard characters
⌘ – &#x2318; – &#8984; – the Command Key symbol
⌥ – &#x2325; – &#8997; – the Option Key symbol
⇧ – &#x21E7; – &#8679; – the Shift Key symbol
⎋ – &#x238B; – &#9099; – the ESC Key symbol
⇪ – &#x21ea; – &#8682; – the Capslock symbol
⏎ – &#x23ce; – &#9166; – the Return symbol
⌫ – &#x232b; – &#9003; – the Delete / Backspace symbol
@alem0lars
alem0lars / add_config_vcsh_mr.sh
Last active August 29, 2015 14:08
How to add a configuration (using VCSH and MR)
_config_name="foobar" # Replace "foobar" with the config name
_config_repo="git@github.com:alem0lars/configs-${_config_name}.git" # Replace with the right remote repo
# 1. Create the remote repository named: config-${_config_name}
# MANUAL
# 2. Add to MR
# 2.1 Add to available.d
echo "[\$HOME/.config/vcsh/repo.d/${_config_name}.git]" > ~/.config/mr/available.d/${_config_name}.vcsh
echo "checkout = vcsh clone ${_config_repo} ${_config_name}" >> ~/.config/mr/available.d/${_config_name}.vcsh
@alem0lars
alem0lars / verify_sig.rb
Last active November 12, 2015 11:30
Verify if secp128r1 signature is valid
#!/usr/bin/env ruby
#
# Verify if a secp128r1 signature is valid.
#
# Dependencies:
# * ECDSA (gem install ecdsa)
#
# Authors:
# Alessandro Molari (alem0lars) <molari.alessandro@gmail.com>
# Luca Molari (LMolr) <molari.luca@gmail.com>
@alem0lars
alem0lars / fit_content_style.scss
Created November 9, 2014 10:09
Children will fill all of the available viewport space (also vertically!)
html {
width: 100%;
height: 100%;
&>body {
width: 100%;
height: 100%;
&>.content {
display: table;
@alem0lars
alem0lars / migrate.zsh
Last active August 29, 2015 14:12 — forked from LMolr/migrate
Perform filesystem migration to a destination server (via rsync)
#!/usr/bin/env zsh
# parse arguments {{{
zparseopts -A _opts -user: -dstsrv: -dstpath:
if [[ $? -ne 0 ]]; then
echo 'invalid arguments'
exit -1