Skip to content

Instantly share code, notes, and snippets.

View camilosampedro's full-sized avatar
🗼

Camilo Sampedro camilosampedro

🗼
  • Tokyo, Japan
  • 10:49 (UTC -05:00)
View GitHub Profile
@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 / 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"
@arvind-iyer
arvind-iyer / .vimrc
Last active September 27, 2018 05:40
set nocompatible
filetype off
syntax on
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'nvie/vim-flake8'
@andershammar
andershammar / matplotlib-zeppelin
Created July 1, 2015 07:42
Example showing how to use matplotlib from a Zeppelin notebook
%pyspark
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
import StringIO
def show(p):
img = StringIO.StringIO()
p.savefig(img, format='svg')
@RadoBuransky
RadoBuransky / dist-play-app-initd
Last active March 24, 2020 20:26
Init.d shell script for Play framework distributed application. Provides start, stop, restart and status commands to control applications packaged using standard "play dist" packaging command.
#!/bin/bash
#
# =========================================================================
# Copyright 2014 Rado Buransky, Dominion Marine Media
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@sinmetal
sinmetal / export.go
Created November 27, 2017 02:32
Google Cloud Datastore Export Handler
package datastorebackup
import (
"fmt"
"net/http"
"time"
"google.golang.org/appengine"
"google.golang.org/appengine/log"
"google.golang.org/appengine/user"
@granturing
granturing / reactive_map.js
Last active November 14, 2022 04:28
Sample reactive Leaflet code for Zeppelin
<!-- place this in an %angular paragraph -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" />
<div id="map" style="height: 800px; width: 100%"></div>
<script type="text/javascript">
function initMap() {
var map = L.map('map').setView([30.00, -30.00], 3);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
@cpburnz
cpburnz / NVIDIA_GeForce_GTX_960M_with_Optimus_on_Arch_Linux.rst
Last active August 31, 2023 13:23
NVIDIA GeForce GTX 960M with Optimus on Arch Linux

Packages

  • bumblebee 3.2.1-10 (provides nvidia-libgl)
  • mesa 11.0.4-1
  • mesa-libgl 11.0.4-1
  • nvidia 355.11-4 (Nvidia driver)
  • primus 20150118-2 (Bumblebee bridge)
  • xf86-video-intel 1:2.99.917+478+gdf72bc5-2 (Intel driver)
@ahmetb
ahmetb / gcrgc.sh
Last active February 26, 2024 09:14
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@rjz
rjz / handler.go
Last active March 26, 2024 23:40
Handle Github webhooks with golang
// Now available in package form at https://github.com/rjz/githubhook
package handler
// https://developer.github.com/webhooks/
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"errors"