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
@notdodo
notdodo / addjstopdf.py
Last active March 27, 2020 21:55
Add embedded JavaScript script to a PDF document (python3)
#!/usr/bin/env python3
# https://gist.github.com/edoz90/a441f2bdfc8c99c1999db0a3e8495fb6
# Author: notdodo
try:
from PyPDF2 import PdfFileWriter, PdfFileReader
import click
except ModuleNotFoundError:
print("pip install pypdf2 click")
import sys
@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
@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 / 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 / keyboard_chars
Created October 23, 2014 07:38
Keyboard characters
⌘ – ⌘ – ⌘ – the Command Key symbol
⌥ – ⌥ – ⌥ – the Option Key symbol
⇧ – ⇧ – ⇧ – the Shift Key symbol
⎋ – ⎋ – ⎋ – the ESC Key symbol
⇪ – ⇪ – ⇪ – the Capslock symbol
⏎ – ⏎ – ⏎ – the Return symbol
⌫ – ⌫ – ⌫ – the Delete / Backspace symbol
@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 / 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 / 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.
@daniellevass
daniellevass / android_material_design_colours.xml
Last active June 5, 2024 13:54
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@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