Skip to content

Instantly share code, notes, and snippets.

Fulvio Notarstefano unfulvio

Block or report user

Report or block unfulvio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@unfulvio
unfulvio / epson-iscan-networked-scanner.md
Created Jul 5, 2017
Get Epson iScan to work in Ubuntu with a networked/wireless scanner
View epson-iscan-networked-scanner.md

If you see this error upon starting iScan aka "Image Scan for Linux":

“Could not send command to scanner. Check the scanner’s status.”

It means the iScan couldn't find the scanner. This happens often if it's not connected via USB, but lives in a wireless network for instance.

Do the following:

cd /etc/sane.d/
@unfulvio
unfulvio / functions.php
Created Feb 13, 2017 — forked from mgibbs189/functions.php
FacetWP - WooCommerce Memberships fix
View functions.php
<?php
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
if ( 'wc_user_membership' == $query->get( 'post_type' ) ) {
$is_main_query = false;
}
return $is_main_query;
}, 10, 2 );
@unfulvio
unfulvio / uninstall.sh
Last active Jun 12, 2018
Remove Intel Graphics Drivers for Linux and roll back to defaults in Ubuntu
View uninstall.sh
#Source: http://theclonker.de/?p=89
sudo apt-get update
sudo sh -c 'echo "\nPackage: *\nPin: release a=trusty*\nPin-Priority: 1001\n\nPackage: *\nPin: origin download.01.org\nPin-Priority: -100\n" > /etc/apt/preferences.d/intel-removal'
sudo apt-get dist-upgrade
sudo rm /etc/apt/preferences.d/intel-removal
sudo rm /etc/apt/sources.list.d/intellinuxgraphics.list*
sudo apt-get update
# Use the following to find your i915 driver versions:
# dpkg --get-selections | grep i915
# then replace the version you find here and execute this line:
@unfulvio
unfulvio / disable-woothemes-updater-notice.php
Created Apr 13, 2016
Disable WooThemes Updater Notice
View disable-woothemes-updater-notice.php
<?php
/*
* Plugin Name: Disable WooThemes Updater Notice
* Version: 1.0.0
* Plugin URI: https://github.com/unfulvio/
* Description: Disables the WooThemes Updater activation notice nag when the Updater is deactivated.
* Author: Fulvio Notarstefano
* Author URI: https://github.com/unfulvio/
* Requires at least: 4.0
* Tested up to: 4.5
@unfulvio
unfulvio / vagrant_setdate.sh
Last active May 21, 2019
How to change server time on a Vagrant box on Virtualbox
View vagrant_setdate.sh
#!/bin/bash
# Log in into the box
vagrant ssh
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first
sudo service vboxadd-service stop
# Now you can set any date and time
sudo date -s "2020-10-01 10:25:00"
@unfulvio
unfulvio / m_array_keys_from_string.php
Created Jun 29, 2015
Make a multidimensional array with keys from a string with a variable amount of key names placed between square brackets
View m_array_keys_from_string.php
<?php
/**
* Problem:
* Given a string similar to '[key][subkey][otherkey]'
* we want to make a multidimensional array $array['key']['subkey']['otherkey']
*
* Original question on Stackoverflow:
* @link http://stackoverflow.com/questions/31103719/php-make-a-multidimensional-associative-array-from-key-names-in-a-string-separat/31104168
* There are alternative solutions posted.
*/
@unfulvio
unfulvio / example.sh
Created Jun 19, 2015
Add all unversioned files to SVN
View example.sh
# See: http://stackoverflow.com/questions/1071857/how-do-i-svn-add-all-unversioned-files-to-svn
svn add --force * --auto-props --parents --depth infinity -q
@unfulvio
unfulvio / thinkpad.sh
Created May 30, 2015
Fix to re-enable Bluetooth on Thinkpad machines in Ubuntu in the event of a hardware hard off switch
View thinkpad.sh
echo options thinkpad_acpi dbg_bluetoothemul=1 bluetooth_state=1 | sudo tee -a /etc/modprobe.d/thinkpad_acpi.conf
@unfulvio
unfulvio / collation.php
Last active Aug 29, 2015
PHP Script to alter and convert all tables in a MySQL database to use a different character set and collation
View collation.php
<?php
// enter your database name
$database_name = 'name';
// enter your database user name
$database_username = 'user';
// enter your database user password
$database_password = 'password';
$connection = mysql_connect( 'localhost', $database_username, $database_password );
@unfulvio
unfulvio / functions.php
Created Jul 9, 2014
WordPress development: define WP_DEBUG conditionally using cookies
View functions.php
<?php
/**
* Sets a 'wp_debug' cookie for logged in WordPress administrators
* In conjunction with a properly configured wp-config.php, it can enable WP_DEBUG mode conditionally.
*
* @link http://wordpress.stackexchange.com/questions/69549/define-wp-debug-conditionally-for-admins-only-log-errors-append-query-arg-f
*/
function set_admin_debug_cookie( $user_login, $user ) {
You can’t perform that action at this time.