Discuss your project

PartITech blog

Technology blog

Technical analysis, practical guides and field experience to build, modernize and maintain sustainable applications.

232 articles Page 18

Apache: Overload htaccess authentication

To disable htaccess authentication, simply add a .htaccess to the root of the folder you wish to authorize with the following directive: Satisfy AnyOr you can place it directly in the vhost: Satisfy Any Compatibility context This procedure documents a PHP or Apache environment from its time. PHP 5.x and 7.x branches no longer receive standard support from the PHP project: do not deploy this configuration as is on a new server. First identify the versions actually installed and the loade...

Install Skype on Ubuntu with an alert wrapper

To install Skype, it is preferable to use the Ubuntu repository, which will install everything needed to manage sound and video properly. If you take the package available on the official website, it is likely that the sound will not be managed properly.1 – Install Skype: sudo add-apt-repository -y ppa:andykimpe/skype && sudo apt-get update sudo apt-get install skype2 – Install the wrapper: sudo add-apt-repository ppa:skype-wrapper/ppa sudo apt-get update && sudo apt-get install skype-wrapper...

Fix public key issues with apt (launchpad.net)

To add a public key to an Ubuntu repository, simply execute the following command and append the requested key (here 2EE5793634EF4A35 for rabbitVCS): sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2EE5793634EF4A35 Version context This procedure describes the software and the environment available at the time of its publication. The packages, interfaces, and repositories mentioned may have changed or disappeared; first check the system version and its support level. cat /etc/...

Dropbox for Linux

Download the following package: https://linux.dropbox.com/packages/debian/dropbox_1.6.0_amd64.debThen install it by double-clicking or with DPKG (dpkg -i )Next, edit the file /etc/sysctl.conf sudo vi /etc/sysctl.confand add the following directive: fs.inotify.max_user_watches=100000 Version context This procedure describes the software and the environment available at the time of its publication. The packages, interfaces, and repositories mentioned may have changed or disappeared; first ch...

HP drivers for Linux

Generic HP printer drivers can be downloaded here:http://netcologne.dl.sourceforge.net/project/hplip/hplip/3.14.6/hplip-3.14.6.runThen simply launch the installation and everything is done automatically 😉 Version context This procedure describes the software and the environment available at the time of its publication. The packages, interfaces, and repositories mentioned may have changed or disappeared; first check the system version and its support level. cat /etc/os-release uname -r Work...

Enable numLock at startup

To enable the numeric keypad on startup in Ubuntu, there are two solutions.1 – With the numlockx package (Starting from version 14.04 64-bit): sudo apt-get install numlockxDo not create a file at /etc/lightdm/lightdm.conf, otherwise lightdm will not start! In /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf Add the following in the [SeatDefaults] sectiongreeter-setup-script=/usr/bin/numlockx on2 – For all versions of Linux: Edit the file /etc/rc.local and add this: # Turn Numlock on fo...

WordPress: Rename the title of the excerpt editing area

It's true that when we talk about an excerpt, nobody understands what it refers to.To change the title of this editing area, just use the following snippet of code: add_filter( 'gettext', 'wpse22764_gettext', 10, 2 ); function wpse22764_gettext( $translation, $original ) { if ( 'Excerpt' == $original ) { return 'Sous-titre'; }else{ $pos = strpos($original, 'Excerpts are optional hand-crafted summaries of your'); if ($pos !== false) { return 'Sous-titre affiché dans les push.'; } } ret...

WordPress: Filter the MIME types of uploads

To ensure that just about anything isn't uploaded from the admin, you can configure the authorized MIME types as follows: add_filter('upload_mimes','custom_upload_mimes'); function custom_upload_mimes($mime_types=array()){ $mime_types = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'png' => 'image/png', 'mp4' => 'video/mp4', 'flv' => 'video/x-flv' ); return $mime_types; } Reproduce this customization today The principle of the hook remain...

WordPress: Add a filter by author in the admin posts list

To add an author filter on the list of articles page available in WordPress, simply add the following code to the functions.php file: Note: I have left the comment on the conditional instruction concerning the post types, it might come in handy 😊 function restrict_manage_authors() { /*if (isset($_GET['post_type']) && post_type_exists($_GET['post_type']) && in_array(strtolower($_GET['post_type']), array('your_custom_post_types', 'here'))) { */wp_dropdown_users(a...

WordPress: Remove comment metaboxes everywhere

To remove comment metaboxes from WordPress content editing pages, add the following code to your functions.php file: add_action('admin_menu','remove_comments_metabox'); function remove_comments_metabox() { remove_meta_box( 'postcomments','post','normal' ); } // Disable support for comments and trackbacks in post types function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types as $post_type) { if(post_type_supports($post_type, 'comments')) { remov...

WordPress: Change the default colors of the WordPress HTML editor

To change the default colors available in the WordPress WYSIWYG editor, simply add the following code to the functions.php file: // change buttons in WYSWIG post editor, edit color palette function change_mce_options( $init ) { $init['theme_advanced_text_colors'] = 'd21268,146c52,82b600,00949b,010080,001c4b'; $init['theme_advanced_more_colors'] = true; return $init; } add_filter('tiny_mce_before_init', 'change_mce_options'); Reproduce this customization today The principle of the hook rem...

WordPress: Override a template when a variable is present in the URL

In very rare cases, one might need to override the default template (although it's a bit dirty to do that).In the functions.php file, add the following code: function wpa_overload_template( $template ) { if( isset( $_GET['parameter'] ) ) { $template = locate_template('template-overload.php', false ); } return $template; } add_filter( 'template_include', 'wpa_overload_template' ); Reproduce this customization today The principle of the hook remains useful, but the administration screens ...