Skip to content

Instantly share code, notes, and snippets.

View bvolpato's full-sized avatar
🐢
focus

Bruno Volpato bvolpato

🐢
focus
View GitHub Profile
@bvolpato
bvolpato / jstatd.sh
Created July 19, 2016 18:24
Remote VisualVM
cd $JAVA_HOME/bin
echo 'grant codebase "file:${java.home}/../lib/tools.jar" {permission java.security.AllPermission;};' > jstatd.all.policy
./jstatd -J-Djava.security.policy=jstatd.all.policy
@bvolpato
bvolpato / ba.sh
Created July 7, 2016 06:00
DCEVM on Ubuntu
#!/bin/bash
wget https://github.com/dcevm/dcevm/releases/download/light-jdk8u92%2B1/DCEVM-light-8u92-installer.jar
unzip -d dcevm DCEVM-light-8u92-installer.jar
mv $JAVA_HOME/jre/lib/amd64/server/libjvm.so $JAVA_HOME/jre/lib/amd64/server/libjvm.so.bkp
cp dcevm/linux_amd64_compiler2/product/libjvm.so $JAVA_HOME/jre/lib/amd64/server/libjvm.so.bkp
mkdir -p $JAVA_HOME/jre/lib/amd64/dcevm
cp dcevm/linux_amd64_compiler2/product/libjvm.so $JAVA_HOME/jre/lib/amd64/dcevm/libjvm.so
@bvolpato
bvolpato / ba.sh
Last active February 13, 2025 12:06
Install Chrome Driver with Xvfb (Ubuntu Server)
#!/bin/bash
# Chrome Repo
sudo apt-get install fonts-liberation xdg-utils libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
sudo apt-get update
# Download
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@bvolpato
bvolpato / netspeed.sh
Created April 20, 2016 04:34
netspeed.sh
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#
@bvolpato
bvolpato / gist:f64235c52866ebb235c65dc75f9f9e18
Created April 14, 2016 21:56 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@bvolpato
bvolpato / latency.txt
Created April 14, 2016 20:29 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@bvolpato
bvolpato / business-models.md
Created April 14, 2016 20:25 — forked from ndarville/business-models.md
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@bvolpato
bvolpato / whiteboardCleaner.md
Created April 14, 2016 20:20 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results