Skip to content

Instantly share code, notes, and snippets.

View gadiener's full-sized avatar

Gabriele gadiener

View GitHub Profile
@gadiener
gadiener / facebook-ticker.js
Created July 25, 2016 16:04 — forked from kopiro/facebook-ticker.js
Filter Facebook ticker stories with a RegEx
(function() {
var filterName = new RegExp(prompt("Insert the regex"), 'i');
if (!filterName) {
return alert('Invalid regex');
}
var MAX_ITERATIONS = 500;
var $profileNode = document.querySelector('[title="Profile"] > span');
@gadiener
gadiener / _service.md
Created March 28, 2017 14:43 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@gadiener
gadiener / test.tree.php
Created May 22, 2017 07:35 — forked from lastguest/test.tree.php
[CAFFEINA] Exercise #1
<?php
include "tree.php";
$x = new Tree();
$x->bacon = "Pancetta";
$x->pasta["fagioli"] = 3;
$y = clone $x;
$y->pasta = null;

PHP OCI8 installation

Download the InstantClient from the Oracle website

  • instantclient-basic-macos.x64-VERSION.zip
  • instantclient-sqlplus-macos.x64-VERSION.zip
  • instantclient-sdk-macos.x64-VERSION.zip

Create and unzip all theses files into a the directory /opt/instantclient/VERSION

@gadiener
gadiener / README.md
Created September 4, 2017 15:27 — forked from kopiro/tor_exit_nodes.md
ProTip: Specify country exit nodes

With TOR, you can specify the country of exit nodes to test a particular website from a specific country.

Just add these 4 lines in the torrc file.

ExitNodes {jp}
StrictNodes 1
GeoIPExcludeUnknown 1
AllowSingleHopCircuits 0
@gadiener
gadiener / bitcoin-pay.rb
Created February 22, 2018 15:29 — forked from Sjors/bitcoin-pay.rb
This script demonstrates how a bitcoin transaction is created and signed. Just pass in your own address and private key and it will prepare a transaction for you. You can then copy & paste that transaction into a webservice like Blockchain to send it. I wrote this mostly to understand better how it works. I sometimes had to "cheat" and look at t…
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin
@gadiener
gadiener / nginx.conf
Created April 24, 2018 10:18 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gadiener
gadiener / gist:b7bfe89d9c1894d3be60fbabc61ca920
Created May 16, 2018 08:08 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@gadiener
gadiener / Virtual Box Host Only Static IP.md
Created May 16, 2018 09:12 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@gadiener
gadiener / vboxhostonlyssh.md
Created May 16, 2018 10:07 — forked from cfebs/vboxhostonlyssh.md
setup a vbox ubuntu server with host only adapter

Virtualbox dev environment w/ static IP

I can never find a great guide on this stuff, so these are more like notes to myself.

The goal here is to have a virtualbox running more or less headless. An ssh client is used separately to actually use the machine. I've found it to be fantastic for a quick dev setup.

lets go

Assumes you have a vbox setup with Ubuntu server (this will work for 16.04) ready to go.