Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Graziotin dgraziotin

View GitHub Profile
@dgraziotin
dgraziotin / app.R
Last active Jun 18, 2017
Timeline of Peer Review history
View app.R
if(!require(dplyr)) {
install.packages("dplyr", dependencies = T)
}
if (!require("devtools")){
install.packages("devtools")
}
require(devtools)
@dgraziotin
dgraziotin / chart.temp.fan.speed.osx.R
Last active Aug 29, 2015
Chart CPU temperature and Fan Speed for OS X
View chart.temp.fan.speed.osx.R
# monitor your Macbook CPU temperature and the fan speed
# Required: iStats, https://github.com/Chris911/iStats
# Usage: Rscript chart.temp.fan.speed.osx.R
# Output: Rplots.pdf
if (!require("ggplot2")){
install.packages("ggplot2", dep=T)
}
require(ggplot2)
View owncloud-client.log
07-12 13:57:38:964 #-------# oC found on "https://owncloud.domain.ext"
07-12 13:57:39:026 oc_module: Authentication required
07-12 13:57:39:026 oc_module: Call the csync callback for ownCloud
07-12 13:57:39:173 oc_module: Simple propfind result code 207.
07-12 13:57:39:173 oc_module: opendir returning handle 054815f8
07-12 13:57:39:173 oc_module: owncloud_stat ownclouds://owncloud.domain.ext/remote.php/webdav/Development/Sites/personal/js called
07-12 13:57:39:173 csync_walker: directory: ownclouds://owncloud.domain.ext/remote.php/webdav/Development/Sites/personal/js
07-12 13:57:39:173 _csync_detect_update: ==> file: js - hash 17645160135380861920, mtime: 1373546553
07-12 13:57:39:173 _csync_detect_update: Database entry found, compare: 1373546553 <-> 1373546553, md5: 51dfaa8c7e735 <-> 51dfaa8c7e735
07-12 13:57:39:173 _csync_detect_update: file: js, instruction: INSTRUCTION_NONE <<=
@dgraziotin
dgraziotin / generate_clean_api_client.py
Last active Dec 15, 2015
Automatically generate a bare Python API client for CKAN v2.0
View generate_clean_api_client.py
import os
import inspect
import shutil
import docutils.core
import ckan.logic.action.get as getactions
import settings_clean_api_client as settings
def extract_func_params_from_doc(docstring):
params = []
@dgraziotin
dgraziotin / timecapsule-handler
Last active Apr 5, 2021
Script to automatically look for Apple TimeCapsule devices and mount/umount them under GNU/Linux. See http://task3.cc/418/how-to-automatically-mount-and-umount-apple-time-capsule-on-linu for info and explanations.
View timecapsule-handler
#!/bin/bash
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
# Version 3, enhanced for Ubuntu 13.X+, Fedora 19+, and similar distros.
@dgraziotin
dgraziotin / httpd-vhosts-minimal.conf
Created Sep 12, 2012
php-fpm and httpd-vhosts minimal examples for Webfaction (see http://task3.cc/761 and https://gist.github.com/2695626)
View httpd-vhosts-minimal.conf
# This is a minimal configuration example for httpd virtual host and php-fpm
# I put here the mod_fastcgi configuration even if it should be on a separate file
# Remember to use the right port number
NameVirtualHost *:12345
<IfModule mod_fastcgi.c>
# "fake" php handler
AddHandler php5-fcgi .php
Action php5-fcgi /fcgi-bin/php5.external
@dgraziotin
dgraziotin / build_httpd_php-fpm.sh
Created May 14, 2012
Script to build Apache httpd, mod_fcgi, mod_fastcgi, mod_php and PHP 5.4.3 + FPM on WebFaction. More info: http://task3.cc/761/httpd-mod_fcgid-mod_fastcgi-mod_php-php-fpm-on-webfaction/
View build_httpd_php-fpm.sh
#!/bin/bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details. */
# Usage: sh build_httpd_php-fpm.sh INSTALL_DIR PORT_NUM
# Example: sh build_httpd_php-fpm.sh $HOME/webapps/custom_apache 12345