Skip to content

Instantly share code, notes, and snippets.

View gadiener's full-sized avatar

Gabriele gadiener

View GitHub Profile

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 / git-debug.sh
Created September 7, 2017 09:07
Git debug
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
#!/bin/bash
TIME=`date "+%Y-%m-%d-%H-%M"`
BUCKET='backup'
rm -rf /tmp/backup
mkdir -p /tmp/backup
mysqldump --single-transaction --all-databases -u root | gzip > /tmp/backup/dump.sql.gz
aws s3 cp --recursive /tmp/backup "s3://$BUCKET/database/$TIME"
@gadiener
gadiener / fingerprint.sh
Created February 6, 2018 12:15
Check if file is modified bash
#!/bin/bash
for i in "$@"; do
file=$i
filename=$(basename "$file")
fingerprintfile="/tmp/$filename.md5"
if [ ! -f $file ]; then
echo "ERROR: $file does not exist - aborting"
@gadiener
gadiener / generate-bitcoin-keys.sh
Last active November 20, 2024 14:22
OpenSSL commands to create a Bitcoin private/public keys from a ECDSA keypair
#!/bin/sh
PRIVATE_KEY="ECDSA"
PUBLIC_KEY="ECDSA.pub"
BITCOIN_PRIVATE_KEY="bitcoin"
BITCOIN_PUBLIC_KEY="bitcoin.pub"
echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/random -out $PRIVATE_KEY
@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