Skip to content

Instantly share code, notes, and snippets.

@micheleorsi
micheleorsi / crontab -e
Last active August 29, 2015 14:11
Make a zip, upload to Google Cloud Storage every couple of days
# every couple of days at 2PM run git repo backup
0 14 */2 * * /home/git/runBackup.sh
@micheleorsi
micheleorsi / gist:b3086060e37db3e18bf7
Last active August 29, 2015 14:10
crontab examples
# once a day at 23:50
50 23 * * * <command>
# every 2 hours at 00 minutes
0 */2 * * * <command>
# every hour at 29 and 59 minutes (that means every half an hour)
29,59 * * * * <command>
# every hour at 59 minutes
@micheleorsi
micheleorsi / keybase.md
Created November 7, 2014 16:25
keybase.md

Keybase proof

I hereby claim:

  • I am micheleorsi on github.
  • I am micheleorsi (https://keybase.io/micheleorsi) on keybase.
  • I have a public key whose fingerprint is F846 98A8 2306 114C C604 7478 69AB 77A6 10F6 6B7F

To claim this, I am signing this object:

@micheleorsi
micheleorsi / uploadFile.sh
Created October 30, 2014 15:11
upload file to Google Cloud Storage, set it public and set cache
#!/bin/bash
# Check args
if [ $# \< 2 ]; then
echo "Usage: $(basename $0 $1) <file> <cache-millisec>";
exit 1;
fi
#file name
fileName="";
@micheleorsi
micheleorsi / .bash_profile
Last active November 4, 2016 21:02
config & reminders for Mac OS X development machine
export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)"
export HOMEBREW_GITHUB_API_TOKEN=<token>
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
export ANDROID_HOME=/usr/local/opt/android-sdk
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Amazon AWS
#export AWS_ACCESS_KEY="<key>"
@micheleorsi
micheleorsi / crontab
Last active August 29, 2015 14:05
Crontab for export Google App Engine logs
# run every 10 minutes
*/10 * * * * $GAE_PATH/appcfg.py -A <application-name> -V <release-name> -M <module> --oauth2 --include_all --append -n 1 request_logs $LOG_PATH`date +\%y-\%m-\%d`-log.log
@micheleorsi
micheleorsi / gist:822192bbe0904cca3f7f
Last active August 29, 2015 14:05
Installation Elasticsearch / LogStash on Ubuntu in Amazon AWS
# set public key
# change timezone to PST (sudo dpkg-reconfigure tzdata)
# update VM
$ sudo apt-get update && sudo apt-get upgrade
# install java
$ sudo apt-get -y install openjdk-7-jdk
$ java -version
@micheleorsi
micheleorsi / gist:bd20912b2489f3432558
Last active October 9, 2023 18:15
Installation Jenkins and Sonarqube as CI on ubuntu/trusty64
# set public key
# update VM
sudo apt-get update
# JAVA installation
sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java7-installer && sudo apt-get install oracle-java7-set-default
# install git
sudo apt-get install git zip ant
@micheleorsi
micheleorsi / LoopCryptoMiner.sh
Last active January 1, 2016 20:09
Mine different crypto currencies, using miningpool.co pool server(s).
#!/bin/bash
# SETTINGS
# You should specify here your worker name
USERNAME="username"
# You should specify here your worker password
PASSWORD="password"
# You should specify here how long each pool should run for
TIMEOUT="6h"
# The path where your miner is located
MINER_PATH="./minerd"
@micheleorsi
micheleorsi / 01_Top Channels Query AdSense.sql
Last active December 22, 2015 22:59
"Google Analytics and AdSense Data Analysis in BigQuery" @ Google I/O 2013, https://developers.google.com/events/io/sessions/332940014
SELECT
custom_channel_id,
SUM(earnings) AS earnings
FROM
[google.com:adsense-reports:Reports.DailyCustomChannelReport]
GROUP BY
custom_channel_id
ORDER BY
earnings DESC
LIMIT