Skip to content

Instantly share code, notes, and snippets.

@eviweb
eviweb / nb_to_mvn.pl
Created December 17, 2019 15:59 — forked from abbaspour/nb_to_mvn.pl
Convert a NetBeans project to Maven
#!/usr/bin/perl
# generates Maven pom.xml based on nbproject
# d640492
use strict;
use warnings;
use File::Basename;
@eviweb
eviweb / vmtools
Last active August 29, 2015 14:22
VMWare Tools startup script
#! /bin/bash
### BEGIN INIT INFO
# Provides: vmtools
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: VMWare tools
# Description: This file starts and stops VMWare tools
#
@eviweb
eviweb / curlsh
Created December 9, 2013 22:57
secure `curl <url> | sh`
#! /bin/bash
# secure the use of `curl <url> | sh`
#
# @see http://blog.classicalcode.com/2012/11/curl-pipe-sh-exploit-proof-of-concept/
# @see http://www.djm.org.uk/protect-yourself-from-non-obvious-dangers-curl-url-pipe-sh/
# @see https://github.com/djm/pipe-to-sh-poc
#
# define a variable content using heredoc
function define()
@eviweb
eviweb / README.md
Created November 5, 2013 23:32
AMD module to convert filemode to permissions

AMD - CONVERTER

This amd module helps to convert file mode to linux permissions (eq. 644 -> rw-r--r--)

How to use it

Create a module and add the converter in the dependency array.
Use the static factory method create to get an instance of the module.
Then call the filemode2Perms method passing the file mode to convert.

#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@eviweb
eviweb / artisan
Created October 11, 2013 13:10
A unique artisan command for many Laravel projects
#! /bin/bash
# Set this file as executable in a directory of your PATH
# Once in any of your Laravel project, just run : artisan [...params]
[ -e ./artisan ] && ./artisan $@ || echo 'Not a Laravel project'