Skip to content

Instantly share code, notes, and snippets.

View ilbonzo's full-sized avatar
:shipit:
keep coding

Matteo Magni ilbonzo

:shipit:
keep coding
View GitHub Profile
@ilbonzo
ilbonzo / mac-setup.md
Last active September 21, 2018 10:14
When you buy a new Mac…

A New Mac

Computer name

  • scutil --set ComputerName "name"
  • scutil --set HostName "name"
  • scutil --set LocalHostName "name"

OS updates

@ilbonzo
ilbonzo / debian-cpuminer-multi.txt
Last active October 23, 2017 08:55
Monero mining
sudo apt-get install git libcurl4-openssl-dev build-essential libjansson-dev autotools-dev automake
git clone https://github.com/hyc/cpuminer-multi
cd cpuminer-multi
./autogen.sh
CFLAGS="-march=native" ./configure
# or without AES-NI
CFLAGS="-march=native" ./configure --disable-aes-ni
make
apt-get update
apt-get install libcurl4-openssl-dev git
apt-get install build-essential
apt-get install autotools-dev autoconf
apt-get install libcurl3 libcurl4-gnutls-dev
mkdir ~/miner
cd ~/miner
git clone https://github.com/pooler/cpuminer
cd cpuminer
pip install speedtest-cli
cd ~
mkdir scripts
cd scripts
mkdir speedtest
cd speedtest
git clone https://github.com/HenrikBengtsson/speedtest-cli-extras.git
mkdir results
# create header
/home/pi/scripts/speedtest/speedtest-cli-extras/bin/speedtest-csv --header > /home/pi/scripts/speedtest/results/speedtest_stats.tsv
@ilbonzo
ilbonzo / gist:ecb4be34ae5308db9cb7025c3a961d21
Created July 28, 2017 06:58
remove all docker images/containers
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker volume rm $(docker volume ls |awk '{print $2}')
rm -rf ~/Library/Containers/com.docker.docker/Data/*
{
"Seti_no_bar_undertabs": true,
"Seti_tabs_small": true,
"bold_folder_labels": true,
"caret_extra_width": 2,
"color_scheme": "Packages/Seti_UI/Scheme/Seti.tmTheme",
"detect_indentation": true,
"detect_slow_plugins": false,
"draw_minimap_border": true,
"draw_white_space": "all",
@ilbonzo
ilbonzo / getSiblings
Created February 10, 2015 09:53
get siblings of element without jquery
var getSiblings = function (elem) {
var n = elem.parentNode.firstChild;
var r = [];
for (; n; n = n.nextSibling) {
if (n.nodeType === 1 && n !== elem) {
r.push(n);
}
}
return r;
};
@ilbonzo
ilbonzo / git .bashrc
Last active August 29, 2015 14:10
Add git branch on bash prompt
#!/bin/sh
parse_git_branch () {
git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git::\1)#'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
@ilbonzo
ilbonzo / gist:9407465
Last active October 1, 2015 15:09
Preferences.sublime-text 3
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Solarized (dark) (SL).tmTheme",
"detect_indentation": true,
"detect_slow_plugins": false,
"draw_minimap_border": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
@ilbonzo
ilbonzo / Add App Name to prompt
Last active August 29, 2015 13:56
Add App Name to prompt from phing build.properties - example: devel@vlinux:~/workspace (app::name)$
#!/bin/sh
parse_build_properties_file() {
cat build.properties 2>/dev/null | grep application.name | awk -F = '{print " (app::"$2")" }'
}
# PATH
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$(parse_build_properties_file)\$ "