Skip to content

Instantly share code, notes, and snippets.

View dgraziotin's full-sized avatar

Daniel Graziotin dgraziotin

View GitHub Profile
@dgraziotin
dgraziotin / timecapsule-handler
Last active September 22, 2022 23:33
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.
#!/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 / build_httpd_php-fpm.sh
Created May 14, 2012 18:44
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/
#!/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
@dgraziotin
dgraziotin / app.R
Last active June 18, 2017 17:26
Timeline of Peer Review history
if(!require(dplyr)) {
install.packages("dplyr", dependencies = T)
}
if (!require("devtools")){
install.packages("devtools")
}
require(devtools)
@dgraziotin
dgraziotin / owncloud-client.log
Created July 12, 2013 12:07
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 December 15, 2015 08:08
Automatically generate a bare Python API client for CKAN v2.0
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 / httpd-vhosts-minimal.conf
Created September 12, 2012 20:31
php-fpm and httpd-vhosts minimal examples for Webfaction (see http://task3.cc/761 and https://gist.github.com/2695626)
# 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 / chart.temp.fan.speed.osx.R
Last active August 29, 2015 14:20
Chart CPU temperature and Fan Speed for OS X
# 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)