Skip to content

Instantly share code, notes, and snippets.

View camilosampedro's full-sized avatar
🗼

Camilo Sampedro camilosampedro

🗼
  • Tokyo, Japan
  • 21:29 (UTC -05:00)
View GitHub Profile
if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
We couldn’t find that file to show.
@camilosampedro
camilosampedro / message with zenity.sh
Last active September 5, 2015 00:47
Showing a message
sudo -u $USERNAME DISPLAY=:0.0 zenity --warning --text="$MESSAGE"
@camilosampedro
camilosampedro / Instal Jupyter Cloudera Manager.sh
Last active September 29, 2015 14:54
Install Jupyter on LMDE2 and Cloudera
#!/bin/bash
# Execute this script as root
# First install python2.7 with an alternative installation
# (Source: http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/)
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
#!/bin/bash
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default
@camilosampedro
camilosampedro / FileMatcher.scala
Last active February 24, 2016 18:12
Scala simple examples
object FileMatcher {
private def filesHere = (new java.io.File(".")).listFiles
private def filesMatching(matcher: String => Boolean) =
for (file <- filesHere; if matcher(file.getName))
yield file
def filesEnding(query: String) =
filesMatching(_.endsWith(query))
# Verifies if Java is installed, and if it's not installed, install it.
function isJavaInstalled {
echo -ne "=> Verifying Java installation"
# Trying to execute java
java -version
# Getting the exit code of the execution.
EXITCODE="$?"
echo -ne "... "
@camilosampedro
camilosampedro / Daemon.sh
Last active October 22, 2016 01:12
Schema of how to create a script's daemon on /etc/init.d/
#!/bin/bash
### BEGIN INIT INFO
# Provides: start-hadoop
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Jupyter Notebook's service
# Description: Executes jupyter notebook in background.
### END INIT INFO
@camilosampedro
camilosampedro / Install Aton prerequisites.sh
Last active November 7, 2016 18:52
Installs Java 8, Activator and MySQL on Ubuntu 16.04 LTS
#!/bin/bash
# Variables
activator_version="1.3.12"
mysql_password="atonmysqldb"
# Install java
echo " => Installing Java 8"
echo " ==> Adding webupd8team/java repository"
sudo add-apt-repository ppa:webupd8team/java
echo " ==> Updating with the added repository"
{
echo "alias l.='ls -d .* --color=auto'"
echo "## get rid of command not found ##"
echo "alias cd..='cd ..'"
echo "## a quick way to get out of current directory ##"
echo "alias ..='cd ..'"
echo "alias ...='cd ../../../'"
echo "alias ....='cd ../../../../'"
echo "alias .....='cd ../../../../'"