Skip to content

Instantly share code, notes, and snippets.

Alessandro Siletto asiletto

Block or report user

Report or block asiletto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-npm-behind-proxy.sh
.gitconfig
[url "http://"]
insteadOf = git://
[http]
proxy = http://localhost:3110
[https]
proxy = http://localhost:3110
.npmrc
https-proxy=http://localhost:3110
View hashmap.js
define(function() {
HashMap = function() {
this._dict = [];
}
HashMap.prototype._get = function(key) {
for (var i = 0, couplet; couplet = this._dict[i]; i++) {
if (couplet[0] === key) {
return couplet;
@asiletto
asiletto / script.js
Last active Aug 29, 2015
access_log count group by user agent
View script.js
var fs = require('fs');
var UAParser = require('ua-parser-js');
var parser = new UAParser();
var map = [];
function readLines(input, func) {
var remaining = '';
input.on('data', function(data) {
remaining += data;
@asiletto
asiletto / iwlist.sh
Created May 30, 2015
list all wifi network in range with quality
View iwlist.sh
iwlist wlan0 scan |grep -E "Address|Channel|ESSID|Quality"
View drush-drupal7-install.sh
drush dl drupal
mv drupal-7.37/ d7dev
cd d7dev/
drush si standard --db-url=mysql://root:root@localhost:3306/d7dev --db-su=root --db-su-pw=root --site-name="Test"
cat > /etc/apache2/sites-available/d7dev.conf
<VirtualHost *:80>
ServerName d7dev
ServerAdmin webmaster@localhost
DocumentRoot /var/www/d7dev
View install-apache-php.sh
apt-get install apache2 libapache2-mod-php5 -y
apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev -y
@asiletto
asiletto / install.sh
Last active Aug 29, 2015
install & configure mongodb on virtualbox
View install.sh
# install a plain ubuntu with openssh server with 50Gb dynamic drive
#
apt-get update
apt-get dist-upgrade
#
# clone the image
#
# install mongodb on cloned image
apt-get install -y mongodb
#
@asiletto
asiletto / docker-virtualbox-test.sh
Last active Aug 29, 2015
docker hello world - install and run an apache2
View docker-virtualbox-test.sh
root@ubuntu:~# docker run -t -i ubuntu /bin/bash
root@e7ec762cee11:/# apt-get update && apt-get install apache2
root@e7ec762cee11:/# exit
root@ubuntu:~# docker commit e7ec762cee11 asiletto/test
root@ubuntu:~# docker run --name ap1 -d -p 80:80 asiletto/test /usr/sbin/apache2ctl -D FOREGROUND
root@ubuntu:~# links http://localhost/
View netmask.txt
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
View vbox-shared-folder.sh
apt-get install virtualbox-guest-dkms
reboot
adduser root vboxsf
adduser asiletto vboxsf
You can’t perform that action at this time.